Search in sources :

Example 1 with MetaOutboundConnectorListItem

use of org.wso2.carbon.identity.api.server.idp.v1.model.MetaOutboundConnectorListItem 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;
}
Also used : MetaOutboundConnectorListItem(org.wso2.carbon.identity.api.server.idp.v1.model.MetaOutboundConnectorListItem)

Example 2 with MetaOutboundConnectorListItem

use of org.wso2.carbon.identity.api.server.idp.v1.model.MetaOutboundConnectorListItem 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

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