public abstract class AbstractMetadataResolver extends net.shibboleth.utilities.java.support.component.AbstractIdentifiableInitializableComponent implements MetadataResolver
| Modifier and Type | Class and Description |
|---|---|
protected class |
AbstractMetadataResolver.EntityBackingStore
The collection of data which provides the backing store for the processed metadata.
|
| Modifier and Type | Field and Description |
|---|---|
private AbstractMetadataResolver.EntityBackingStore |
entityBackingStore
Backing store for runtime EntityDescriptor data.
|
private boolean |
failFastInitialization
Whether problems during initialization should cause the provider to fail or go on without metadata.
|
private org.slf4j.Logger |
log
Class logger.
|
private MetadataFilter |
mdFilter
Filter applied to all metadata.
|
private net.shibboleth.utilities.java.support.xml.ParserPool |
parser
Pool of parsers used to process XML.
|
private boolean |
requireValidMetadata
Whether metadata is required to be valid.
|
private UnmarshallerFactory |
unmarshallerFactory
Unmarshaller factory used to get an unmarshaller for the metadata DOM.
|
| Constructor and Description |
|---|
AbstractMetadataResolver()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected AbstractMetadataResolver.EntityBackingStore |
createNewBackingStore()
Create a new backing store instance for EntityDescriptor data.
|
protected void |
doDestroy() |
protected void |
doInitialize() |
protected XMLObject |
filterMetadata(XMLObject metadata)
Filters the given metadata.
|
protected AbstractMetadataResolver.EntityBackingStore |
getBackingStore()
Get the EntityDescriptor backing store currently in use by the metadata resolver.
|
MetadataFilter |
getMetadataFilter()
Gets the metadata filter applied to the metadata.
|
net.shibboleth.utilities.java.support.xml.ParserPool |
getParserPool()
Gets the pool of parsers to use to parse XML.
|
protected UnmarshallerFactory |
getUnmarshallerFactory()
Get the XMLObject unmarshaller factory to use.
|
protected void |
indexEntityDescriptor(EntityDescriptor entityDescriptor,
AbstractMetadataResolver.EntityBackingStore backingStore)
Index the specified entity descriptor, updating the specified entity backing store instance as necessary.
|
protected void |
initMetadataResolver()
Subclasses should override this method to perform any initialization logic necessary.
|
boolean |
isFailFastInitialization()
Gets whether problems during initialization should cause the provider to fail or go on without metadata.
|
boolean |
isRequireValidMetadata()
Gets whether the metadata returned by queries must be valid.
|
protected boolean |
isValid(XMLObject descriptor)
Returns whether the given descriptor is valid.
|
protected java.util.List<EntityDescriptor> |
lookupEntityID(java.lang.String entityID)
Get list of descriptors matching an entityID.
|
protected java.util.List<EntityDescriptor> |
lookupIndexedEntityID(java.lang.String entityID)
Lookup the specified entityID from the index.
|
protected void |
preProcessEntitiesDescriptor(EntitiesDescriptor entitiesDescriptor,
AbstractMetadataResolver.EntityBackingStore backingStore)
Pre-process the specified entities descriptor, updating the specified entity backing store instance as necessary.
|
protected void |
preProcessEntityDescriptor(EntityDescriptor entityDescriptor,
AbstractMetadataResolver.EntityBackingStore backingStore)
Pre-process the specified entity descriptor, updating the specified entity backing store instance as necessary.
|
protected void |
releaseMetadataDOM(XMLObject metadata)
Releases the DOM representation from the metadata object.
|
protected void |
removeByEntityID(java.lang.String entityID,
AbstractMetadataResolver.EntityBackingStore backingStore)
Remove from the backing store all metadata for the entity with the given entity ID.
|
EntityDescriptor |
resolveSingle(net.shibboleth.utilities.java.support.resolver.CriteriaSet criteria) |
protected void |
setBackingStore(AbstractMetadataResolver.EntityBackingStore newBackingStore)
Set the EntityDescriptor backing store currently in use by the metadata resolver.
|
void |
setFailFastInitialization(boolean failFast)
Sets whether problems during initialization should cause the provider to fail or go on without metadata.
|
void |
setMetadataFilter(MetadataFilter newFilter)
Sets the metadata filter applied to the metadata.
|
void |
setParserPool(net.shibboleth.utilities.java.support.xml.ParserPool pool)
Sets the pool of parsers to use to parse XML.
|
void |
setRequireValidMetadata(boolean require)
Sets whether the metadata returned by queries must be valid.
|
protected XMLObject |
unmarshallMetadata(java.io.InputStream metadataInput)
Unmarshalls the metadata from the given stream.
|
setIdgetIddestroy, initialize, isDestroyed, isInitializedprivate final org.slf4j.Logger log
private UnmarshallerFactory unmarshallerFactory
private boolean requireValidMetadata
private MetadataFilter mdFilter
private boolean failFastInitialization
private AbstractMetadataResolver.EntityBackingStore entityBackingStore
private net.shibboleth.utilities.java.support.xml.ParserPool parser
public boolean isRequireValidMetadata()
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.
isRequireValidMetadata in interface MetadataResolverpublic void setRequireValidMetadata(boolean require)
setRequireValidMetadata in interface MetadataResolverrequire - whether the metadata returned by queries must be valid@Nullable public MetadataFilter getMetadataFilter()
getMetadataFilter in interface MetadataResolverpublic void setMetadataFilter(@Nullable
MetadataFilter newFilter)
setMetadataFilter in interface MetadataResolvernewFilter - the metadata filter applied to the metadatapublic boolean isFailFastInitialization()
public void setFailFastInitialization(boolean failFast)
failFast - whether problems during initialization should cause the provider to fail@Nonnull public net.shibboleth.utilities.java.support.xml.ParserPool getParserPool()
public void setParserPool(@Nonnull
net.shibboleth.utilities.java.support.xml.ParserPool pool)
pool - pool of parsers to use to parse XML@Nullable public EntityDescriptor resolveSingle(net.shibboleth.utilities.java.support.resolver.CriteriaSet criteria) throws net.shibboleth.utilities.java.support.resolver.ResolverException
resolveSingle in interface net.shibboleth.utilities.java.support.resolver.Resolver<EntityDescriptor,net.shibboleth.utilities.java.support.resolver.CriteriaSet>net.shibboleth.utilities.java.support.resolver.ResolverExceptionprotected UnmarshallerFactory getUnmarshallerFactory()
protected final void doInitialize()
throws net.shibboleth.utilities.java.support.component.ComponentInitializationException
doInitialize in class net.shibboleth.utilities.java.support.component.AbstractIdentifiedInitializableComponentnet.shibboleth.utilities.java.support.component.ComponentInitializationExceptionprotected void doDestroy()
doDestroy in class net.shibboleth.utilities.java.support.component.AbstractInitializableComponentprotected void initMetadataResolver()
throws net.shibboleth.utilities.java.support.component.ComponentInitializationException
net.shibboleth.utilities.java.support.component.ComponentInitializationException - thrown if there is a problem initializing the provider@Nonnull protected XMLObject unmarshallMetadata(@Nonnull java.io.InputStream metadataInput) throws UnmarshallingException
metadataInput - the input reader to the metadata.UnmarshallingException - thrown if the metadata can no be unmarshalled@Nullable protected XMLObject filterMetadata(@Nullable XMLObject metadata) throws FilterException
metadata - the metadata to be filteredFilterException - thrown if there is an error filtering the metadataprotected void releaseMetadataDOM(@Nullable
XMLObject metadata)
metadata - the metadata objectprotected boolean isValid(@Nullable
XMLObject descriptor)
descriptor - the descriptor to check@Nonnull @NonnullElements protected java.util.List<EntityDescriptor> lookupEntityID(@Nonnull @NotEmpty java.lang.String entityID) throws net.shibboleth.utilities.java.support.resolver.ResolverException
entityID - entityID to lookupnet.shibboleth.utilities.java.support.resolver.ResolverException - if an error occurs@Nonnull @NonnullElements protected java.util.List<EntityDescriptor> lookupIndexedEntityID(@Nonnull @NotEmpty java.lang.String entityID)
entityID - the entityID to lookup@Nonnull protected AbstractMetadataResolver.EntityBackingStore createNewBackingStore()
setBackingStore(EntityBackingStore) to make it the effective
instance in use.@Nonnull protected AbstractMetadataResolver.EntityBackingStore getBackingStore()
protected void setBackingStore(@Nonnull
AbstractMetadataResolver.EntityBackingStore newBackingStore)
newBackingStore - the new entity backing storeprotected void preProcessEntityDescriptor(@Nonnull
EntityDescriptor entityDescriptor,
@Nonnull
AbstractMetadataResolver.EntityBackingStore backingStore)
entityDescriptor - the target entity descriptor to processbackingStore - the backing store instance to updateprotected void removeByEntityID(@Nonnull
java.lang.String entityID,
@Nonnull
AbstractMetadataResolver.EntityBackingStore backingStore)
entityID - the entity ID of the metadata to removebackingStore - the backing store instance to updateprotected void indexEntityDescriptor(@Nonnull
EntityDescriptor entityDescriptor,
@Nonnull
AbstractMetadataResolver.EntityBackingStore backingStore)
entityDescriptor - the target entity descriptor to processbackingStore - the backing store instance to updateprotected void preProcessEntitiesDescriptor(@Nonnull
EntitiesDescriptor entitiesDescriptor,
AbstractMetadataResolver.EntityBackingStore backingStore)
entitiesDescriptor - the target entities descriptor to processbackingStore - the backing store instance to update