Search in sources :

Example 1 with MetaOutboundConnector

use of org.wso2.carbon.identity.api.server.idp.v1.model.MetaOutboundConnector 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;
}
Also used : MetaOutboundConnector(org.wso2.carbon.identity.api.server.idp.v1.model.MetaOutboundConnector) MetaProperty(org.wso2.carbon.identity.api.server.idp.v1.model.MetaProperty) IdentityProviderProperty(org.wso2.carbon.identity.application.common.model.IdentityProviderProperty) Property(org.wso2.carbon.identity.application.common.model.Property) SubProperty(org.wso2.carbon.identity.application.common.model.SubProperty) MetaProperty(org.wso2.carbon.identity.api.server.idp.v1.model.MetaProperty)

Example 2 with MetaOutboundConnector

use of org.wso2.carbon.identity.api.server.idp.v1.model.MetaOutboundConnector 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);
    }
}
Also used : MetaOutboundConnector(org.wso2.carbon.identity.api.server.idp.v1.model.MetaOutboundConnector) IdentityProviderManagementException(org.wso2.carbon.idp.mgt.IdentityProviderManagementException) ProvisioningConnectorConfig(org.wso2.carbon.identity.application.common.model.ProvisioningConnectorConfig)

Example 3 with MetaOutboundConnector

use of org.wso2.carbon.identity.api.server.idp.v1.model.MetaOutboundConnector in project identity-api-server by wso2.

the class ServerIdpManagementService method getMetaOutboundConnectors.

/**
 * Get meta information about Identity Provider's outbound provisioning connectors.
 *
 * @return List of meta outbound provisioning connectors.
 */
public List<MetaOutboundConnectorListItem> getMetaOutboundConnectors() {
    List<MetaOutboundConnectorListItem> metaOutboundConnectors = new ArrayList<>();
    try {
        ProvisioningConnectorConfig[] connectorConfigs = IdentityProviderServiceHolder.getIdentityProviderManager().getAllProvisioningConnectors();
        if (ArrayUtils.isNotEmpty(connectorConfigs)) {
            for (ProvisioningConnectorConfig connectorConfig : connectorConfigs) {
                MetaOutboundConnectorListItem metaOutboundConnector = createMetaOutboundConnectorListItem(connectorConfig);
                metaOutboundConnectors.add(metaOutboundConnector);
            }
        }
        return metaOutboundConnectors;
    } catch (IdentityProviderManagementException e) {
        throw handleIdPException(e, Constants.ErrorMessage.ERROR_CODE_ERROR_RETRIEVING_META_CONNECTORS, null);
    }
}
Also used : ArrayList(java.util.ArrayList) MetaOutboundConnectorListItem(org.wso2.carbon.identity.api.server.idp.v1.model.MetaOutboundConnectorListItem) IdentityProviderManagementException(org.wso2.carbon.idp.mgt.IdentityProviderManagementException) ProvisioningConnectorConfig(org.wso2.carbon.identity.application.common.model.ProvisioningConnectorConfig)

Aggregations

MetaOutboundConnector (org.wso2.carbon.identity.api.server.idp.v1.model.MetaOutboundConnector)2 ProvisioningConnectorConfig (org.wso2.carbon.identity.application.common.model.ProvisioningConnectorConfig)2 IdentityProviderManagementException (org.wso2.carbon.idp.mgt.IdentityProviderManagementException)2 ArrayList (java.util.ArrayList)1 MetaOutboundConnectorListItem (org.wso2.carbon.identity.api.server.idp.v1.model.MetaOutboundConnectorListItem)1 MetaProperty (org.wso2.carbon.identity.api.server.idp.v1.model.MetaProperty)1 IdentityProviderProperty (org.wso2.carbon.identity.application.common.model.IdentityProviderProperty)1 Property (org.wso2.carbon.identity.application.common.model.Property)1 SubProperty (org.wso2.carbon.identity.application.common.model.SubProperty)1