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