use of eu.bcvsolutions.idm.ic.api.operation.IcCanUpdate in project CzechIdMng by bcvsolutions.
the class CzechIdMIcConnectorService method updateObject.
@Override
public IcUidAttribute updateObject(IcConnectorInstance connectorInstance, IcConnectorConfiguration connectorConfiguration, IcObjectClass objectClass, IcUidAttribute uid, List<IcAttribute> replaceAttributes) {
Assert.notNull(connectorInstance, "Connector instance is required.");
Assert.notNull(connectorInstance.getConnectorKey(), "Connector key is required.");
Assert.notNull(connectorConfiguration, "Configuration is required.");
Assert.notNull(replaceAttributes, "Replace attributes are required.");
Assert.notNull(uid, "Uid is required.");
String key = connectorInstance.getConnectorKey().toString();
LOG.debug("Update object - CzechIdM (Uid= {} {} {})", uid, key, replaceAttributes.toString());
if (objectClass == null) {
objectClass = new IcObjectClassImpl(IcObjectClassInfo.ACCOUNT);
}
IcConnector connector = this.getConnectorInstance(connectorInstance, connectorConfiguration);
if (!(connector instanceof IcCanUpdate)) {
throw new IcException(MessageFormat.format("Connector [{0}] not supports update operation!", key));
}
IcUidAttribute updatedUid = ((IcCanUpdate) connector).update(uid, objectClass, replaceAttributes);
LOG.debug("Updated object - CzechIdM ({} {}) Uid= {})", connectorInstance.getConnectorKey().toString(), replaceAttributes.toString(), updatedUid);
return updatedUid;
}
Aggregations