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 moreMetricobjects.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 classOutputMetrics.ChainedMetricFilterMetricFilterthat combines two other filters.
-
Field Summary
Fields Modifier and Type Field Description static StringALL_METRICSConstant representing all metrics.private StringallowedOriginValue for Access-Control-Allow-Origin header, if any.private DateTimeFormatterdateTimeFormatterFormatter for date/time fields.private StringjsonpCallbackNameName of JSONP callback function, if any.private org.slf4j.LoggerlogClass logger.static StringMETRIC_IDFlow variable indicating ID of metric or group of metrics to output.private com.codahale.metrics.MetricFiltermetricFilterPre-installed filter to apply alongside dynamically derived filter.private Map<String,com.codahale.metrics.MetricFilter>metricFilterMapMap of custom metric groups to filters.private StringmetricIdMetric ID to operate on.private com.codahale.metrics.MetricRegistrymetricRegistryThe metric registry.private booleanuseDefaultTimeZoneConvert date/time fields to default time zone.
-
Constructor Summary
Constructors Constructor Description OutputMetrics()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoExecute(ProfileRequestContext profileRequestContext)protected voiddoInitialize()protected booleandoPreExecute(ProfileRequestContext profileRequestContext)voidsetAllowedOrigin(String origin)Set the value of the Access-Control-Allow-Origin CORS header, if any.voidsetDateTimeFormat(String format)Set the formatting string to apply when extracting date/time fields.voidsetJSONPCallbackName(String callbackName)Set a JSONP callback function to wrap the result in, if any.voidsetMetricFilter(com.codahale.metrics.MetricFilter filter)Set the external metric filter to apply.voidsetMetricFilterMap(Map<String,com.codahale.metrics.MetricFilter> map)Set the map of custom group names to metric filters.voidsetMetricRegistry(com.codahale.metrics.MetricRegistry registry)Set the registry of metrics.voidsetUseDefaultTimeZone(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 Detail
-
ALL_METRICS
@Nonnull @NotEmpty public static final String ALL_METRICS
Constant representing all metrics.- See Also:
- Constant Field Values
-
METRIC_ID
@Nonnull @NotEmpty public static final String 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 log
Class logger.
-
metricFilter
@Nullable private com.codahale.metrics.MetricFilter metricFilter
Pre-installed filter to apply alongside dynamically derived filter.
-
metricRegistry
@NonnullAfterInit private com.codahale.metrics.MetricRegistry metricRegistry
The metric registry.
-
allowedOrigin
@Nullable private String allowedOrigin
Value for Access-Control-Allow-Origin header, if any.
-
jsonpCallbackName
@Nullable private String jsonpCallbackName
Name of JSONP callback function, if any.
-
dateTimeFormatter
@Nonnull private DateTimeFormatter dateTimeFormatter
Formatter for date/time fields.
-
useDefaultTimeZone
private boolean useDefaultTimeZone
Convert date/time fields to default time zone.
-
metricFilterMap
@Nonnull @NonnullElements private Map<String,com.codahale.metrics.MetricFilter> metricFilterMap
Map of custom metric groups to filters.
-
metricId
@Nullable private String metricId
Metric ID to operate on.
-
-
Method Detail
-
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
public void setAllowedOrigin(@Nullable String origin)Set the value of the Access-Control-Allow-Origin CORS header, if any.- Parameters:
origin- header value
-
setJSONPCallbackName
public void setJSONPCallbackName(@Nullable String callbackName)Set a JSONP callback function to wrap the result in, if any.- Parameters:
callbackName- callback function name.
-
setDateTimeFormat
public void setDateTimeFormat(@Nullable @NotEmpty String format)
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
protected void doInitialize() throws ComponentInitializationException- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
doPreExecute
protected boolean doPreExecute(ProfileRequestContext profileRequestContext)
- Overrides:
doPreExecutein classAbstractConditionalProfileAction
-
doExecute
protected void doExecute(ProfileRequestContext profileRequestContext)
- Overrides:
doExecutein classAbstractProfileAction
-
-