Class DefaultQueryGateway

java.lang.Object
io.fluxzero.sdk.common.AbstractNamespaced<QueryGateway>
io.fluxzero.sdk.publishing.DefaultQueryGateway
All Implemented Interfaces:
Namespaced<QueryGateway>, QueryGateway, HasLocalHandlers

public class DefaultQueryGateway extends AbstractNamespaced<QueryGateway> implements QueryGateway
Default implementation of the QueryGateway interface.

This class delegates all operations defined in the QueryGateway interface to an underlying GenericGateway instance.

See Also:
  • Constructor Details

    • DefaultQueryGateway

      public DefaultQueryGateway()
  • Method Details

    • send

      public <R> CompletableFuture<R> send(Object payload, io.fluxzero.common.api.Metadata metadata, io.fluxzero.common.Guarantee guarantee)
      Description copied from interface: QueryGateway
      Sends a request with the given publication guarantee. The future represents its business response. Guarantee.DEFAULT uses the configured request policy; Guarantee.SENT and Guarantee.STORED override it for this call only. Guarantee.NONE is not supported.
      Specified by:
      send in interface QueryGateway
      Type Parameters:
      R - response payload type
      Parameters:
      payload - request payload
      metadata - request metadata; use Metadata.empty() when none is needed
      guarantee - request publication guarantee
      Returns:
      the business response future
    • send

      public <R> CompletableFuture<R> send(Request<R> payload, io.fluxzero.common.api.Metadata metadata, io.fluxzero.common.Guarantee guarantee)
      Description copied from interface: QueryGateway
      Sends a typed request with a per-call publication guarantee and returns its business response future.
      Specified by:
      send in interface QueryGateway
    • sendAndWait

      public <R> R sendAndWait(Object payload, io.fluxzero.common.api.Metadata metadata, io.fluxzero.common.Guarantee guarantee)
      Description copied from interface: QueryGateway
      Sends a request with a per-call publication guarantee and waits for its business response. Storage acknowledgment does not replace or delay an already available business response.
      Specified by:
      sendAndWait in interface QueryGateway
    • sendAndWait

      public <R> R sendAndWait(Request<R> payload, io.fluxzero.common.api.Metadata metadata, io.fluxzero.common.Guarantee guarantee)
      Description copied from interface: QueryGateway
      Sends a typed request with a per-call publication guarantee and waits for its business response.
      Specified by:
      sendAndWait in interface QueryGateway
    • sendForMessages

      public List<CompletableFuture<Message>> sendForMessages(io.fluxzero.common.Guarantee guarantee, Message... messages)
      Description copied from interface: QueryGateway
      Sends full request messages with one publication guarantee and returns business response futures in input order. Custom gateways retain their existing batch behavior for DEFAULT; unsupported explicit guarantees fail.
      Specified by:
      sendForMessages in interface QueryGateway
    • createForNamespace

      protected QueryGateway createForNamespace(String namespace)
      Specified by:
      createForNamespace in class AbstractNamespaced<QueryGateway>
    • forNamespace

      public DefaultQueryGateway forNamespace(String namespace)
      Description copied from interface: Namespaced
      Returns the resource scoped to the specified namespace. Passing null selects the namespace configured for this application.
      Specified by:
      forNamespace in interface Namespaced<QueryGateway>
      Overrides:
      forNamespace in class AbstractNamespaced<QueryGateway>
      Parameters:
      namespace - the namespace to which the returned resource is scoped, or null for the application namespace
      Returns:
      the resource associated with the specified namespace