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 class
Default function to remove the context from the tree when no metrics are installed. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.slf4j.Logger
Class logger.private Function<ProfileRequestContext,
Boolean> Strategy function for establishing metric mappings to apply. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
doExecute
(ProfileRequestContext profileRequestContext) Performs this action.protected void
void
setMetricStrategy
(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, getHttpServletResponse, getLogPrefix, setHttpServletRequest, setHttpServletResponse
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, initialize, isDestroyed, isInitialized
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
doInitialize
in classAbstractInitializableComponent
- Throws:
ComponentInitializationException
-
doExecute
Performs this action. Actions must override this method to perform their work.- Overrides:
doExecute
in classAbstractProfileAction
- Parameters:
profileRequestContext
- the current IdP profile request context
-