Class MetadataResolverServiceGaugeSet
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- net.shibboleth.idp.metrics.ReloadableServiceGaugeSet<MetadataResolver>
-
- net.shibboleth.idp.saml.metadata.impl.MetadataResolverServiceGaugeSet
-
- All Implemented Interfaces:
com.codahale.metrics.Metric,com.codahale.metrics.MetricFilter,com.codahale.metrics.MetricSet,Component,DestructableComponent,InitializableComponent
public class MetadataResolverServiceGaugeSet extends ReloadableServiceGaugeSet<MetadataResolver> implements com.codahale.metrics.MetricSet, com.codahale.metrics.MetricFilter
Additional gauges for metadata resolvers.
-
-
Field Summary
Fields Modifier and Type Field Description private org.slf4j.LoggerlogClass logger.-
Fields inherited from class net.shibboleth.idp.metrics.ReloadableServiceGaugeSet
DEFAULT_METRIC_NAME
-
-
Constructor Summary
Constructors Constructor Description MetadataResolverServiceGaugeSet(String metricName)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoInitialize()private StringextractErrorMessage(Throwable t)Extract the error message to report out.private List<MetadataResolver>getAllChildren(ChainingMetadataResolver parent)Get all the resolvers rooted in the provider tree (including the root).private Iterable<MetadataResolver>getMetadataResolvers(MetadataResolver rootResolver)Return the resolvers to report on.private <T> Map<String,T>valueGetter(BiConsumer<ImmutableMap.Builder<String,T>,MetadataResolver> consume)Helper Function for map construction.-
Methods inherited from class net.shibboleth.idp.metrics.ReloadableServiceGaugeSet
getLogPrefix, getMetricMap, getMetrics, getService, matches, setService
-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, initialize, isDestroyed, isInitialized
-
-
-
-
Constructor Detail
-
MetadataResolverServiceGaugeSet
public MetadataResolverServiceGaugeSet(@Nonnull @NotEmpty @ParameterName(name="metricName") String metricName)
Constructor.- Parameters:
metricName- name to include in metric names produced by this set
-
-
Method Detail
-
extractErrorMessage
private String extractErrorMessage(Throwable t)
Extract the error message to report out.- Parameters:
t- the throwable to process- Returns:
- the error message string to report out
-
valueGetter
private <T> Map<String,T> valueGetter(BiConsumer<ImmutableMap.Builder<String,T>,MetadataResolver> consume)
Helper Function for map construction.This does all the service handling and just calls the specific
BiConsumerto add each appropriate the value to the map.- Type Parameters:
T- the type of value being reported out- Parameters:
consume- the thing which does checking and adding the building- Returns:
- an appropriate map
-
doInitialize
protected void doInitialize() throws ComponentInitializationException- Overrides:
doInitializein classReloadableServiceGaugeSet<MetadataResolver>- Throws:
ComponentInitializationException
-
getAllChildren
private List<MetadataResolver> getAllChildren(ChainingMetadataResolver parent)
Get all the resolvers rooted in the provider tree (including the root).- Parameters:
parent- - root of the chaining resolver tree.- Returns:
- - the list.
-
getMetadataResolvers
@Nonnull @NonnullElements private Iterable<MetadataResolver> getMetadataResolvers(@Nonnull MetadataResolver rootResolver)
Return the resolvers to report on.- Parameters:
rootResolver- root component- Returns:
- resolvers to report on
-
-