Search in sources :

Example 1 with IcCanUpdate

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;
}
Also used : IcObjectClassImpl(eu.bcvsolutions.idm.ic.impl.IcObjectClassImpl) IcCanUpdate(eu.bcvsolutions.idm.ic.api.operation.IcCanUpdate) 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 IcCanUpdate (eu.bcvsolutions.idm.ic.api.operation.IcCanUpdate)1 IcException (eu.bcvsolutions.idm.ic.exception.IcException)1 IcObjectClassImpl (eu.bcvsolutions.idm.ic.impl.IcObjectClassImpl)1