Interface FeedClient

  • All Superinterfaces:
    java.lang.AutoCloseable, java.io.Closeable

    public interface FeedClient
    extends java.io.Closeable
    Asynchronous feed client accepting document operations as JSON. The payload should be the same as the HTTP payload required by the /document/v1 HTTP API, i.e.,
         {
             "fields": {
                 ...
             }
         }
     
    Author:
    bjorncs, jonmv
    • Method Detail

      • put

        java.util.concurrent.CompletableFuture<Result> put​(DocumentId documentId,
                                                           java.lang.String documentJson,
                                                           OperationParameters params)
        Send a document put with the given parameters, returning a future with the result of the operation. Exceptional completion will use be an instance of FeedException or one of its sub-classes.
      • update

        java.util.concurrent.CompletableFuture<Result> update​(DocumentId documentId,
                                                              java.lang.String updateJson,
                                                              OperationParameters params)
        Send a document update with the given parameters, returning a future with the result of the operation. Exceptional completion will use be an instance of FeedException or one of its sub-classes.
      • remove

        java.util.concurrent.CompletableFuture<Result> remove​(DocumentId documentId,
                                                              OperationParameters params)
        Send a document remove with the given parameters, returning a future with the result of the operation. Exceptional completion will use be an instance of FeedException or one of its sub-classes.
      • stats

        OperationStats stats()
        Returns a snapshot of the stats for this feed client, such as requests made, and responses by status.
      • close

        void close​(boolean graceful)
        Shut down, and reject new operations. Operations in flight are allowed to complete normally if graceful.
      • close

        default void close()
        Initiates graceful shutdown. See close(boolean).
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable