Class SyncImpl
- java.lang.Object
-
- org.identityconnectors.framework.impl.api.local.operations.APIOperationRunner
-
- org.identityconnectors.framework.impl.api.local.operations.ConnectorAPIOperationRunner
-
- org.identityconnectors.framework.impl.api.local.operations.SyncImpl
-
- All Implemented Interfaces:
APIOperation
,SyncApiOp
public class SyncImpl extends ConnectorAPIOperationRunner implements SyncApiOp
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SyncImpl.AttributesToGetSyncResultsHandler
Simple handler to reduce the attributes to only the set of attribute to get.
-
Field Summary
-
Fields inherited from interface org.identityconnectors.framework.api.operations.APIOperation
NO_TIMEOUT
-
-
Constructor Summary
Constructors Constructor Description SyncImpl(ConnectorOperationalContext context, Connector connector)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SyncToken
getLatestSyncToken(ObjectClass objectClass)
Returns the token corresponding to the most recent synchronization event for any instance of the specified object class.SyncToken
sync(ObjectClass objectClass, SyncToken token, SyncResultsHandler handler, OperationOptions options)
Request synchronization events--i.e., native changes to target objects.-
Methods inherited from class org.identityconnectors.framework.impl.api.local.operations.ConnectorAPIOperationRunner
getConnector, getNormalizer, getOperationalContext
-
-
-
-
Constructor Detail
-
SyncImpl
public SyncImpl(ConnectorOperationalContext context, Connector connector)
-
-
Method Detail
-
sync
public SyncToken sync(ObjectClass objectClass, SyncToken token, SyncResultsHandler handler, OperationOptions options)
Description copied from interface:SyncApiOp
Request synchronization events--i.e., native changes to target objects.This method will call the specified handler once to pass back each matching synchronization event. Once this method returns, this method will no longer invoke the specified handler.
Each synchronization event contains a token that can be used to resume reading events starting from that point in the event stream. In typical usage, a client will save the token from the final synchronization event that was received from one invocation of this
sync()
method and then pass that token into that client's next call to thissync()
method. This allows a client to "pick up where he left off" in receiving synchronization events. However, a client can pass the token from any synchronization event into a subsequent invocation of thissync()
method. This will return synchronization events (that represent native changes that occurred) immediately subsequent to the event from which the client obtained the token.A client that wants to read synchronization events "starting now" can call
SyncApiOp.getLatestSyncToken(org.identityconnectors.framework.common.objects.ObjectClass)
and then pass that token into thissync()
method.- Specified by:
sync
in interfaceSyncApiOp
- Parameters:
objectClass
- The class of object for which to return synchronization events. Must not be null.token
- The token representing the last token from the previous sync. TheSyncResultsHandler
will return any number of SyncDelta objects, each of which contains a token. Should benull
if this is the client's first call to thesync()
method for this connector.handler
- The result handler. Must not be null.options
- Options that affect the way this operation is run. May be null.- Returns:
- The sync token or
null
.
-
getLatestSyncToken
public SyncToken getLatestSyncToken(ObjectClass objectClass)
Description copied from interface:SyncApiOp
Returns the token corresponding to the most recent synchronization event for any instance of the specified object class.An application that wants to receive synchronization events "starting now" --i.e., wants to receive only native changes that occur after this method is called-- should call this method and then pass the resulting token into the sync() method.
- Specified by:
getLatestSyncToken
in interfaceSyncApiOp
- Parameters:
objectClass
- the class of object for which to find the most recent synchronization event (if any).- Returns:
- A token if synchronization events exist; otherwise
null
.
-
-