|
||||||||||
| 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.HTTPMetadataProvider
org.opensaml.saml2.metadata.provider.FileBackedHTTPMetadataProvider
public class FileBackedHTTPMetadataProvider
A URL metadata provider that caches a copy of the retrieved metadata to disk so that, in the event that the metadata
may not be pulled from the URL it may be pulled from disk using the last fetched data. If the backing file does not
already exist it will be created.
It is the responsibility of the caller to re-initialize, via AbstractMetadataProvider.initialize(), if any properties of this
provider are changed.
| 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 |
metadataBackupFile
File containing the backup of the metadata. |
| Fields inherited from class org.opensaml.saml2.metadata.provider.BaseMetadataProvider |
|---|
unmarshallerFactory |
| Constructor Summary | |
|---|---|
FileBackedHTTPMetadataProvider(String metadataURL,
int requestTimeout,
String backupFilePath)
Deprecated. |
|
FileBackedHTTPMetadataProvider(Timer backgroundTaskTimer,
org.apache.commons.httpclient.HttpClient client,
String metadataURL,
String backupFilePath)
Constructor. |
|
| Method Summary | |
|---|---|
void |
destroy()
Destroys the metadata provider and frees any resources current held by it. |
protected void |
doInitialization()
Subclasses should override this method to perform any initialization logic necessary. |
protected byte[] |
fetchMetadata()
Gets the metadata document from the remote server. |
protected void |
postProcessMetadata(byte[] metadataBytes,
Document metadataDom,
XMLObject metadata)
Post-processing hook called after new metadata has been unmarshalled, filtered, and the DOM released (from the XMLObject) but before the metadata is saved off. |
protected void |
setBackupFile(String backupFilePath)
Sets the file used to backup metadata. |
protected void |
validateBackupFile(File backupFile)
Validate the basic properties of the specified metadata backup file, for example that it exists and/or can be created; that it is not a directory; and that it is readable and writable. |
| Methods inherited from class org.opensaml.saml2.metadata.provider.HTTPMetadataProvider |
|---|
buildGetMethod, getMaxCacheDuration, getMetadataBytesFromResponse, getMetadataIdentifier, getMetadataURI, getRequestTimeout, maintainExpiredMetadata, processConditionalRetrievalHeaders, setBasicCredentials, setMaintainExpiredMetadata, setMaxCacheDuration, setSocketFactory |
| Methods inherited from class org.opensaml.saml2.metadata.provider.AbstractReloadingMetadataProvider |
|---|
computeNextRefreshDelay, doGetMetadata, getExpirationTime, getLastRefresh, getLastUpdate, getMaxRefreshDelay, getMinRefreshDelay, getNextRefresh, getRefreshDelayFactor, inputstreamToByteArray, 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 metadataBackupFile
| Constructor Detail |
|---|
@Deprecated
public FileBackedHTTPMetadataProvider(String metadataURL,
int requestTimeout,
String backupFilePath)
throws MetadataProviderException
metadataURL - the URL to fetch the metadatarequestTimeout - the time, in milliseconds, to wait for the metadata server to respondbackupFilePath - the file that will keep a backup copy of the metadata,
MetadataProviderException - thrown if the URL is not a valid URL, the metadata can not be retrieved from
the URL
public FileBackedHTTPMetadataProvider(Timer backgroundTaskTimer,
org.apache.commons.httpclient.HttpClient client,
String metadataURL,
String backupFilePath)
throws MetadataProviderException
client - HTTP client used to fetch remove metadatabackgroundTaskTimer - timer used to schedule background metadata refresh tasksmetadataURL - the URL to fetch the metadatabackupFilePath - the file that will keep a backup copy of the metadata,
MetadataProviderException - thrown if the URL is not a valid URL, the metadata can not be retrieved from
the URL| Method Detail |
|---|
public void destroy()
destroy in class HTTPMetadataProvider
protected void doInitialization()
throws MetadataProviderException
doInitialization in class AbstractReloadingMetadataProviderMetadataProviderException - thrown if there is a problem initializing the provider
protected void setBackupFile(String backupFilePath)
throws MetadataProviderException
backupFilePath - path to the backup file
MetadataProviderException - thrown if the backup file is not read/writable or creatable
protected void validateBackupFile(File backupFile)
throws MetadataProviderException
backupFile - the file to evaluate
MetadataProviderException - if file does not pass basic properties required of a metadata backup file
protected byte[] fetchMetadata()
throws MetadataProviderException
fetchMetadata in class HTTPMetadataProviderMetadataProviderException - thrown if there is a problem retrieving the metadata from the remote server
protected void postProcessMetadata(byte[] metadataBytes,
Document metadataDom,
XMLObject metadata)
throws MetadataProviderException
XMLObject) but before the metadata is saved off. Any exception thrown by this hook will cause the
retrieved metadata to be discarded.
The default implementation of this method is a no-op
postProcessMetadata in class AbstractReloadingMetadataProvidermetadataBytes - raw metadata bytes retrieved via AbstractReloadingMetadataProvider.fetchMetadata()metadataDom - metadata after it has been parsed in to a DOM documentmetadata - metadata after it has been run through all registered filters and its DOM released
MetadataProviderException - thrown if there is a problem with the provided data
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||