|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opensaml.saml2.metadata.provider.BaseMetadataProvider
org.opensaml.saml2.metadata.provider.AbstractMetadataProvider
org.opensaml.saml2.metadata.provider.AbstractObservableMetadataProvider
org.opensaml.saml2.metadata.provider.AbstractReloadingMetadataProvider
org.opensaml.saml2.metadata.provider.FilesystemMetadataProvider
public class FilesystemMetadataProvider
A metadata provider that pulls metadata from a file on the local filesystem.
This metadata provider periodically checks to see if the read metadata file has changed. The delay between each
refresh interval is calculated as follows. If no validUntil or cacheDuration is present then the
AbstractReloadingMetadataProvider.getMaxRefreshDelay()
value is used. Otherwise, the earliest refresh interval of the metadata file is checked
by looking for the earliest of all the validUntil attributes and cacheDuration attributes. If that refresh interval
is larger than the max refresh delay then AbstractReloadingMetadataProvider.getMaxRefreshDelay()
is used. If that number is smaller than the
min refresh delay then AbstractReloadingMetadataProvider.getMinRefreshDelay()
is used. Otherwise the calculated refresh delay multiplied by
AbstractReloadingMetadataProvider.getRefreshDelayFactor()
is used. By using this factor, the provider will attempt to be refresh before the
cache actually expires, allowing a some room for error and recovery. Assuming the factor is not exceedingly close to
1.0 and a min refresh delay that is not overly large, this refresh will likely occur a few times before the cache
expires.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.opensaml.saml2.metadata.provider.ObservableMetadataProvider |
---|
ObservableMetadataProvider.Observer |
Field Summary |
---|
Fields inherited from class org.opensaml.saml2.metadata.provider.BaseMetadataProvider |
---|
unmarshallerFactory |
Constructor Summary | |
---|---|
FilesystemMetadataProvider(File metadata)
Constructor. |
|
FilesystemMetadataProvider(Timer backgroundTaskTimer,
File metadata)
Constructor. |
Method Summary | |
---|---|
protected byte[] |
fetchMetadata()
Fetches metadata from a source. |
protected String |
getMetadataIdentifier()
Gets an identifier which may be used to distinguish this metadata in logging statements. |
boolean |
maintainExpiredMetadata()
Deprecated. use BaseMetadataProvider.requireValidMetadata() instead |
void |
setMaintainExpiredMetadata(boolean maintain)
Deprecated. use BaseMetadataProvider.setRequireValidMetadata(boolean) instead |
protected void |
setMetadataFile(File file)
Sets the file from which metadata is read. |
Methods inherited from class org.opensaml.saml2.metadata.provider.AbstractReloadingMetadataProvider |
---|
computeNextRefreshDelay, doGetMetadata, doInitialization, getExpirationTime, getLastRefresh, getLastUpdate, getMaxRefreshDelay, getMinRefreshDelay, getNextRefresh, getRefreshDelayFactor, inputstreamToByteArray, postProcessMetadata, processCachedMetadata, processNewMetadata, processNonExpiredMetadata, processPreExpiredMetadata, refresh, setMaxRefreshDelay, setMinRefreshDelay, setRefreshDelayFactor, unmarshallMetadata |
Methods inherited from class org.opensaml.saml2.metadata.provider.AbstractObservableMetadataProvider |
---|
emitChangeEvent, getObservers |
Methods inherited from class org.opensaml.saml2.metadata.provider.AbstractMetadataProvider |
---|
clearDescriptorIndex, doGetEntitiesDescriptor, doGetEntityDescriptor, doGetRole, doGetRole, filterMetadata, getEntitiesDescriptor, getEntitiesDescriptorByName, getEntityDescriptor, getEntityDescriptorById, getEntityDescriptorById, getMetadata, getParserPool, getRole, getRole, initialize, isFailFastInitialization, isInitialized, isValid, releaseMetadataDOM, setFailFastInitialization, setInitialized, setParserPool, unmarshallMetadata |
Methods inherited from class org.opensaml.saml2.metadata.provider.BaseMetadataProvider |
---|
getMetadataFilter, requireValidMetadata, setMetadataFilter, setRequireValidMetadata |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.opensaml.saml2.metadata.provider.MetadataProvider |
---|
getEntitiesDescriptor, getEntityDescriptor, getMetadata, getMetadataFilter, getRole, getRole, requireValidMetadata, setMetadataFilter, setRequireValidMetadata |
Constructor Detail |
---|
public FilesystemMetadataProvider(File metadata) throws MetadataProviderException
metadata
- the metadata file
MetadataProviderException
- thrown if the given file path is null, does not exist, does not represent a
file, or if the metadata can not be parsedpublic FilesystemMetadataProvider(Timer backgroundTaskTimer, File metadata) throws MetadataProviderException
metadata
- the metadata filebackgroundTaskTimer
- timer used to refresh metadata in the background
MetadataProviderException
- thrown if the given file path is null, does not exist, does not represent a
file, or if the metadata can not be parsedMethod Detail |
---|
protected void setMetadataFile(File file) throws MetadataProviderException
file
- path to the metadata file
MetadataProviderException
- thrown if the file does not exist or is not a readable filepublic boolean maintainExpiredMetadata()
BaseMetadataProvider.requireValidMetadata()
instead
public void setMaintainExpiredMetadata(boolean maintain)
BaseMetadataProvider.setRequireValidMetadata(boolean)
instead
maintain
- whether cached metadata should be discarded if it expires and can not be refreshed.protected String getMetadataIdentifier()
getMetadataIdentifier
in class AbstractReloadingMetadataProvider
protected byte[] fetchMetadata() throws MetadataProviderException
fetchMetadata
in class AbstractReloadingMetadataProvider
MetadataProviderException
- thrown if there is a problem fetching the metadata
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |