Class DefaultQueryGateway
java.lang.Object
io.fluxzero.sdk.common.AbstractNamespaced<QueryGateway>
io.fluxzero.sdk.publishing.DefaultQueryGateway
- All Implemented Interfaces:
Namespaced<QueryGateway>, QueryGateway, HasLocalHandlers
Default implementation of the
QueryGateway interface.
This class delegates all operations defined in the QueryGateway interface to an underlying
GenericGateway instance.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected QueryGatewaycreateForNamespace(String namespace) forNamespace(String namespace) Returns the resource scoped to the specified namespace.<R> CompletableFuture<R> send(Request<R> payload, io.fluxzero.common.api.Metadata metadata, io.fluxzero.common.Guarantee guarantee) Sends a typed request with a per-call publication guarantee and returns its business response future.<R> CompletableFuture<R> send(Object payload, io.fluxzero.common.api.Metadata metadata, io.fluxzero.common.Guarantee guarantee) Sends a request with the given publication guarantee.<R> RsendAndWait(Request<R> payload, io.fluxzero.common.api.Metadata metadata, io.fluxzero.common.Guarantee guarantee) Sends a typed request with a per-call publication guarantee and waits for its business response.<R> RsendAndWait(Object payload, io.fluxzero.common.api.Metadata metadata, io.fluxzero.common.Guarantee guarantee) Sends a request with a per-call publication guarantee and waits for its business response.sendForMessages(io.fluxzero.common.Guarantee guarantee, Message... messages) Sends full request messages with one publication guarantee and returns business response futures in input order.Methods inherited from class AbstractNamespaced
closeMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface HasLocalHandlers
hasLocalHandlers, registerHandler, registerHandler, setSelfHandlerFilterMethods inherited from interface Namespaced
forApplicationNamespace, forDefaultNamespaceMethods inherited from interface QueryGateway
close, send, send, send, send, send, sendAndWait, sendAndWait, sendAndWait, sendAndWait, sendForMessage, sendForMessages
-
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:QueryGatewaySends a request with the given publication guarantee. The future represents its business response.Guarantee.DEFAULTusesfluxzero.publishing.defaultGuarantee, with the SDK major-version request default when unconfigured.Guarantee.NONE,Guarantee.SENTandGuarantee.STOREDoverride publication for this call only; the business result is still awaited.- Specified by:
sendin interfaceQueryGateway- Type Parameters:
R- response payload type- Parameters:
payload- request payloadmetadata- request metadata; useMetadata.empty()when none is neededguarantee- 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:QueryGatewaySends a typed request with a per-call publication guarantee and returns its business response future.- Specified by:
sendin interfaceQueryGateway
-
sendAndWait
public <R> R sendAndWait(Object payload, io.fluxzero.common.api.Metadata metadata, io.fluxzero.common.Guarantee guarantee) Description copied from interface:QueryGatewaySends 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:
sendAndWaitin interfaceQueryGateway
-
sendAndWait
public <R> R sendAndWait(Request<R> payload, io.fluxzero.common.api.Metadata metadata, io.fluxzero.common.Guarantee guarantee) Description copied from interface:QueryGatewaySends a typed request with a per-call publication guarantee and waits for its business response.- Specified by:
sendAndWaitin interfaceQueryGateway
-
sendForMessages
public List<CompletableFuture<Message>> sendForMessages(io.fluxzero.common.Guarantee guarantee, Message... messages) Description copied from interface:QueryGatewaySends full request messages with one publication guarantee and returns business response futures in input order. Custom gateways retain their existing batch behavior forDEFAULT; unsupported explicit guarantees fail.- Specified by:
sendForMessagesin interfaceQueryGateway
-
createForNamespace
- Specified by:
createForNamespacein classAbstractNamespaced<QueryGateway>
-
forNamespace
Description copied from interface:NamespacedReturns the resource scoped to the specified namespace. Passingnullselects the namespace configured for this application.- Specified by:
forNamespacein interfaceNamespaced<QueryGateway>- Overrides:
forNamespacein classAbstractNamespaced<QueryGateway>- Parameters:
namespace- the namespace to which the returned resource is scoped, ornullfor the application namespace- Returns:
- the resource associated with the specified namespace
-