Package org.forgerock.monitoring
Class DropwizardMetricsCollectionResourceProvider
- java.lang.Object
-
- org.forgerock.monitoring.DropwizardMetricsCollectionResourceProvider
-
- All Implemented Interfaces:
CollectionResourceProvider
public class DropwizardMetricsCollectionResourceProvider extends Object implements CollectionResourceProvider
A CREST CollectionResourceProvider that adds queryFilter, field filtering, sorting abilities, and paging to the dropwizard json metrics data. Note that only offset-based paging is supported.
-
-
Constructor Summary
Constructors Constructor Description DropwizardMetricsCollectionResourceProvider(Supplier<MeterRegistry> meterRegistrySupplier)
Constructs the resource provider for the passed in Dropwizard metric set supplier.DropwizardMetricsCollectionResourceProvider(MeterRegistry meterRegistry)
Constructs the resource provider for the passed in Dropwizard metric set.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Promise<QueryResponse,ResourceException>
queryCollection(org.forgerock.services.context.Context context, QueryRequest request, QueryResourceHandler handler)
Searches
the collection for all resources which match the query request criteria.Promise<ResourceResponse,ResourceException>
readInstance(org.forgerock.services.context.Context context, String resourceId, ReadRequest request)
Reads
an existing resource within the collection.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.forgerock.json.resource.CollectionResourceProvider
actionCollection, actionInstance, createInstance, deleteInstance, patchInstance, updateInstance
-
-
-
-
Constructor Detail
-
DropwizardMetricsCollectionResourceProvider
public DropwizardMetricsCollectionResourceProvider(MeterRegistry meterRegistry)
Constructs the resource provider for the passed in Dropwizard metric set.- Parameters:
meterRegistry
- The DropwizardMetricSet
from which to provide metrics.
-
DropwizardMetricsCollectionResourceProvider
public DropwizardMetricsCollectionResourceProvider(Supplier<MeterRegistry> meterRegistrySupplier)
Constructs the resource provider for the passed in Dropwizard metric set supplier.- Parameters:
meterRegistrySupplier
-Supplier
of the DropwizardMetricSet
from which to provide metrics.
-
-
Method Detail
-
queryCollection
public Promise<QueryResponse,ResourceException> queryCollection(org.forgerock.services.context.Context context, QueryRequest request, QueryResourceHandler handler)
Description copied from interface:CollectionResourceProvider
Searches
the collection for all resources which match the query request criteria.Implementations must invoke
QueryResourceHandler.handleResource(ResourceResponse)
for each resource which matches the query criteria. Once all matching resources have been returned implementations are required to return either aQueryResponse
if the query has completed successfully, orResourceException
if the query did not complete successfully (even if some matching resources were returned).- Specified by:
queryCollection
in interfaceCollectionResourceProvider
- Parameters:
context
- The request server context.request
- The query request.handler
- The query resource handler to be notified for each matching resource.- Returns:
- A
Promise
containing the result of the operation. - See Also:
RequestHandler.handleQuery(Context, QueryRequest, QueryResourceHandler)
-
readInstance
public Promise<ResourceResponse,ResourceException> readInstance(org.forgerock.services.context.Context context, String resourceId, ReadRequest request)
Description copied from interface:CollectionResourceProvider
Reads
an existing resource within the collection.- Specified by:
readInstance
in interfaceCollectionResourceProvider
- Parameters:
context
- The request server context.resourceId
- The ID of the targeted resource within the collection.request
- The read request.- Returns:
- A
Promise
containing the result of the operation. - See Also:
RequestHandler.handleRead(Context, ReadRequest)
-
-