Search in sources :

Example 1 with IcCanGenSchema

use of eu.bcvsolutions.idm.ic.api.operation.IcCanGenSchema in project CzechIdMng by bcvsolutions.

the class CzechIdMIcConfigurationService method getSchema.

@Override
public IcSchema getSchema(IcConnectorInstance connectorInstance, IcConnectorConfiguration connectorConfiguration) {
    Assert.notNull(connectorInstance, "Connector instance is required.");
    Assert.notNull(connectorInstance.getConnectorKey(), "Connector key is required.");
    Assert.notNull(connectorConfiguration, "Configuration is required.");
    String key = connectorInstance.getConnectorKey().toString();
    LOG.debug("Generate schema - CzechIdM {}", key);
    IcConnector connector = createConnectorInstance(connectorInstance);
    if (!(connector instanceof IcCanGenSchema)) {
        throw new IcException(MessageFormat.format("Connector [{0}] not supports generate schema operation!", key));
    }
    connector.init(connectorConfiguration);
    IcSchema schema = ((IcCanGenSchema) connector).schema();
    LOG.debug("Generated schema - CzechIdM ({}) schema = {}", key, schema);
    return schema;
}
Also used : IcCanGenSchema(eu.bcvsolutions.idm.ic.api.operation.IcCanGenSchema) IcConnector(eu.bcvsolutions.idm.ic.api.IcConnector) IcException(eu.bcvsolutions.idm.ic.exception.IcException) IcSchema(eu.bcvsolutions.idm.ic.api.IcSchema)

Aggregations

IcConnector (eu.bcvsolutions.idm.ic.api.IcConnector)1 IcSchema (eu.bcvsolutions.idm.ic.api.IcSchema)1 IcCanGenSchema (eu.bcvsolutions.idm.ic.api.operation.IcCanGenSchema)1 IcException (eu.bcvsolutions.idm.ic.exception.IcException)1