public abstract class GenericMultiThreadedConnector<SKey extends Key> extends Connector
class
Modifier and Type | Class and Description |
---|---|
protected class |
GenericMultiThreadedConnector.EnumeratesFolderDeletionHelperClient |
Connector.ConnectorNameThreadFactory
config, DEFAULT_SCAN_MODE, papi
Constructor and Description |
---|
GenericMultiThreadedConnector(GenericMultiThreadedConnectorConfig config) |
GenericMultiThreadedConnector(PushAPI papi,
GenericMultiThreadedConnectorConfig config)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
addDocumentOperationToEnumeratedOperationPipeline(DocumentOperation<SKey> op)
Add a document operation to the pipeline manager
|
void |
addFolderOperationToEnumeratedOperationPipeline(FolderOperation<SKey> op)
Add a folder operation to the pipeline manager
|
protected void |
addRootKeyInPipelineManager(SKey root,
EnumerableOperationBuilder<SKey> opBuilder,
EnumerableOperationBuilder<SKey> opBuilderUpdate,
EnumerableOperationBuilder<SKey> operationBuilderNotModified)
Add root key to operation (called by initializePipelinesManager())
|
void |
addSynchronizerCallback(SynchronizerCallback<SKey> cb)
Add a new SynchronizerCallback which will be used during synchronization, allowing to execute specific operations
|
protected EnumerableOperationBuilder<SKey> |
buildAddDocumentOperationBuilderForFirstSync() |
protected EnumerableOperationBuilder<SKey> |
buildAddDocumentOperationBuilderForUpdate()
Get AddDocumentOperationBuilder
|
protected DeletedDocumentOperationBuilder<SKey> |
buildDeletedDocumentOperationBuilder() |
FolderDeletionHelper |
buildDeletionHelper(FolderDeletionHelper.FolderDeletionHelperClient client,
java.lang.String rootPathUri)
Returns this connector's deletion helper implementation provided this connector is in update mode
|
protected abstract SourceAdapter<SKey> |
buildSourceAdapter()
This method return a SourceAdapter implementation
|
protected abstract SourceEnumerator<SKey> |
buildSourceEnumerator()
This method return a SourceEnumerator implementation
|
protected java.util.List<SpecializedSourceAdapter<SKey>> |
buildSpecializedSourceAdapters()
Get SpecializedSourceAdapters
|
protected SKey |
buildStartKeyFromConf(java.lang.String configFolder,
boolean isFolder)
Call to transform Folder Name (from RootFolders) to FolderKey Override this function if the Document URI and root folder URI do not
share the same logic.
|
void |
callBeforeDestruction()
Override this method to do some task before the destruction of the
connector
|
Document |
fetch(java.lang.String uri)
This method is used to retrieve document from the source when CloudView
product needs it.
|
protected java.util.Iterator<UpdateItem> |
getActionToUpdate()
Override default operations executed for an update (that is, adding root keys to the list of operations to be executed) Default
implementation is to return null (ie.
|
GenericMultiThreadedConnectorConfig |
getConnectorConfig()
Return the connector's configuration.
|
PushAPI |
getCurrentPAPI() |
java.util.concurrent.ThreadFactory |
getDefaultThreadFactory() |
MetaContainer |
getDocumentSecurityTokens(java.lang.String uri)
This method is used to retrieve security tokens of a document.
|
abstract SKey |
getKeyFromUri(java.lang.String uri)
Get a Key, given the document URI.
|
int |
getNbThreadsPerEnumeratedDocumentOperationPipeline()
Number of threads processing documents inside the pipeline manager
|
int |
getNbThreadsPerEnumeratedFolderOperationPipeline()
Number of threads processing folders inside the pipeline manager
|
protected long |
handleRootDeletes()
Add root keys to operation
|
void |
init()
Initialization method called by connector framework after construction
|
protected void |
initializePipelinesManager(boolean forUpdate)
Add root keys to operation
|
boolean |
isdoDelete()
Do deletes for document that do not exist anymore
|
boolean |
isPushFolder()
Should folders be pushed as regular documents too ?
|
boolean |
isSynchronizeSourceEnumeratorsError()
Has en an error occurred during synchronization ?
|
boolean |
isUpdate()
The current synchronization job is an update of a previous synchronization job
|
protected void |
processActionToUpdate(java.util.Iterator<UpdateItem> items)
Execute a list of UpdateItem Called if getActionToUpdate() returned a non-null list
|
com.exalead.concurrent.ConcurrentProcessingQuotaWorker |
registerDocInProgress(Document doc)
Register a document in processing, for quota handling.
|
com.exalead.concurrent.ConcurrentProcessingQuotaWorker |
registerWorkInProgress(long size)
Register a worker in processing, for quota handling.
|
void |
removeSynchronizerCallback(SynchronizerCallback<SKey> cb)
Remove a SynchronizerCallback previously added by a call to addSynchronizerCallback()
|
void |
scan(PushAPI papi,
java.lang.String mode,
java.lang.Object modeConfig)
This method is used to push (or synchronize) all documents from the source
to CloudView product.
|
void |
setCurrentPAPI(PushAPI newPAPI) |
void |
setNbThreadsPerEnumeratedDocumentOperationPipeline(int nb)
Set the number of threads processing documents inside the pipeline manager
|
void |
setNbThreadsPerEnumeratedFolderOperationPipeline(int nb)
Set the number of threads processing folders inside the pipeline manager
|
void |
setNbThreadsPerEnumeratedOperationPipeline(int nb)
Set the number of threads processing documents or folders inside the pipeline manager
|
void |
setSynchronizeSourceEnumeratorsError(boolean value)
Called when an error occurred during synchronization
|
void |
terminateThreads()
Terminate all threads used by the pipeline manager
|
checkAbortingOperation, checkAbortingOperation, checkDataSourceAvailability, checkSecurityTokens, fetch, getConnectorName, getEndpointBuilder, getLogger, getLogger, getScanModes, getState, getState, getStatus, getStatus, getStatusException, init, onScanAborted, onScanAborted, onScanResumed, onScanResumed, onScanSuspended, onScanSuspended, scratch, selfAbortScan, selfAbortScan, synchronizeDocuments
protected java.util.concurrent.ThreadFactory threadFactory
protected static final java.lang.String DEFAULT_LAST_UPDATE_CHECKPOINT_BEGIN
protected static final java.lang.String DEFAULT_LAST_UPDATE_CHECKPOINT_END
protected volatile boolean syncEnumeratedError
protected volatile boolean pushFolder
protected final boolean neverSendDeletes
protected OperationPipelinesManager<SKey extends Key> enumeratedPipelinesManager
protected volatile boolean doDelete
protected volatile boolean isUpdate
protected java.lang.String last_update_checkpoint_begin
protected java.lang.String last_update_checkpoint_end
protected com.exalead.concurrent.ConcurrentProcessingQuota processingQuota
public SourceEnumerator<SKey extends Key> sourceEnumerator
public SourceAdapterManager<SKey extends Key> sourceAdapterManager
public SynchronizerCallbackContainer<SKey extends Key> synchronizerCallbackContainer
protected EnumerableOperationBuilder<SKey extends Key> addDocumentOperationBuilderForFirstAdd
protected EnumerableOperationBuilder<SKey extends Key> addDocumentOperationBuilderForUpdate
protected EnumerableOperationBuilder<SKey extends Key> addDocumentOperationBuilderForNotModified
protected EnumerableOperationBuilder<SKey extends Key> deletedDocumentOperationBuilder
@Deprecated public GenericMultiThreadedConnector(PushAPI papi, GenericMultiThreadedConnectorConfig config) throws java.lang.Exception
java.lang.Exception
public GenericMultiThreadedConnector(GenericMultiThreadedConnectorConfig config) throws java.lang.Exception
java.lang.Exception
public void init() throws java.lang.Exception
Connector
public GenericMultiThreadedConnectorConfig getConnectorConfig()
Connector
getConnectorConfig
in class Connector
public java.util.concurrent.ThreadFactory getDefaultThreadFactory()
protected abstract SourceAdapter<SKey> buildSourceAdapter() throws java.lang.Exception
java.lang.Exception
protected abstract SourceEnumerator<SKey> buildSourceEnumerator() throws java.lang.Exception
java.lang.Exception
protected SKey buildStartKeyFromConf(java.lang.String configFolder, boolean isFolder) throws java.lang.Exception
configFolder
- The configuration root folderjava.lang.Exception
protected EnumerableOperationBuilder<SKey> buildAddDocumentOperationBuilderForUpdate()
protected EnumerableOperationBuilder<SKey> buildAddDocumentOperationBuilderForFirstSync()
protected DeletedDocumentOperationBuilder<SKey> buildDeletedDocumentOperationBuilder()
public FolderDeletionHelper buildDeletionHelper(FolderDeletionHelper.FolderDeletionHelperClient client, java.lang.String rootPathUri) throws PushAPIException
client
- handles the actual deletes of the documents.rootPathUri
- the folder root keyisUpdate()
nullPushAPIException
public abstract SKey getKeyFromUri(java.lang.String uri) throws java.io.IOException
java.io.IOException
protected java.util.List<SpecializedSourceAdapter<SKey>> buildSpecializedSourceAdapters()
public boolean isPushFolder()
public void setSynchronizeSourceEnumeratorsError(boolean value)
public boolean isSynchronizeSourceEnumeratorsError()
public boolean isdoDelete()
public boolean isUpdate()
public void addSynchronizerCallback(SynchronizerCallback<SKey> cb)
SynchronizerCallback
public void removeSynchronizerCallback(SynchronizerCallback<SKey> cb)
protected java.util.Iterator<UpdateItem> getActionToUpdate()
protected void processActionToUpdate(java.util.Iterator<UpdateItem> items) throws java.lang.Exception
java.lang.Exception
public void scan(PushAPI papi, java.lang.String mode, java.lang.Object modeConfig) throws java.lang.Exception
Connector
scan
in class Connector
papi
- PushAPI used to dialog with CloudViewmode
- Type of scan to perform. Is always Connector.DEFAULT_SCAN_MODE
unless
the connector declares additional scan modes with ConnectorCapabilities
annotation.modeConfig
- Optional configuration given to the scanMode, according to ScanModeDefinition
annotation.java.lang.Exception
- Upon errorpublic Document fetch(java.lang.String uri) throws java.lang.Exception
Connector
public MetaContainer getDocumentSecurityTokens(java.lang.String uri) throws java.io.IOException
Connector
getDocumentSecurityTokens
in class Connector
uri
- Uri of documentjava.io.IOException
protected long handleRootDeletes() throws PushAPIException
PushAPIException
protected void initializePipelinesManager(boolean forUpdate) throws java.lang.Exception
java.lang.Exception
protected void addRootKeyInPipelineManager(SKey root, EnumerableOperationBuilder<SKey> opBuilder, EnumerableOperationBuilder<SKey> opBuilderUpdate, EnumerableOperationBuilder<SKey> operationBuilderNotModified) throws java.lang.Exception
java.lang.Exception
public void terminateThreads() throws java.lang.Exception
java.lang.Exception
public void callBeforeDestruction() throws java.lang.Exception
Connector
callBeforeDestruction
in class Connector
java.lang.Exception
public void addFolderOperationToEnumeratedOperationPipeline(FolderOperation<SKey> op) throws java.lang.Exception
java.lang.Exception
public void addDocumentOperationToEnumeratedOperationPipeline(DocumentOperation<SKey> op) throws java.lang.Exception
java.lang.Exception
public int getNbThreadsPerEnumeratedFolderOperationPipeline()
public int getNbThreadsPerEnumeratedDocumentOperationPipeline()
public void setNbThreadsPerEnumeratedFolderOperationPipeline(int nb)
public void setNbThreadsPerEnumeratedDocumentOperationPipeline(int nb)
public void setNbThreadsPerEnumeratedOperationPipeline(int nb)
public com.exalead.concurrent.ConcurrentProcessingQuotaWorker registerWorkInProgress(long size)
public com.exalead.concurrent.ConcurrentProcessingQuotaWorker registerDocInProgress(Document doc)
public PushAPI getCurrentPAPI()
public void setCurrentPAPI(PushAPI newPAPI)
Copyright © 2013 Dassault Systèmes, All Rights Reserved.