ECMA2 Framework
Home
  • Home
  • Using the Framework
    • Getting started
    • Definining the schema
    • Definining capabilites
    • Defining configuration parameters
    • Using the ProducerConsumerImportProvider
    • Building single-file assemblies
  • Additional resources
    • Example projects
      • Lithnet Okta Management Agent
      • Simple example
    • Troubleshooting
    • Change log
  • Advanced
    • API Reference
      • CapabilitiesConfigurationAttribute
      • CheckboxParameterAttribute
      • ConnectivityConfigurationAttribute
      • DataParameterAttribute
      • DividerParameterAttribute
      • DropdownParameterAttribute
      • Ecma2FrameworkOptions
      • EncryptedStringParameterAttribute
      • ExportContext
      • FileParameterAttribute
      • GlobalConfigurationAttribute
      • ICapabilitiesProvider
      • IConfigParameters
      • IConfigParametersProvider
      • IContextInitializer
      • ICSEntryChangeCollection
      • IEcmaStartup
      • ImportContext
      • IObjectExportProvider
      • IObjectImportProvider
      • IObjectPasswordProvider
      • ISchemaProvider
      • LabelParameterAttribute
      • MultilineTextboxParameterAttribute
      • ParameterAttribute
      • PartitionConfigurationAttribute
      • PasswordContext
      • ProducerConsumerImportProvider<TObject>
      • RunStepConfigurationAttribute
      • SchemaConfigurationAttribute
      • StringParameterAttribute
      • UIParameterAttribute
Powered by GitBook
On this page
  • Methods
  • CanImportAsync(SchemaType)
  • InitializeAsync(ImportContext)
  • GetCSEntryChangesAsync(SchemaType, ICSEntryChangeCollection, String, CancellationToken)
  • GetOutboundWatermark(SchemaType, CancellationToken)
  • OnFinalizeCsEntryChangeAsync(CSEntryChange, CancellationToken)
  • OnPrepareCSEntryChangeAsync(CSEntryChange, CancellationToken)
  • PrepareObjectForImportAsync(TObject, CancellationToken)
  • OnInitializeAsync()
  • OnStartProducerAsync()
  • OnCompleteProducerAsync()
  • OnStartConsumerAsync()
  • OnCompleteConsumerAsync()
  • GetAnchorAttributesAsync(TObject)
  • CreateAttributeChangeAsync(SchemaAttribute, ObjectModificationType, TObject, CancellationToken)
  • GetDNAsync(TObject)
  • GetObjectsAsync(String, CancellationToken)
  • GetObjectModificationTypeAsync(TObject)
  1. Advanced
  2. API Reference

ProducerConsumerImportProvider<TObject>

PreviousPasswordContextNextRunStepConfigurationAttribute

Last updated 1 year ago

Namespace: Lithnet.Ecma2Framework

The ProducerConsumerImportProvider class provides a base class for import providers that use a producer-consumer pattern.

This class provides a simple implementation of the producer-consumer pattern, and allows the developer to focus on the import logic, rather than the threading logic. Implementers implement the mandatory methods that enumerate the raw objects of type TObject, and provide the logic to convert these objects into CSEntryChange objects. The provider takes care of constructing the CSEntryChanges and passing them back to the sync engine.

public abstract class ProducerConsumerImportProvider<TObject> : IObjectImportProvider

Type Parameters

TObject The type of object that the provider will enumerate

Inheritance → Implements

Methods

CanImportAsync(SchemaType)

Gets a value indicating whether the provider can import objects of the specified type

public abstract Task<bool> CanImportAsync(SchemaType type)

Parameters

type SchemaType The type of object to be imported

Returns

if the provider can import the object, otherwise

InitializeAsync(ImportContext)

Initializes the object import provider. This method is called once at the start of an import operation

public Task InitializeAsync(ImportContext context)

Parameters

Returns

GetCSEntryChangesAsync(SchemaType, ICSEntryChangeCollection, String, CancellationToken)

public Task GetCSEntryChangesAsync(SchemaType type, ICSEntryChangeCollection collection, string watermark, CancellationToken cancellationToken)

Parameters

type SchemaType

Returns

GetOutboundWatermark(SchemaType, CancellationToken)

public abstract Task<string> GetOutboundWatermark(SchemaType type, CancellationToken cancellationToken)

Parameters

type SchemaType

Returns

OnFinalizeCsEntryChangeAsync(CSEntryChange, CancellationToken)

A method that is called when the CSEntryChange has been completed, but before it is returned to the sync engine. Override this method to inspect or modify the CSEntryChange before it is returned to the sync engine

protected Task OnFinalizeCsEntryChangeAsync(CSEntryChange csentry, CancellationToken cancellationToken)

Parameters

