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;
}
Aggregations