use of eu.bcvsolutions.idm.ic.api.IcSyncResultsHandler in project CzechIdMng by bcvsolutions.
the class ConnIdIcConnectorService method synchronization.
@Override
public IcSyncToken synchronization(IcConnectorInstance connectorInstance, IcConnectorConfiguration connectorConfiguration, IcObjectClass objectClass, IcSyncToken token, IcSyncResultsHandler handler) {
Assert.notNull(connectorInstance);
Assert.notNull(connectorInstance.getConnectorKey());
Assert.notNull(connectorConfiguration);
Assert.notNull(objectClass);
Assert.notNull(handler);
LOG.debug("Start synchronization for connector {} and objectClass {} - ConnId", connectorInstance.getConnectorKey().toString(), objectClass.getDisplayName());
ConnectorFacade conn = getConnectorFacade(connectorInstance, connectorConfiguration);
ObjectClass objectClassConnId = ConnIdIcConvertUtil.convertIcObjectClass(objectClass);
if (objectClassConnId == null) {
objectClassConnId = ObjectClass.ACCOUNT;
}
SyncToken syncToken = ConnIdIcConvertUtil.convertIcSyncToken(token);
SyncResultsHandler handlerConnId = new SyncResultsHandler() {
@Override
public boolean handle(SyncDelta delta) {
return handler.handle(ConnIdIcConvertUtil.convertConnIdSyncDelta(delta));
}
};
SyncToken resultToken = conn.sync(objectClassConnId, syncToken, handlerConnId, null);
return ConnIdIcConvertUtil.convertConnIdSyncToken(resultToken);
}
Aggregations