public class FileBackedHTTPMetadataResolver extends HTTPMetadataResolver
AbstractInitializableComponent.initialize()
, if any properties of this
provider are changed.AbstractBatchMetadataResolver.BatchEntityBackingStore
AbstractMetadataResolver.EntityBackingStore
Constructor and Description |
---|
FileBackedHTTPMetadataResolver(org.apache.http.client.HttpClient client,
String metadataURL,
String backupFilePath)
Constructor.
|
FileBackedHTTPMetadataResolver(Timer backgroundTaskTimer,
org.apache.http.client.HttpClient client,
String metadataURL,
String backupFilePath)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
doDestroy() |
protected byte[] |
fetchMetadata()
Gets the metadata document from the remote server.
|
protected void |
initMetadataResolver()
Subclasses should override this method to perform any initialization logic necessary.
|
protected void |
postProcessMetadata(byte[] metadataBytes,
Document metadataDom,
XMLObject originalMetadata,
XMLObject filteredMetadata)
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.
|
buildHttpClientContext, buildHttpGet, checkTLSCredentialTrusted, getMetadataBytesFromResponse, getMetadataIdentifier, getMetadataURI, processConditionalRetrievalHeaders, setBasicCredentials, setBasicCredentialsWithScope, setTLSTrustEngine
computeNextRefreshDelay, getExpirationTime, getLastRefresh, getLastUpdate, getMaxRefreshDelay, getMinRefreshDelay, getNextRefresh, getRefreshDelayFactor, inputstreamToByteArray, processCachedMetadata, processNewMetadata, processNonExpiredMetadata, processPreExpiredMetadata, refresh, setCacheSourceMetadata, setMaxRefreshDelay, setMinRefreshDelay, setRefreshDelayFactor, unmarshallMetadata
createNewBackingStore, getBackingStore, getCachedFilteredMetadata, getCachedOriginalMetadata, isCacheSourceMetadata, iterator, preProcessNewMetadata, resolve
doInitialize, filterMetadata, getMetadataFilter, getParserPool, getUnmarshallerFactory, indexEntityDescriptor, isFailFastInitialization, isRequireValidMetadata, isValid, lookupEntityID, lookupIndexedEntityID, preProcessEntitiesDescriptor, preProcessEntityDescriptor, releaseMetadataDOM, removeByEntityID, resolveSingle, setBackingStore, setFailFastInitialization, setMetadataFilter, setParserPool, setRequireValidMetadata, unmarshallMetadata
setId
getId
destroy, initialize, isDestroyed, isInitialized
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getMetadataFilter, isRequireValidMetadata, setMetadataFilter, setRequireValidMetadata
resolve, resolveSingle
getId
forEach, spliterator
public FileBackedHTTPMetadataResolver(org.apache.http.client.HttpClient client, String metadataURL, String backupFilePath) throws net.shibboleth.utilities.java.support.resolver.ResolverException
client
- HTTP client used to fetch remote metadatametadataURL
- the URL to fetch the metadatabackupFilePath
- the file that will keep a backup copy of the metadata,net.shibboleth.utilities.java.support.resolver.ResolverException
- thrown if the URL is not a valid URL, the metadata can not be retrieved from
the URLpublic FileBackedHTTPMetadataResolver(Timer backgroundTaskTimer, org.apache.http.client.HttpClient client, String metadataURL, String backupFilePath) throws net.shibboleth.utilities.java.support.resolver.ResolverException
client
- HTTP client used to fetch remote 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,net.shibboleth.utilities.java.support.resolver.ResolverException
- thrown if the URL is not a valid URL, the metadata can not be retrieved from
the URLprotected void doDestroy()
doDestroy
in class HTTPMetadataResolver
protected void initMetadataResolver() throws net.shibboleth.utilities.java.support.component.ComponentInitializationException
initMetadataResolver
in class AbstractReloadingMetadataResolver
net.shibboleth.utilities.java.support.component.ComponentInitializationException
- thrown if there is a problem initializing the providerprotected void setBackupFile(String backupFilePath) throws net.shibboleth.utilities.java.support.resolver.ResolverException
backupFilePath
- path to the backup filenet.shibboleth.utilities.java.support.resolver.ResolverException
- thrown if the backup file is not read/writable or creatableprotected void validateBackupFile(File backupFile) throws net.shibboleth.utilities.java.support.resolver.ResolverException
backupFile
- the file to evaluatenet.shibboleth.utilities.java.support.resolver.ResolverException
- if file does not pass basic properties required of a metadata backup fileprotected byte[] fetchMetadata() throws net.shibboleth.utilities.java.support.resolver.ResolverException
fetchMetadata
in class HTTPMetadataResolver
net.shibboleth.utilities.java.support.resolver.ResolverException
- thrown if there is a problem retrieving the metadata from the remote serverprotected void postProcessMetadata(byte[] metadataBytes, Document metadataDom, XMLObject originalMetadata, XMLObject filteredMetadata) throws net.shibboleth.utilities.java.support.resolver.ResolverException
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-oppostProcessMetadata
in class AbstractReloadingMetadataResolver
metadataBytes
- original raw metadata bytes retrieved via AbstractReloadingMetadataResolver.fetchMetadata()
metadataDom
- original metadata after it has been parsed in to a DOM documentoriginalMetadata
- original metadata prior to being filtered, with its DOM releasedfilteredMetadata
- metadata after it has been run through all registered filters and its DOM releasednet.shibboleth.utilities.java.support.resolver.ResolverException
- thrown if there is a problem with the provided dataCopyright © 2017. All rights reserved.