use of org.wso2.carbon.identity.application.common.model.xsd.ProvisioningConnectorConfig in project identity-api-server by wso2.
the class ServerIdpManagementService method createMetaOutboundConnectorListItem.
private MetaOutboundConnectorListItem createMetaOutboundConnectorListItem(ProvisioningConnectorConfig connectorConfig) {
MetaOutboundConnectorListItem metaOutboundProvisioningConnector = new MetaOutboundConnectorListItem();
metaOutboundProvisioningConnector.setName(connectorConfig.getName());
String connectorId = base64URLEncode(connectorConfig.getName());
metaOutboundProvisioningConnector.setConnectorId(connectorId);
metaOutboundProvisioningConnector.setSelf(ContextLoader.buildURIForBody(String.format(V1_API_PATH_COMPONENT + IDP_PATH_COMPONENT + "/meta/outbound-provisioning-connectors/%s", connectorId)).toString());
return metaOutboundProvisioningConnector;
}
use of org.wso2.carbon.identity.application.common.model.xsd.ProvisioningConnectorConfig in project identity-api-server by wso2.
the class ServerIdpManagementService method createOutboundConnectorListItem.
private OutboundConnectorListItem createOutboundConnectorListItem(String idPId, ProvisioningConnectorConfig config) {
String connectorId = base64URLEncode(config.getName());
OutboundConnectorListItem listItem = new OutboundConnectorListItem();
listItem.setConnectorId(connectorId);
listItem.setName(config.getName());
listItem.setIsEnabled(config.isEnabled());
listItem.setSelf(ContextLoader.buildURIForBody(String.format(V1_API_PATH_COMPONENT + IDP_PATH_COMPONENT + "/%s/provisioning/outbound-connectors/%s", idPId, connectorId)).toString());
return listItem;
}
use of org.wso2.carbon.identity.application.common.model.xsd.ProvisioningConnectorConfig in project identity-api-server by wso2.
the class ServerIdpManagementService method createMetaOutboundConnector.
private MetaOutboundConnector createMetaOutboundConnector(ProvisioningConnectorConfig connectorConfig) {
MetaOutboundConnector metaOutboundProvisioningConnector = new MetaOutboundConnector();
metaOutboundProvisioningConnector.setName(connectorConfig.getName());
metaOutboundProvisioningConnector.setDisplayName(connectorConfig.getName());
metaOutboundProvisioningConnector.setConnectorId(base64URLEncode(connectorConfig.getName()));
Property[] properties = connectorConfig.getProvisioningProperties();
List<MetaProperty> metaProperties = Arrays.stream(properties).map(propertyToExternalMeta).collect(Collectors.toList());
metaOutboundProvisioningConnector.setProperties(metaProperties);
return metaOutboundProvisioningConnector;
}
use of org.wso2.carbon.identity.application.common.model.xsd.ProvisioningConnectorConfig in project identity-api-server by wso2.
the class ServerIdpManagementService method createOutboundConnector.
/**
* Create external OutboundConnector from Provisioning Config.
*
* @param connectorId Outbound provisioning connector resource ID.
* @param identityProvider Identity Provider information.
* @return External outbound connector.
*/
private OutboundConnector createOutboundConnector(String connectorId, IdentityProvider identityProvider) {
ProvisioningConnectorConfig[] connectorConfigs = identityProvider.getProvisioningConnectorConfigs();
if (ArrayUtils.isEmpty(connectorConfigs)) {
return null;
}
ProvisioningConnectorConfig config = null;
boolean isDefaultConnector = false;
String connectorName = base64URLDecode(connectorId);
for (ProvisioningConnectorConfig connectorConfig : connectorConfigs) {
if (StringUtils.equals(connectorConfig.getName(), connectorName)) {
config = connectorConfig;
}
}
if (identityProvider.getDefaultProvisioningConnectorConfig() != null && StringUtils.equals(identityProvider.getDefaultProvisioningConnectorConfig().getName(), connectorName)) {
isDefaultConnector = true;
}
OutboundConnector outboundConnector = null;
if (config != null) {
outboundConnector = new OutboundConnector();
outboundConnector.setConnectorId(connectorId);
outboundConnector.setName(config.getName());
outboundConnector.setIsEnabled(config.isEnabled());
outboundConnector.setIsDefault(isDefaultConnector);
outboundConnector.setBlockingEnabled(config.isBlocking());
outboundConnector.setRulesEnabled(config.isRulesEnabled());
List<org.wso2.carbon.identity.api.server.idp.v1.model.Property> properties = Arrays.stream(config.getProvisioningProperties()).map(propertyToExternal).collect(Collectors.toList());
outboundConnector.setProperties(properties);
}
return outboundConnector;
}
use of org.wso2.carbon.identity.application.common.model.xsd.ProvisioningConnectorConfig in project identity-api-server by wso2.
the class ServerIdpManagementService method getMetaOutboundConnector.
/**
* Get meta information about a specific outbound provisioning connector supported by the IDPs.
*
* @param id Outbound Provisioning Connector ID.
* @return MetaOutboundConnector.
*/
public MetaOutboundConnector getMetaOutboundConnector(String id) {
String connectorName = base64URLDecode(id);
MetaOutboundConnector connector = null;
try {
ProvisioningConnectorConfig[] connectorConfigs = IdentityProviderServiceHolder.getIdentityProviderManager().getAllProvisioningConnectors();
if (ArrayUtils.isNotEmpty(connectorConfigs)) {
for (ProvisioningConnectorConfig connectorConfig : connectorConfigs) {
if (StringUtils.equals(connectorConfig.getName(), connectorName)) {
connector = createMetaOutboundConnector(connectorConfig);
break;
}
}
}
return connector;
} catch (IdentityProviderManagementException e) {
throw handleIdPException(e, Constants.ErrorMessage.ERROR_CODE_ERROR_RETRIEVING_META_CONNECTOR, id);
}
}
Aggregations