Package org.opensaml.saml.metadata.resolver.impl

# Class CompositeMetadataResolver

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
org.opensaml.saml.metadata.resolver.impl.CompositeMetadataResolver

All Implemented Interfaces:
  `Component`, `DestructableComponent`, `IdentifiableComponent`, `IdentifiedComponent`, `InitializableComponent`, `Resolver<EntityDescriptor,CriteriaSet>`, `ClearableMetadataResolver`, `MetadataResolver`, `RefreshableMetadataResolver`

public class CompositeMetadataResolver extends AbstractIdentifiableInitializableComponent implements MetadataResolver, RefreshableMetadataResolver, ClearableMetadataResolver
A `MetadataResolver` implementation that answers requests by composing the answers of child `MetadataResolver`s.

Note: This appears to be unused, and contained a number of bugs that may or may not have been fully corrected.

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`private static class`
`CompositeMetadataResolver.CompositeMetadataResolverIterable`
`Iterable` implementation that provides an `Iterator` that lazily iterates over each composed resolver.

## Field Summary

Fields
Modifier and Type
Field
Description
`private final org.slf4j.Logger`
`log`
Class logger.
`private List<MetadataResolver>`
`resolvers`
Resolvers composed by this resolver.
`private String`
`resolverType`
Resolver type.

## Constructor Summary

Constructors
Constructor
Description
`CompositeMetadataResolver()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`void`
`clear()`
Attempt to clear all data from the internal cache of the resolver.
`void`
`clear(String entityID)`
Attempt to clear data from the internal cache of the resolver for the specified entityID.
`Throwable`
`getLastFailureCause()`
Gets the reason the last refresh failed.
`Instant`
`getLastRefresh()`
Gets the time the last refresh cycle occurred.
`Instant`
`getLastSuccessfulRefresh()`
Gets the time the last successful refresh cycle occurred.
`Instant`
`getLastUpdate()`
Get the time that the currently available metadata was last updated.
`MetadataFilter`
`getMetadataFilter()`
Gets the metadata filter applied to the metadata.
`List<MetadataResolver>`
`getResolvers()`
Gets an immutable the list of currently registered resolvers.
`String`
`getType()`
Gets the type of resolver for reporting or logging purposes.
`boolean`
`isRequireValidMetadata()`
Gets whether the metadata returned by queries must be valid.
`void`
`refresh()`
Refresh the data exposed by the resolver.
`Iterable<EntityDescriptor>`
`resolve(CriteriaSet criteria)`
`EntityDescriptor`
`resolveSingle(CriteriaSet criteria)`
`void`
`setMetadataFilter(MetadataFilter newFilter)`
Sets the metadata filter applied to the metadata.
`void`
`setRequireValidMetadata(boolean requireValidMetadata)`
Sets whether the metadata returned by queries must be valid.
`void`
`setResolvers(List<MetadataResolver> newResolvers)`
Sets the current set of metadata resolvers.
`void`
`setType(String type)`
Sets the type of this resolver for reporting/logging.
`Boolean`
`wasLastRefreshSuccess()`
Gets whether the last refresh cycle was successful.

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

`setId`

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

`doInitialize, ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException`

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

`checkComponentActive, checkSetterPreconditions, 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.shared.component.IdentifiedComponent

`getId`

## Field Details

### log

@Nonnull private final org.slf4j.Logger log
Class logger.

### resolverType

@Nullable @NotEmpty private String resolverType
Resolver type.

### resolvers

@Nonnull private List<MetadataResolver> resolvers
Resolvers composed by this resolver.

## Constructor Details

### CompositeMetadataResolver

public CompositeMetadataResolver()
Constructor.

## Method Details

### getResolvers

@Nonnull @Unmodifiable @NotLive public List<MetadataResolver> getResolvers()
Gets an immutable the list of currently registered resolvers.

Returns:
  list of currently registered resolvers

### setResolvers

public void setResolvers(@Nullable List<MetadataResolver> newResolvers) throws ResolverException
Sets the current set of metadata resolvers.

Parameters:
  `newResolvers` - the metadata resolvers to use
Throws:
  `ResolverException` - thrown if there is a problem adding the metadata provider

### getType

@Nullable @NotEmpty public String getType()
Gets the type of resolver for reporting or logging purposes.

Specified by:
  `getType` in interface `MetadataResolver`
Returns:
  resolver type

### setType

