Class DefaultMetricsGateway
java.lang.Object
io.fluxzero.sdk.common.AbstractNamespaced<MetricsGateway>
io.fluxzero.sdk.publishing.DefaultMetricsGateway
- All Implemented Interfaces:
Namespaced<MetricsGateway>, MetricsGateway, HasLocalHandlers
public class DefaultMetricsGateway
extends AbstractNamespaced<MetricsGateway>
implements MetricsGateway
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 TypeMethodDescriptionprotected MetricsGatewaycreateForNamespace(String namespace) forNamespace(String namespace) Returns the resource scoped to the specified namespace.Publishes a metrics message with the specified metadata and delivery guarantee.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 MetricsGateway
publish, publishMethods inherited from interface Namespaced
forApplicationNamespace, forDefaultNamespace
-
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)
-
createForNamespace
- Specified by:
createForNamespacein classAbstractNamespaced<MetricsGateway>
-
forNamespace
Description copied from interface:NamespacedReturns the resource scoped to the specified namespace. Passingnullselects the namespace configured for this application.- Specified by:
forNamespacein interfaceNamespaced<MetricsGateway>- Overrides:
forNamespacein classAbstractNamespaced<MetricsGateway>- Parameters:
namespace- the namespace to which the returned resource is scoped, ornullfor the application namespace- Returns:
- the resource associated with the specified namespace
-