Search in sources :

Example 1 with IcSyncResultsHandler

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);
}
Also used : SyncToken(org.identityconnectors.framework.common.objects.SyncToken) IcSyncToken(eu.bcvsolutions.idm.ic.api.IcSyncToken) IcObjectClass(eu.bcvsolutions.idm.ic.api.IcObjectClass) ObjectClass(org.identityconnectors.framework.common.objects.ObjectClass) SyncDelta(org.identityconnectors.framework.common.objects.SyncDelta) IcConnectorFacade(eu.bcvsolutions.idm.ic.service.api.IcConnectorFacade) ConnectorFacade(org.identityconnectors.framework.api.ConnectorFacade) IcSyncResultsHandler(eu.bcvsolutions.idm.ic.api.IcSyncResultsHandler) SyncResultsHandler(org.identityconnectors.framework.common.objects.SyncResultsHandler)

Aggregations

IcObjectClass (eu.bcvsolutions.idm.ic.api.IcObjectClass)1 IcSyncResultsHandler (eu.bcvsolutions.idm.ic.api.IcSyncResultsHandler)1 IcSyncToken (eu.bcvsolutions.idm.ic.api.IcSyncToken)1 IcConnectorFacade (eu.bcvsolutions.idm.ic.service.api.IcConnectorFacade)1 ConnectorFacade (org.identityconnectors.framework.api.ConnectorFacade)1 ObjectClass (org.identityconnectors.framework.common.objects.ObjectClass)1 SyncDelta (org.identityconnectors.framework.common.objects.SyncDelta)1 SyncResultsHandler (org.identityconnectors.framework.common.objects.SyncResultsHandler)1 SyncToken (org.identityconnectors.framework.common.objects.SyncToken)1