本文整理了Java中org.wso2.carbon.identity.application.common.model.Property.getName()
方法的一些代码示例,展示了Property.getName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Property.getName()
方法的具体详情如下:
包路径:org.wso2.carbon.identity.application.common.model.Property
类名称:Property
方法名:getName
暂无
代码示例来源:origin: wso2/carbon-identity-framework
public static Property getProperty(Property[] properties, String propertyName) {
if (ArrayUtils.isEmpty(properties) || StringUtils.isBlank(propertyName)) {
return null;
}
for (Property property : properties) {
if (property == null) {
continue;
}
if (propertyName.equals(property.getName())) {
return property;
}
}
return null;
}
代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.application.common
public static Property getProperty(Property[] properties, String propertyName) {
if (ArrayUtils.isEmpty(properties) || StringUtils.isBlank(propertyName)) {
return null;
}
for (Property property : properties) {
if (property == null) {
continue;
}
if (propertyName.equals(property.getName())) {
return property;
}
}
return null;
}
代码示例来源:origin: wso2/carbon-identity-framework
private static Property[] removeEmptyElements(Property[] properties) {
List<Property> propertyList = new ArrayList<>();
if (ArrayUtils.isNotEmpty(properties)) {
for (Property property : properties) {
if (property != null && StringUtils.isNotBlank(property.getName())) {
propertyList.add(property);
}
}
}
return propertyList.toArray(new Property[0]);
}
}
代码示例来源:origin: org.wso2.carbon.identity.metadata.saml2/org.wso2.carbon.identity.outbound.metadata.saml2
private Property getFederatedAuthenticatorConfigProperty(
FederatedAuthenticatorConfig samlFederatedAuthenticatorConfig, String name) {
for (Property property : samlFederatedAuthenticatorConfig.getProperties()) {
if (name.equals(property.getName())) {
return property;
}
}
return null;
}
代码示例来源:origin: wso2/carbon-identity-framework
private Property[] removeUniqueIdProperty(Property [] properties) {
if (ArrayUtils.isEmpty(properties)){
return new Property[0];
}
for (int i=0 ; i < properties.length; i++) {
if (properties[i] == null){
continue;
}
if (IdentityApplicationConstants.UNIQUE_ID_CONSTANT.equals(properties[i].getName())) {
Property[] propertiesTemp = properties;
if (log.isDebugEnabled()){
log.debug("Removing uniqueId property: " + properties[i].getName());
}
properties = (Property[])ArrayUtils.removeElement(properties, properties[i]);
//Removing uniqueId property from existing properties too
propertiesTemp[i] = null;
}
}
return properties;
}
}
代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.application.common
private Property[] removeUniqueIdProperty(Property [] properties) {
if (ArrayUtils.isEmpty(properties)){
return new Property[0];
}
for (int i=0 ; i < properties.length; i++) {
if (properties[i] == null){
continue;
}
if (IdentityApplicationConstants.UNIQUE_ID_CONSTANT.equals(properties[i].getName())) {
Property[] propertiesTemp = properties;
if (log.isDebugEnabled()){
log.debug("Removing uniqueId property: " + properties[i].getName());
}
properties = (Property[])ArrayUtils.removeElement(properties, properties[i]);
//Removing uniqueId property from existing properties too
propertiesTemp[i] = null;
}
}
return properties;
}
}
代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.application.mgt
/**
* Merge properties from config to request.
*
* @param sources
* @param destinations
*/
private void mergedPropertiesMetaData(Property[] sources, Property[] destinations) {
Map<String, Property> destinationMap = new HashMap<>();
if (ArrayUtils.isNotEmpty(destinations)) {
for (Property destination : destinations) {
destinationMap.put(destination.getName(), destination);
}
}
if (ArrayUtils.isNotEmpty(sources)) {
for (Property source : sources) {
Property property = destinationMap.get(source.getName());
if (property == null) {
destinationMap.put(source.getName(), source);
}
}
}
}
代码示例来源:origin: org.wso2.carbon.identity.governance/org.wso2.carbon.identity.governance
@Override
public Property[] getConfiguration(String[] propertyNames, String tenantDomain) throws
IdentityGovernanceException {
List<Property> requestedProperties = new ArrayList<>();
Property[] allProperties = getConfiguration(tenantDomain);
for (String propertyName : propertyNames) {
for (int i = 0; i < allProperties.length; i++) {
if (propertyName.equals(allProperties[i].getName())) {
requestedProperties.add(allProperties[i]);
break;
}
}
}
return requestedProperties.toArray(new Property[requestedProperties.size()]);
}
代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.governance
@Override
public Property[] getConfiguration(String[] propertyNames, String tenantDomain) throws
IdentityGovernanceException {
List<Property> requestedProperties = new ArrayList<>();
Property[] allProperties = getConfiguration(tenantDomain);
for (String propertyName : propertyNames) {
for (int i = 0; i < allProperties.length; i++) {
if (propertyName.equals(allProperties[i].getName())) {
requestedProperties.add(allProperties[i]);
break;
}
}
}
return requestedProperties.toArray(new Property[requestedProperties.size()]);
}
代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.application.mgt
/**
* Check whether the RelyingPartyKey is configured with the UI properties.
*
* @return
*/
public boolean isRelyingPartyKeyConfigured() {
Property[] configurationProperties = getConfigurationProperties();
if (configurationProperties != null) {
for (Property property : configurationProperties) {
if (property != null && StringUtils.isNotBlank(property.getName()) && property.getName().equals
(getRelyingPartyKey())) {
return true;
}
}
}
return false;
}
}
代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.provisioning.connector.spml
@Override
public void init(Property[] provisioningProperties) throws IdentityProvisioningException {
Properties configs = new Properties();
if (provisioningProperties != null && provisioningProperties.length > 0) {
for (Property property : provisioningProperties) {
configs.put(property.getName(), property.getValue());
if (IdentityProvisioningConstants.JIT_PROVISIONING_ENABLED.equals(property
.getName()) && "1".equals(property.getValue())){
jitProvisioningEnabled = true;
}
}
}
configHolder = new SPMLProvisioningConnectorConfig(configs);
}
代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.application.mgt
/**
* Reading the mapping of properties.
*
* @param customAuthenticator
* @param propertyName
* @return
*/
private Property getMappedProperty(AbstractInboundAuthenticatorConfig customAuthenticator, String propertyName) {
Property property = null;
if (customAuthenticator != null) {
Property[] confProps = customAuthenticator.getConfigurationProperties();
if (confProps != null) {
for (Property confProp : confProps) {
if (propertyName != null && propertyName.equals(confProp.getName())) {
property = confProp;
}
}
}
}
return property;
}
代码示例来源:origin: wso2/carbon-identity-framework
/**
* Check whether the RelyingPartyKey is configured with the UI properties.
*
* @return
*/
public boolean isRelyingPartyKeyConfigured() {
Property[] configurationProperties = getConfigurationProperties();
if (configurationProperties != null) {
for (Property property : configurationProperties) {
if (property != null && StringUtils.isNotBlank(property.getName()) && StringUtils.equals(property
.getName(), (getRelyingPartyKey()))) {
return true;
}
}
}
return false;
}
}
代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.provisioning.connector.salesforce
@Override
/**
*
*/
public void init(Property[] provisioningProperties) throws IdentityProvisioningException {
Properties configs = new Properties();
if (provisioningProperties != null && provisioningProperties.length > 0) {
for (Property property : provisioningProperties) {
configs.put(property.getName(), property.getValue());
if (IdentityProvisioningConstants.JIT_PROVISIONING_ENABLED.equals(property
.getName()) && "1".equals(property.getValue())) {
jitProvisioningEnabled = true;
}
}
}
configHolder = new SalesforceProvisioningConnectorConfig(configs);
}
代码示例来源:origin: org.wso2.carbon.identity.metadata.saml2/org.wso2.carbon.identity.outbound.metadata.saml2
/**
* Retrieves whether this property contains SAML Metadata *
*
* @param property
* @return boolean *
*/
public boolean canHandle(Property property) {
if (property != null) {
String meta = property.getName();
if (meta != null && meta.contains(IDPMetadataConstant.SAML)) {
if (property.getValue() != null && property.getValue().length() > 0){
return true;
}
return false;
} else {
return false;
}
} else {
return false;
}
}
代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.governance
public void updateConfigurations (Property[] configurations) throws IdentityGovernanceException {
String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain();
identityGovernanceService = new IdentityGovernanceServiceImpl();
Map<String, String> confMap = new HashMap<>();
for (Property configuration : configurations) {
confMap.put(configuration.getName(), configuration.getValue());
}
identityGovernanceService.updateConfiguration(tenantDomain, confMap);
}
代码示例来源:origin: org.wso2.carbon.identity.governance/org.wso2.carbon.identity.governance
public void updateConfigurations(Property[] configurations) throws IdentityGovernanceException {
String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain();
IdentityGovernanceService identityGovernanceService = IdentityMgtServiceDataHolder.getInstance()
.getIdentityGovernanceService();
Map<String, String> confMap = new HashMap<>();
for (Property configuration : configurations) {
confMap.put(configuration.getName(), configuration.getValue());
}
identityGovernanceService.updateConfiguration(tenantDomain, confMap);
}
代码示例来源:origin: wso2/carbon-identity-framework
/**
* @param externalIdPConfig
* @param name
* @return
*/
public static Map<String, String> getAuthenticatorPropertyMapFromIdP(
ExternalIdPConfig externalIdPConfig, String name) {
Map<String, String> propertyMap = new HashMap<String, String>();
if (externalIdPConfig != null) {
FederatedAuthenticatorConfig[] authenticatorConfigs = externalIdPConfig
.getIdentityProvider().getFederatedAuthenticatorConfigs();
for (FederatedAuthenticatorConfig authenticatorConfig : authenticatorConfigs) {
if (authenticatorConfig.getName().equals(name)) {
for (Property property : authenticatorConfig.getProperties()) {
propertyMap.put(property.getName(), property.getValue());
}
break;
}
}
}
return propertyMap;
}
代码示例来源:origin: org.wso2.carbon.identity.governance/org.wso2.carbon.identity.recovery
private String getIDPProperty(String tenantDomain, String propertyName) throws
IdentityRecoveryException {
String propertyValue = "";
try {
org.wso2.carbon.identity.application.common.model.Property[] configuration =
IdentityRecoveryServiceDataHolder.getInstance().getIdentityGovernanceService().
getConfiguration(new String[]{IdentityRecoveryConstants.ConnectorConfig.ENABLE_SELF_SIGNUP},
tenantDomain);
for (org.wso2.carbon.identity.application.common.model.Property configProperty : configuration) {
if (configProperty != null && propertyName.equalsIgnoreCase(configProperty.getName())) {
propertyValue = configProperty.getValue();
}
}
} catch (IdentityGovernanceException e) {
throw new IdentityRecoveryException("Error while retrieving resident identity provider for tenant : "
+ tenantDomain, e);
}
return propertyValue;
}
代码示例来源:origin: org.wso2.carbon.identity.governance/org.wso2.carbon.identity.recovery
public static String getRecoveryConfigs(String key, String tenantDomain) throws IdentityRecoveryServerException {
try {
Property[] connectorConfigs;
IdentityGovernanceService identityGovernanceService = IdentityRecoveryServiceDataHolder.getInstance()
.getIdentityGovernanceService();
connectorConfigs = identityGovernanceService.getConfiguration(new String[]{key}, tenantDomain);
for (Property connectorConfig : connectorConfigs) {
if (key.equals(connectorConfig.getName())) {
return connectorConfig.getValue();
}
}
throw Utils.handleServerException(IdentityRecoveryConstants.ErrorMessages.ERROR_CODE_ISSUE_IN_LOADING_RECOVERY_CONFIGS, null);
} catch (IdentityGovernanceException e) {
throw Utils.handleServerException(IdentityRecoveryConstants.ErrorMessages.ERROR_CODE_ISSUE_IN_LOADING_RECOVERY_CONFIGS, null, e);
}
}
内容来源于网络,如有侵权,请联系作者删除!