Interface ConcurrencyProvider

  • All Known Implementing Classes:
    ConcurrentDocumentFetcherImpl

    public interface ConcurrencyProvider
    The connector framework pass an implementation of this to the scanner. The scanner uses this to queue DocumentFetchRequest objects for concurrent processing by the connector framework. The scanner also use this to store content in the content store.
    • Method Detail

      • queue

        boolean queue​(DocumentFetchRequest documentFetcher)
        Queue a document fetcher for concurrent execution by the connector framework. The call blocks until there is room in the queue.
        Parameters:
        documentFetcher - the document fetch request to queue
        Returns:
        true if queued; false if failed to queue. Queuing will fail only if a stop call was issued. Therefore a failure to queue is ok, exception should not be thrown.
      • doneQueuing

        void doneQueuing()
        The scanner tells the concurrency provider that it is done queuing tasks. The scanner can be done queuing because all the documents were scanner or because stop was called.
      • waitForOutstandingTasksToFinish

        void waitForOutstandingTasksToFinish()
        The scanner will use this to wait until all the tasks are executed (or canceled). A use example: the scanner will wait until all the outstanding document publishing is done before going into a phase of deleting obsolete documents. Note that we don't support a timeout here since tasks should never linger forever if canceled - the connector implementation requires that all the tasks are finished before the connector run is complete.
      • backOff

        void backOff​(long millisBackOffPeriod)
        Blocks the scanner's ability to queue DocumentFetchRequest requests for a period of time. Used by scanners that honor try-after requests from the server (e.g. the Sharepoint scanner).
        Parameters:
        millisBackOffPeriod - ignored if not > 0