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.
|
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 List<EntityDescriptor> |
lookupEntityID(String entityID)
Get list of descriptors matching an entityID.
|
protected List<EntityDescriptor> |
lookupIndexedEntityID(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(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(InputStream metadataInput)
Unmarshalls the metadata from the given stream.
|
setId
getId
destroy, initialize, isDestroyed, isInitialized
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 MetadataResolver
public void setRequireValidMetadata(boolean require)
setRequireValidMetadata
in interface MetadataResolver
require
- whether the metadata returned by queries must be valid@Nullable public MetadataFilter getMetadataFilter()
getMetadataFilter
in interface MetadataResolver
public void setMetadataFilter(@Nullable MetadataFilter newFilter)
setMetadataFilter
in interface MetadataResolver
newFilter
- 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.ResolverException
protected UnmarshallerFactory getUnmarshallerFactory()
protected final void doInitialize() throws net.shibboleth.utilities.java.support.component.ComponentInitializationException
doInitialize
in class net.shibboleth.utilities.java.support.component.AbstractIdentifiedInitializableComponent
net.shibboleth.utilities.java.support.component.ComponentInitializationException
protected void doDestroy()
doDestroy
in class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
protected 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 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 List<EntityDescriptor> lookupEntityID(@Nonnull @NotEmpty 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 List<EntityDescriptor> lookupIndexedEntityID(@Nonnull @NotEmpty 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 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 updateCopyright © 2017. All rights reserved.