csentry CSEntryChange The CSEntryChange object that has been created

Returns

OnPrepareCSEntryChangeAsync(CSEntryChange, CancellationToken)

A method that is called when the CSEntryChange has been created, but before any attribute changes have been added to it. Override this method to inspect or modify the CSEntryChange before any attributes have been added to it

protected Task OnPrepareCSEntryChangeAsync(CSEntryChange csentry, CancellationToken cancellationToken)

Parameters

csentry CSEntryChange The CSEntryChange object that has been created

Returns

PrepareObjectForImportAsync(TObject, CancellationToken)

A method that is called when the object has been retrieved from the source, but before it is converted into a CSEntryChange object. Override this method to inspect or modify the object before it is converted into a CSEntryChange object

protected Task PrepareObjectForImportAsync(TObject item, CancellationToken cancellationToken)

Parameters

item TObject The object that has been retrieved from the source

Returns

OnInitializeAsync()

A method that is called when the provider is initialized, but before any objects are retrieved from the source. Override this method to perform any initialization logic

protected Task OnInitializeAsync()

Returns

OnStartProducerAsync()

A method that is called when the provider is initialized, but before any objects are retrieved from the source. Override this method to perform any initialization logic required to start producing objects

protected Task OnStartProducerAsync()

Returns

OnCompleteProducerAsync()

A method that is called when the provider has finished producing objects. Override this method to perform any cleanup logic required after all objects have been produced

protected Task OnCompleteProducerAsync()

Returns

OnStartConsumerAsync()

A method that is called when the provider has started consuming objects. Override this method to perform any initialization logic required to start consuming objects

protected Task OnStartConsumerAsync()

Returns

OnCompleteConsumerAsync()

A method that is called when the provider has finished consuming objects. Override this method to perform any cleanup logic required after all objects have been consumed and the provider is about to be terminated

protected Task OnCompleteConsumerAsync()

Returns

GetAnchorAttributesAsync(TObject)

Gets the list of AnchorAttributes for the specified object

protected abstract Task<List<AnchorAttribute>> GetAnchorAttributesAsync(TObject item)

Parameters

item TObject The object to get the AnchorAttributes for

Returns

CreateAttributeChangeAsync(SchemaAttribute, ObjectModificationType, TObject, CancellationToken)

Creates an AttributeChange object for the specified attribute

protected abstract Task<AttributeChange> CreateAttributeChangeAsync(SchemaAttribute type, ObjectModificationType modificationType, TObject item, CancellationToken cancellationToken)

Parameters

type SchemaAttribute The schema attribute to create the AttributeChange for

modificationType ObjectModificationType The modification type of the object

item TObject The object to create the AttributeChange from

Returns

GetDNAsync(TObject)

Gets the DN of the specified object. This will be used to populate the DN property of the CSEntryChange

protected abstract Task<string> GetDNAsync(TObject item)

Parameters

item TObject The item to return the DN of

Returns

GetObjectsAsync(String, CancellationToken)

Gets the objects to be imported.

protected abstract IAsyncEnumerable<TObject> GetObjectsAsync(string watermark, CancellationToken cancellationToken)

Parameters

Returns

IAsyncEnumerable<TObject> An enumerable of objects to be imported

GetObjectModificationTypeAsync(TObject)

Gets the modification type of the specified object. This will be used to determine the object modification type of the CSEntryChange

protected abstract Task<ObjectModificationType> GetObjectModificationTypeAsync(TObject item)

Parameters

item TObject The object to get the modification type of

Returns

context The context of the operation

A task that represents the asynchronous operation

collection

watermark

cancellationToken

cancellationToken

cancellationToken A cancellation token

A task that represents the asynchronous operation

cancellationToken A cancellation token

A task that represents the asynchronous operation

cancellationToken A cancellation token

A task that represents the asynchronous operation

A task that represents the asynchronous operation

A task that represents the asynchronous operation

A task that represents the asynchronous operation

A task that represents the asynchronous operation

A task that represents the asynchronous operation

A list of AnchorAttributes

cancellationToken A cancellation token

An AttributeChange represnting the specified attribute, or null if there are no changes to the attribute provided

The DN that will be used in the CSEntryChange

watermark The watermark value provided by the management agent after its last successful import

cancellationToken A cancellation token

The modification type of the object

Object
ProducerConsumerImportProvider<TObject>
IObjectImportProvider
Task<Boolean>
ImportContext
Task
ICSEntryChangeCollection
String
CancellationToken
Task
CancellationToken
Task<String>
CancellationToken
Task
CancellationToken
Task
CancellationToken
Task
Task
Task
Task
Task
Task
Task<List<AnchorAttribute>>
CancellationToken
Task<AttributeChange>
Task<String>
String
CancellationToken
Task<ObjectModificationType>