Class MetadataResolverServiceGaugeSet
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.service.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
FieldsFields inherited from interface com.codahale.metrics.MetricFilter
ALL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprivate StringExtract the error message to report out.private List<MetadataResolver>Get all the resolvers rooted in the provider tree (including the root).private Iterable<MetadataResolver>getMetadataResolvers(MetadataResolver rootResolver) Return the resolvers to report on.valueGetter(BiConsumer<ImmutableMap.Builder<String, T>, MetadataResolver> consume) Helper Function for map construction.Methods inherited from class net.shibboleth.shared.service.ReloadableServiceGaugeSet
getLogPrefix, getMetricMap, getMetrics, getService, matches, setServiceMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.codahale.metrics.MetricFilter
matchesMethods inherited from interface com.codahale.metrics.MetricSet
getMetrics
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger.
-
-
Constructor Details
-
MetadataResolverServiceGaugeSet
public MetadataResolverServiceGaugeSet(@Nonnull @NotEmpty @ParameterName(name="metricName") String metricName) Constructor.- Parameters:
metricName- name to include in metric names produced by this set
-
-
Method Details
-
extractErrorMessage
Extract the error message to report out.- Parameters:
t- the throwable to process- Returns:
- the error message string to report out
-
valueGetter
@Nonnull private <T> Map<String,T> valueGetter(@Nonnull 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
- Overrides:
doInitializein classReloadableServiceGaugeSet<MetadataResolver>- Throws:
ComponentInitializationException
-
getAllChildren
@Nonnull @Unmodifiable @NotLive private List<MetadataResolver> getAllChildren(@Nonnull 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 @Unmodifiable @NotLive private Iterable<MetadataResolver> getMetadataResolvers(@Nonnull MetadataResolver rootResolver) Return the resolvers to report on.- Parameters:
rootResolver- root component- Returns:
- resolvers to report on
-