Package net.shibboleth.idp.admin.impl

# Class OutputMetrics

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
org.opensaml.profile.action.AbstractProfileAction
org.opensaml.profile.action.AbstractConditionalProfileAction
net.shibboleth.idp.profile.AbstractProfileAction
net.shibboleth.idp.admin.impl.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.

Event:
  `EventIds.PROCEED_EVENT_ID`, `EventIds.INVALID_PROFILE_CTX`, `EventIds.IO_ERROR`

## 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 final 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 final 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, 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, ensureHttpServletRequest, ensureHttpServletResponse, execute, getHttpServletRequest, getHttpServletRequestSupplier, getHttpServletResponse, getHttpServletResponseSupplier, getLogPrefix, isPreExecuteCalled, setHttpServletRequestSupplier, setHttpServletResponseSupplier`

### Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent

`checkComponentActive, checkSetterPreconditions, destroy, doDestroy, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, 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.shared.component.InitializableComponent

`initialize, isInitialized`

## Field Details

### 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

@NonnullAfterInit private DateTimeFormatter dateTimeFormatter
Formatter for date/time fields.

### useDefaultTimeZone

private boolean useDefaultTimeZone
Convert date/time fields to default time zone.

### metricFilterMap

@Nonnull private Map<String,com.codahale.metrics.MetricFilter> metricFilterMap
Map of custom metric groups to filters.

### metricId

@NonnullBeforeExec private String 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

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 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:
  `doInitialize` in class `AbstractInitializableComponent`
Throws:
  `ComponentInitializationException`

### doPreExecute

protected boolean doPreExecute(@Nonnull ProfileRequestContext profileRequestContext)

Overrides:
  `doPreExecute` in class `AbstractConditionalProfileAction`

### doExecute

protected void doExecute(@Nonnull ProfileRequestContext profileRequestContext)

Overrides:
  `doExecute` in class `AbstractProfileAction`