Class DefaultEventGateway

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

public class DefaultEventGateway extends AbstractNamespaced<EventGateway> implements EventGateway
Default implementation of the EventGateway interface.

This class delegates all functionality to an underlying GenericGateway instance, enabling the use of event gateway methods while leveraging the generic gateway's capabilities.

See Also:
  • Constructor Details

    • DefaultEventGateway

      public DefaultEventGateway()
  • Method Details

    • publish

      public CompletableFuture<Void> publish(Message message, Guarantee guarantee)
      Description copied from interface: EventGateway
      Publishes the given Message to Fluxzero and/or local handlers. Returns a future that completes when the message has been fully processed or stored according to the given Guarantee.
      Specified by:
      publish in interface EventGateway
      Parameters:
      message - the message to publish
      guarantee - the level of delivery guarantee to apply (e.g., store-before-acknowledge)
      Returns:
      a future that completes when the message has been handled
    • publish

      public void publish(Object... messages)
      Description copied from interface: EventGateway
      Publishes one or more event messages. Each message may be a raw payload or a Message instance. Events are published with no delivery guarantee.

      This method does not block for completion or acknowledgments.

      Specified by:
      publish in interface EventGateway
      Parameters:
      messages - the events to publish
    • publish

      public CompletableFuture<Void> publish(Guarantee guarantee, Object... messages)
      Description copied from interface: EventGateway
      Publishes one or more event messages with a specific delivery guarantee. Each message may be a raw payload or a Message instance.

      Returns a future that completes when the messages have been handled or stored according to the specified Guarantee.

      Specified by:
      publish in interface EventGateway
      Parameters:
      guarantee - the delivery guarantee (e.g., Guarantee.STORED)
      messages - the events to publish
      Returns:
      a future that completes upon publishing
    • createForNamespace

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

      public DefaultEventGateway 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<EventGateway>
      Overrides:
      forNamespace in class AbstractNamespaced<EventGateway>
      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