Package net.shibboleth.idp.admin.impl
Class OutputMetrics
- All Implemented Interfaces:
Component
,DestructableComponent
,InitializableComponent
,ProfileAction
,Aware
,MessageSource
,MessageSourceAware
,Action
public class OutputMetrics extends AbstractProfileAction
Action that outputs one or more
Metric
objects.
On success, a 200 HTTP status is returned. On failure, a non-successful HTTP status is returned.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
OutputMetrics.ChainedMetricFilter
MetricFilter
that combines two other filters. -
Field Summary
Fields Modifier and Type Field Description static String
ALL_METRICS
Constant representing all metrics.private String
allowedOrigin
Value for Access-Control-Allow-Origin header, if any.private DateTimeFormatter
dateTimeFormatter
Formatter for date/time fields.private String
jsonpCallbackName
Name of JSONP callback function, if any.private org.slf4j.Logger
log
Class logger.static String
METRIC_ID
Flow variable indicating ID of metric or group of metrics to output.private com.codahale.metrics.MetricFilter
metricFilter
Pre-installed filter to apply alongside dynamically derived filter.private Map<String,com.codahale.metrics.MetricFilter>
metricFilterMap
Map of custom metric groups to filters.private String
metricId
Metric ID to operate on.private com.codahale.metrics.MetricRegistry
metricRegistry
The metric registry.private boolean
useDefaultTimeZone
Convert date/time fields to default time zone. -
Constructor Summary
Constructors Constructor Description OutputMetrics()
Constructor. -
Method Summary
Modifier and Type Method Description protected void
doExecute(ProfileRequestContext profileRequestContext)
protected void
doInitialize()
protected boolean
doPreExecute(ProfileRequestContext profileRequestContext)
void
setAllowedOrigin(String origin)
Set the value of the Access-Control-Allow-Origin CORS header, if any.void
setDateTimeFormat(String format)
Set the formatting string to apply when extracting date/time fields.void
setJSONPCallbackName(String callbackName)
Set a JSONP callback function to wrap the result in, if any.void
setMetricFilter(com.codahale.metrics.MetricFilter filter)
Set the external metric filter to apply.void
setMetricFilterMap(Map<String,com.codahale.metrics.MetricFilter> map)
Set the map of custom group names to metric filters.void
setMetricRegistry(com.codahale.metrics.MetricRegistry registry)
Set the registry of metrics.void
setUseDefaultTimeZone(boolean flag)
Convert date/time fields to default time zone.Methods inherited from class net.shibboleth.idp.profile.AbstractProfileAction
doExecute, execute, getMessage, getMessage, getMessage, getProfileContextLookupStrategy, getRequestContext, getResult, setMessageSource, setProfileContextLookupStrategy
Methods inherited from class org.opensaml.profile.action.AbstractConditionalProfileAction
getActivationCondition, setActivationCondition
Methods inherited from class org.opensaml.profile.action.AbstractProfileAction
doPostExecute, doPostExecute, 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
-
ALL_METRICS
Constant representing all metrics.- See Also:
- Constant Field Values
-
METRIC_ID
Flow variable indicating ID of metric or group of metrics to output.- See Also:
- Constant Field Values
-
log
@Nonnull private org.slf4j.Logger logClass logger. -
metricFilter
@Nullable private com.codahale.metrics.MetricFilter metricFilterPre-installed filter to apply alongside dynamically derived filter. -
metricRegistry
The metric registry. -
allowedOrigin
Value for Access-Control-Allow-Origin header, if any. -
jsonpCallbackName
Name of JSONP callback function, if any. -
dateTimeFormatter
Formatter for date/time fields. -
useDefaultTimeZone
private boolean useDefaultTimeZoneConvert date/time fields to default time zone. -
metricFilterMap
Map of custom metric groups to filters. -
metricId
Metric ID to operate on.
-
-
Constructor Details
-
OutputMetrics
public OutputMetrics()Constructor.
-
-
Method Details
-
setMetricFilter
public void setMetricFilter(@Nullable com.codahale.metrics.MetricFilter filter)Set the external metric filter to apply.- Parameters:
filter
- metric filter
-
setMetricRegistry
public void setMetricRegistry(@Nonnull com.codahale.metrics.MetricRegistry registry)Set the registry of metrics.- Parameters:
registry
- metric registry
-
setAllowedOrigin
Set the value of the Access-Control-Allow-Origin CORS header, if any.- Parameters:
origin
- header value
-
setJSONPCallbackName
Set a JSONP callback function to wrap the result in, if any.- Parameters:
callbackName
- callback function name.
-
setDateTimeFormat
Set the formatting string to apply when extracting date/time fields.- Parameters:
format
- formatting string
-
setUseDefaultTimeZone
public void setUseDefaultTimeZone(boolean flag)Convert date/time fields to default time zone.- Parameters:
flag
- flag to set- Since:
- 4.1.0
-
setMetricFilterMap
public void setMetricFilterMap(@Nonnull @NonnullElements Map<String,com.codahale.metrics.MetricFilter> map)Set the map of custom group names to metric filters.- Parameters:
map
- group to filter map
-
doInitialize
- Overrides:
doInitialize
in classAbstractInitializableComponent
- Throws:
ComponentInitializationException
-
doPreExecute
- Overrides:
doPreExecute
in classAbstractConditionalProfileAction
-
doExecute
- Overrides:
doExecute
in classAbstractProfileAction
-