Using the ProducerConsumerImportProvider
The framework comes with an import provider that uses the producer/consumer pattern to generate your CSEntryChanges and pass them back to the MIM sync engine.
This class abstracts away a lot of the boilerplate associated with generating CSEntryChange objects, and paging their results back to the MIM sync engine.
At a minimum, the following methods must be implemented.
CanImportAsync
CanImportAsyncThis method tells the framework if this provider is capable of importing the specific object type.
GetObjectsAsync
GetObjectsAsyncThis method is called at the start of the import operation. The method must return the models that represent the objects to be imported.
Typically this would be something like a 'get all users' call from the API.
Yield new objects as soon as they are available, as the consumer thread will start picking them up and converting them to CSEntryChanges.
GetAnchorAttributesAsync
GetAnchorAttributesAsyncOnce an object has been picked up by the consumer thread, this method will be called to obtain the anchor attributes. Using the model passed into the method, create the relevant AnchorAttribute values and return them. They will be added to the resulting CSEntryChange
GetDNAsync
GetDNAsyncThe consumer thread will call out to this method and request the DN that should be used for the given model object.
GetObjectModificationTypeAsync
GetObjectModificationTypeAsyncThe consumer thread will call out to this method to request the type of change to the object that is being processed. When in a full import operation, this will always be Add. In a delta import operation, determine the type of change that was made, and return the appopriate value.
CreateAttributeChangeAsync
CreateAttributeChangeAsyncFor each attribute in the schema, the consumer will call this method and ask for relevant AttributeChange objects for the schema attribute in question.
If there are no changes to the specified attribute, simply return null.
GetOutboundWatermark
GetOutboundWatermarkOnce the producer thread has completed, this method is called to obtain the watermark value. This value will be provided on the next import to the GetObjectsAsync method. This allows a delta import to resume from the last known location.
If the management agent doesn't support delta imports, then simply return null.
Last updated