Interface DocumentSource<T>

Type Parameters:
T - document type
All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
NullDocumentSource

public interface DocumentSource<T> extends AutoCloseable
A configured document source, which represents a session for this channel. A client can subscribe to this channel by creating a document channel subscription using createDocumentSubscription(DocumentChannelListener)
  • Method Details

    • createDocumentSubscription

      DocumentChannelSubscription createDocumentSubscription(DocumentChannelListener<T> listener)
      Create a subscription, which will submit incoming documents to the listener
      Parameters:
      listener - listener to send documents to
      Returns:
      a subscription object, which handles the subscription state
    • poll

      DocumentBatch<T> poll(Duration duration)
      Polling the document source for documents. The size of the returned collection is determined by the implementation.
      Parameters:
      duration - maximum duration to wait
      Returns:
      a collection of documents, or null if no was available in that time
    • poll

      @Deprecated default DocumentBatch<T> poll(long duration, TimeUnit timeUnit)
      Deprecated.
      Use poll(Duration) instead
    • close

      void close()
      Close this source session
      Specified by:
      close in interface AutoCloseable