Search in sources :

Example 1 with IcCanCreate

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

the class CzechIdMIcConnectorService method createObject.

@Override
public IcUidAttribute createObject(IcConnectorInstance connectorInstance, IcConnectorConfiguration connectorConfiguration, IcObjectClass objectClass, List<IcAttribute> attributes) {
    Assert.notNull(connectorInstance);
    Assert.notNull(connectorInstance.getConnectorKey());
    Assert.notNull(connectorConfiguration);
    Assert.notNull(attributes);
    String key = connectorInstance.getConnectorKey().toString();
    LOG.debug("Create object - CzechIdM ({} {})", key, attributes.toString());
    if (objectClass == null) {
        objectClass = new IcObjectClassImpl(IcObjectClassInfo.ACCOUNT);
    }
    IcConnector connector = this.getConnectorInstance(connectorInstance, connectorConfiguration);
    if (!(connector instanceof IcCanCreate)) {
        throw new IcException(MessageFormat.format("Connector [{0}] not supports create operation!", key));
    }
    IcUidAttribute uid = ((IcCanCreate) connector).create(objectClass, attributes);
    LOG.debug("Created object - CzechIdM ({} {}) Uid= {}", key, attributes.toString(), uid);
    return null;
}
Also used : IcObjectClassImpl(eu.bcvsolutions.idm.ic.impl.IcObjectClassImpl) IcCanCreate(eu.bcvsolutions.idm.ic.api.operation.IcCanCreate) IcConnector(eu.bcvsolutions.idm.ic.api.IcConnector) IcException(eu.bcvsolutions.idm.ic.exception.IcException) GuardedString(eu.bcvsolutions.idm.core.security.api.domain.GuardedString) IcUidAttribute(eu.bcvsolutions.idm.ic.api.IcUidAttribute)

Aggregations

GuardedString (eu.bcvsolutions.idm.core.security.api.domain.GuardedString)1 IcConnector (eu.bcvsolutions.idm.ic.api.IcConnector)1 IcUidAttribute (eu.bcvsolutions.idm.ic.api.IcUidAttribute)1 IcCanCreate (eu.bcvsolutions.idm.ic.api.operation.IcCanCreate)1 IcException (eu.bcvsolutions.idm.ic.exception.IcException)1 IcObjectClassImpl (eu.bcvsolutions.idm.ic.impl.IcObjectClassImpl)1