Package org.opensaml.profile.action.impl
Class PopulateMetricContext
java.lang.Object
net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
org.opensaml.profile.action.AbstractProfileAction
org.opensaml.profile.action.impl.PopulateMetricContext
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,ProfileAction
An action that populates a
MetricContext child of the ProfileRequestContext with
a set of rules for activating timer measurements and counters on associated objects during the execution
of a profile request.
Unlike a more typical "lookup strategy" design used in most other places, the strategy function supplied is free, and indeed expected, to directly manipulate the created child context directly rather than returning the data to use. The function may return false to indicate a lack of success, but this value is merely logged.
- Event:
EventIds.PROCEED_EVENT_ID
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classDefault function to remove the context from the tree when no metrics are installed. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.slf4j.LoggerClass logger.private Function<ProfileRequestContext,Boolean> Strategy function for establishing metric mappings to apply. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoExecute(ProfileRequestContext profileRequestContext) Performs this action.protected voidvoidsetMetricStrategy(Function<ProfileRequestContext, Boolean> strategy) Set strategy to establish the metric mappings to use.Methods inherited from class org.opensaml.profile.action.AbstractProfileAction
doPostExecute, doPostExecute, doPreExecute, execute, getHttpServletRequest, getHttpServletRequestSupplier, getHttpServletResponse, getHttpServletResponseSupplier, getLogPrefix, setHttpServletRequest, setHttpServletRequestSupplier, setHttpServletResponse, setHttpServletResponseSupplierMethods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.utilities.java.support.component.InitializableComponent
initialize, isInitialized
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
metricStrategy
Strategy function for establishing metric mappings to apply.
-
-
Constructor Details
-
PopulateMetricContext
public PopulateMetricContext()
-
-
Method Details
-
setMetricStrategy
Set strategy to establish the metric mappings to use.- Parameters:
strategy- timer mapping strategy
-
doInitialize
- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
doExecute
Performs this action. Actions must override this method to perform their work.- Overrides:
doExecutein classAbstractProfileAction- Parameters:
profileRequestContext- the current IdP profile request context
-