Package net.shibboleth.idp.admin.impl
Class OutputMetrics
- All Implemented Interfaces:
Component
,DestructableComponent
,InitializableComponent
,ProfileAction
,Aware
,MessageSource
,MessageSourceAware
,Action
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 ClassesModifier and TypeClassDescriptionprivate class
MetricFilter
that combines two other filters. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Constant representing all metrics.private String
Value for Access-Control-Allow-Origin header, if any.private DateTimeFormatter
Formatter for date/time fields.private String
Name of JSONP callback function, if any.private org.slf4j.Logger
Class logger.static final String
Flow variable indicating ID of metric or group of metrics to output.private com.codahale.metrics.MetricFilter
Pre-installed filter to apply alongside dynamically derived filter.Map of custom metric groups to filters.private String
Metric ID to operate on.private com.codahale.metrics.MetricRegistry
The metric registry.private boolean
Convert date/time fields to default time zone. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
doExecute
(ProfileRequestContext profileRequestContext) protected void
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, getBean, getBean, getMessage, getMessage, getMessage, getParameter, getParameter, 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, getHttpServletRequestSupplier, getHttpServletResponse, getHttpServletResponseSupplier, getLogPrefix, setHttpServletRequest, setHttpServletRequestSupplier, setHttpServletResponse, setHttpServletResponseSupplier
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:
-
METRIC_ID
Flow variable indicating ID of metric or group of metrics to output.- See Also:
-
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
-