Class TstAbstractConnector
- All Implemented Interfaces:
CreateOp,DeleteOp,LiveSyncOp,SearchOp<Filter>,SPIOperation,SyncOp
- Direct Known Subclasses:
TstStatefulConnector,TstStatefulPoolableConnector
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate(ObjectClass objectClass, Set<Attribute> createAttributes, OperationOptions options) TheConnectordeveloper is responsible for taking the attributes given (which always includes theObjectClass) and create an object and itsUid.createFilterTranslator(ObjectClass objectClass, OperationOptions options) Creates a filter translator that will translate a specifiedFilterinto one or more native queries.voiddelete(ObjectClass objectClass, Uid uid, OperationOptions options) TheConnectordeveloper is responsible for calling the native delete methods to remove the object specified by its unique id.voidexecuteQuery(ObjectClass objectClass, Filter query, ResultsHandler handler, OperationOptions options) ConnectorFacade calls this method once for each native query that theSearchOp.createFilterTranslator(ObjectClass, OperationOptions)produces in response to theFilterpassed intoSearchApiOp.search(org.identityconnectors.framework.common.objects.ObjectClass, org.identityconnectors.framework.common.objects.filter.Filter, org.identityconnectors.framework.common.objects.ResultsHandler, org.identityconnectors.framework.common.objects.OperationOptions).getLatestSyncToken(ObjectClass objectClass) Returns the token corresponding to the most recent synchronization event.voidinit(Configuration cfg) voidlivesync(ObjectClass objectClass, LiveSyncResultsHandler handler, OperationOptions options) Request synchronization events--i.e., native changes to target objects.voidsync(ObjectClass objectClass, SyncToken token, SyncResultsHandler handler, OperationOptions options) Request synchronization events--i.e., native changes to target objects.
-
Field Details
-
config
-
-
Constructor Details
-
TstAbstractConnector
public TstAbstractConnector()
-
-
Method Details
-
init
-
create
public Uid create(ObjectClass objectClass, Set<Attribute> createAttributes, OperationOptions options) Description copied from interface:CreateOpTheConnectordeveloper is responsible for taking the attributes given (which always includes theObjectClass) and create an object and itsUid. TheConnectordeveloper must return theUidso that the caller can refer to the created object.*Note: There will never be a
Uidpassed in with the attribute set for this method. If the resource supports some sort of mutableUid, you should create your own resource-specific attribute for it, such as unix_uid.- Specified by:
createin interfaceCreateOp- Parameters:
objectClass- the type of object to create. Will never be null.createAttributes- includes all the attributes necessary to create the resource object including theObjectClassattribute andNameattribute.options- additional options that impact the way this operation is run. If the caller passes null, the framework will convert this into an empty set of options, so SPI need not worry about this ever being null.- Returns:
- the unique id for the object that is created. For instance in LDAP this would be the 'dn', for a database this would be the primary key, and for 'ActiveDirectory' this would be the GUID.
-
delete
Description copied from interface:DeleteOpTheConnectordeveloper is responsible for calling the native delete methods to remove the object specified by its unique id.- Specified by:
deletein interfaceDeleteOp- Parameters:
objectClass- type of object to delete.uid- The unique id that specifies the object to delete.options- additional options that impact the way this operation is run. If the caller passes null, the framework will convert this into an empty set of options, so SPI need not worry about this ever being null.
-
createFilterTranslator
public FilterTranslator<Filter> createFilterTranslator(ObjectClass objectClass, OperationOptions options) Description copied from interface:SearchOpCreates a filter translator that will translate a specifiedFilterinto one or more native queries. Each of these native queries will be passed subsequently intoexecuteQuery().- Specified by:
createFilterTranslatorin interfaceSearchOp<Filter>- Parameters:
objectClass- The object class for the search. Will never be null.options- additional options that impact the way this operation is run. If the caller passes null, the framework will convert this into an empty set of options, so SPI need not worry about this ever being null.- Returns:
- A filter translator. This must not be
null. Anullreturn value will cause the API (SearchApiOp) to throwNullPointerException.
-
executeQuery
public void executeQuery(ObjectClass objectClass, Filter query, ResultsHandler handler, OperationOptions options) Description copied from interface:SearchOpConnectorFacade calls this method once for each native query that theSearchOp.createFilterTranslator(ObjectClass, OperationOptions)produces in response to theFilterpassed intoSearchApiOp.search(org.identityconnectors.framework.common.objects.ObjectClass, org.identityconnectors.framework.common.objects.filter.Filter, org.identityconnectors.framework.common.objects.ResultsHandler, org.identityconnectors.framework.common.objects.OperationOptions). If theFilterTranslatorproduces more than one native query, then ConnectorFacade will automatically merge the results from each query and eliminate any duplicates. NOTE that this implies an in-memory data structure that holds a set of Uid values, so memory usage in the event of multiple queries will be O(N) where N is the number of results. This is why it is important that the FilterTranslator for each Connector implement OR if possible.- Specified by:
executeQueryin interfaceSearchOp<Filter>- Parameters:
objectClass- The object class for the search. Will never be null.query- The native query to run. A value of null means "return every instance of the given object class".handler- Results should be returned to this handleroptions- Additional options that impact the way this operation is run. If the caller passes null, the framework will convert this into an empty set of options, so SPI need not guard against options being null.
-
sync
public void sync(ObjectClass objectClass, SyncToken token, SyncResultsHandler handler, OperationOptions options) Description copied from interface:SyncOpRequest 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
SyncOp.getLatestSyncToken(org.identityconnectors.framework.common.objects.ObjectClass)and then pass that token into thissync()method.- Specified by:
syncin interfaceSyncOp- 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. TheSyncResultsHandlerwill return any number of SyncDelta objects, each of which contains a token. Should benullif 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. If the caller passesnull, the framework will convert this into an empty set of options, so an implementation need not guard against this being null.
-
getLatestSyncToken
Description copied from interface:SyncOpReturns the token corresponding to the most recent synchronization event.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:
getLatestSyncTokenin interfaceSyncOp- Parameters:
objectClass- the class of object for which to find the most recent synchronization event (if any). Must not be null.- Returns:
- A token if synchronization events exist; otherwise
null.
-
livesync
public void livesync(ObjectClass objectClass, LiveSyncResultsHandler handler, OperationOptions options) Description copied from interface:LiveSyncOpRequest 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.
- Specified by:
livesyncin interfaceLiveSyncOp- Parameters:
objectClass- The class of object for which to return synchronization events. Must not be null.handler- The result handler. Must not be null.options- Options that affect the way this operation is run. If the caller passesnull, the framework will convert this into an empty set of options, so an implementation need not guard against this being null.
-