|
||||||||||
| 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 | |
|---|---|
private org.slf4j.Logger |
log
Class logger. |
private File |
metadataFile
The metadata file. |
| 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 | |
|---|---|
void |
destroy()
Destroys the metadata provider and frees any resources current held by it. |
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. |
protected void |
validateMetadataFile(File file)
Validate the basic properties of the specified metadata file, for example that it exists; that it is a file; and that it is readable. |
| 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 |
| Field Detail |
|---|
private final org.slf4j.Logger log
private File metadataFile
| Constructor Detail |
|---|
public FilesystemMetadataProvider(File metadata)
throws MetadataProviderException
metadata - the metadata file
MetadataProviderException - this exception is no longer thrown
public FilesystemMetadataProvider(Timer backgroundTaskTimer,
File metadata)
throws MetadataProviderException
metadata - the metadata filebackgroundTaskTimer - timer used to refresh metadata in the background
MetadataProviderException - this exception is no longer thrown| Method Detail |
|---|
protected void setMetadataFile(File file)
throws MetadataProviderException
file - path to the metadata file
MetadataProviderException - this exception is no longer thrownpublic 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.public void destroy()
destroy in class AbstractReloadingMetadataProviderprotected String getMetadataIdentifier()
getMetadataIdentifier in class AbstractReloadingMetadataProvider
protected byte[] fetchMetadata()
throws MetadataProviderException
fetchMetadata in class AbstractReloadingMetadataProviderMetadataProviderException - thrown if there is a problem fetching the metadata
protected void validateMetadataFile(File file)
throws MetadataProviderException
file - the file to evaluate
MetadataProviderException - if file does not pass basic properties required of a metadata file
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||