Class DefaultMetricsGateway
java.lang.Object
io.fluxzero.sdk.publishing.DefaultMetricsGateway
- All Implemented Interfaces:
Namespaced<MetricsGateway>, MetricsGateway, HasLocalHandlers
Default implementation of the
MetricsGateway interface.
This class delegates all functionality to an underlying GenericGateway instance, enabling the use of metrics
gateway methods while leveraging the generic gateway's capabilities.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the resource scoped to the default namespace.forNamespace(String namespace) Creates and returns the resource scoped to the specified namespace.Publishes a metrics message with the specified metadata and delivery guarantee.Methods 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 MetricsGateway
publish, publish
-
Constructor Details
-
DefaultMetricsGateway
public DefaultMetricsGateway()
-
-
Method Details
-
publish
Description copied from interface:MetricsGatewayPublishes a metrics message with the specified metadata and delivery guarantee.This method may complete asynchronously.
- Specified by:
publishin interfaceMetricsGateway- Parameters:
payload- the metrics payloadmetadata- metadata to attach to the messageguarantee- delivery guarantee (e.g.,Guarantee.SENTorGuarantee.STORED)- Returns:
- a
CompletableFuturethat completes when the message is published (or not, depending on the guarantee)
-
forDefaultNamespace
Description copied from interface:NamespacedReturns the resource scoped to the default namespace.- Specified by:
forDefaultNamespacein interfaceNamespaced<MetricsGateway>- Returns:
- the resource which is associated with the default namespace
-
forNamespace
Description copied from interface:NamespacedCreates and returns the resource scoped to the specified namespace.- Specified by:
forNamespacein interfaceNamespaced<MetricsGateway>- Parameters:
namespace- the namespace to which the returned resource is scoped- Returns:
- the resource associated with the specified namespace
-