public void setType(@Nullable @NotEmpty String type)
Sets the type of this resolver for reporting/logging.

Parameters:
  `type` - type to set
Since:
  5.0.0

### isRequireValidMetadata

public boolean isRequireValidMetadata()
Gets whether the metadata returned by queries must be valid.

At a minimum, metadata is valid only if the date expressed in the `validUntil` attribute of the element and all its ancestral elements has not passed. Specific implementations may add additional constraints.

Specified by:
  `isRequireValidMetadata` in interface `MetadataResolver`
Returns:
  whether the metadata returned by queries must be valid

### setRequireValidMetadata

public void setRequireValidMetadata(boolean requireValidMetadata)
Sets whether the metadata returned by queries must be valid.

Specified by:
  `setRequireValidMetadata` in interface `MetadataResolver`
Parameters:
  `requireValidMetadata` - whether the metadata returned by queries must be valid

### getMetadataFilter

@Nullable public MetadataFilter getMetadataFilter()
Gets the metadata filter applied to the metadata.

Specified by:
  `getMetadataFilter` in interface `MetadataResolver`
Returns:
  the metadata filter applied to the metadata

### setMetadataFilter

public void setMetadataFilter(@Nullable MetadataFilter newFilter)
Sets the metadata filter applied to the metadata.

Specified by:
  `setMetadataFilter` in interface `MetadataResolver`
Parameters:
  `newFilter` - the metadata filter applied to the metadata

### resolve

@Nonnull public Iterable<EntityDescriptor> resolve(@Nullable CriteriaSet criteria) throws ResolverException

Specified by:
  `resolve` in interface `Resolver<EntityDescriptor,CriteriaSet>`
Throws:
  `ResolverException`

### resolveSingle

public EntityDescriptor resolveSingle(@Nullable CriteriaSet criteria) throws ResolverException

Specified by:
  `resolveSingle` in interface `Resolver<EntityDescriptor,CriteriaSet>`
Throws:
  `ResolverException`

### clear

public void clear() throws ResolverException
Attempt to clear all data from the internal cache of the resolver.

Specified by:
  `clear` in interface `ClearableMetadataResolver`
Throws:
  `ResolverException` - if the clear operation was unsuccessful

### clear

public void clear(@Nonnull String entityID) throws ResolverException
Attempt to clear data from the internal cache of the resolver for the specified entityID.

Specified by:
  `clear` in interface `ClearableMetadataResolver`
Parameters:
  `entityID` - the target entityID
Throws:
  `ResolverException` - if the clear operation was unsuccessful

### refresh

public void refresh() throws ResolverException
Refresh the data exposed by the resolver.

An implementation of this method should typically be either `synchronized` or make use other locking mechanisms to protect against concurrent access.

Specified by:
  `refresh` in interface `RefreshableMetadataResolver`
Throws:
  `ResolverException` - if the refresh operation was unsuccessful

### getLastUpdate

@Nullable public Instant getLastUpdate()
Get the time that the currently available metadata was last updated. Note, this may be different than the time retrieved by `RefreshableMetadataResolver.getLastRefresh()` is the metadata was known not to have changed during the last refresh cycle.

Specified by:
  `getLastUpdate` in interface `RefreshableMetadataResolver`
Returns:
  time when the currently metadata was last updated, null if metadata has never successfully been read in

### getLastRefresh

@Nullable public Instant getLastRefresh()
Gets the time the last refresh cycle occurred.

Specified by:
  `getLastRefresh` in interface `RefreshableMetadataResolver`
Returns:
  time the last refresh cycle occurred

### getLastSuccessfulRefresh

@Nullable public Instant getLastSuccessfulRefresh()
Gets the time the last successful refresh cycle occurred.

Specified by:
  `getLastSuccessfulRefresh` in interface `RefreshableMetadataResolver`
Returns:
  time the last successful refresh cycle occurred

### wasLastRefreshSuccess

@Nullable public Boolean wasLastRefreshSuccess()
Gets whether the last refresh cycle was successful.

Specified by:
  `wasLastRefreshSuccess` in interface `RefreshableMetadataResolver`
Returns:
  true if last refresh cycle was successful, false if not

### getLastFailureCause

@Nullable public Throwable getLastFailureCause()
Gets the reason the last refresh failed.

Specified by:
  `getLastFailureCause` in interface `RefreshableMetadataResolver`
Returns:
  reason the last refresh failed or null if the last refresh was successful