Search in sources :

Example 1 with IcCanDelete

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

the class CzechIdMIcConnectorService method deleteObject.

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

Aggregations

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