Search in sources :

Example 1 with IcCanRead

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

the class CzechIdMIcConnectorService method readObject.

@Override
public IcConnectorObject readObject(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("Read object - CzechIdM (Uid= {} {})", uid, key);
    if (objectClass == null) {
        objectClass = new IcObjectClassImpl(IcObjectClassInfo.ACCOUNT);
    }
    IcConnector connector = this.getConnectorInstance(connectorInstance, connectorConfiguration);
    if (!(connector instanceof IcCanRead)) {
        throw new IcException(MessageFormat.format("Connector [{0}] not supports read operation!", key));
    }
    IcConnectorObject object = ((IcCanRead) connector).read(uid, objectClass);
    LOG.debug("Readed object - CzechIdM ({}) Uid= {}", object, uid);
    return object;
}
Also used : IcObjectClassImpl(eu.bcvsolutions.idm.ic.impl.IcObjectClassImpl) IcConnectorObject(eu.bcvsolutions.idm.ic.api.IcConnectorObject) IcCanRead(eu.bcvsolutions.idm.ic.api.operation.IcCanRead) 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 IcConnectorObject (eu.bcvsolutions.idm.ic.api.IcConnectorObject)1 IcCanRead (eu.bcvsolutions.idm.ic.api.operation.IcCanRead)1 IcException (eu.bcvsolutions.idm.ic.exception.IcException)1 IcObjectClassImpl (eu.bcvsolutions.idm.ic.impl.IcObjectClassImpl)1