|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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
public class HTTPMetadataProvider
A metadata provider that pulls metadata using an HTTP GET. Metadata is cached until one of these criteria is met:
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.apache.commons.httpclient.auth.AuthScope |
authScope
URL scope that requires authentication. |
private String |
cachedMetadataETag
The ETag provided when the currently cached metadata was fetched. |
private String |
cachedMetadataLastModified
The Last-Modified information provided when the currently cached metadata was fetched. |
private org.apache.commons.httpclient.HttpClient |
httpClient
HTTP Client used to pull the metadata. |
private org.slf4j.Logger |
log
Class logger. |
private URI |
metadataURI
URL to the Metadata. |
Fields inherited from class org.opensaml.saml2.metadata.provider.BaseMetadataProvider |
---|
unmarshallerFactory |
Constructor Summary | |
---|---|
HTTPMetadataProvider(String metadataURL,
int requestTimeout)
Deprecated. |
|
HTTPMetadataProvider(Timer backgroundTaskTimer,
org.apache.commons.httpclient.HttpClient client,
String metadataURL)
Constructor. |
Method Summary | |
---|---|
protected org.apache.commons.httpclient.methods.GetMethod |
buildGetMethod()
Builds the HTTP GET method used to fetch the metadata. |
void |
destroy()
Destroys the metadata provider and frees any resources current held by it. |
protected byte[] |
fetchMetadata()
Gets the metadata document from the remote server. |
int |
getMaxCacheDuration()
Deprecated. use AbstractReloadingMetadataProvider.getMaxRefreshDelay() instead |
protected byte[] |
getMetadataBytesFromResponse(org.apache.commons.httpclient.methods.GetMethod getMethod)
Extracts the raw metadata bytes from the response taking in to account possible deflate and GZip compression. |
protected String |
getMetadataIdentifier()
Gets an identifier which may be used to distinguish this metadata in logging statements. |
String |
getMetadataURI()
Gets the URL to fetch the metadata. |
int |
getRequestTimeout()
Gets the length of time in milliseconds to wait for the server to respond. |
boolean |
maintainExpiredMetadata()
Deprecated. use BaseMetadataProvider.requireValidMetadata() instead |
protected void |
processConditionalRetrievalHeaders(org.apache.commons.httpclient.methods.GetMethod getMethod)
Records the ETag and Last-Modified headers, from the response, if they are present. |
void |
setBasicCredentials(String username,
String password)
Sets the username and password used to access the metadata URL. |
void |
setMaintainExpiredMetadata(boolean maintain)
Deprecated. use BaseMetadataProvider.setRequireValidMetadata(boolean) instead |
void |
setMaxCacheDuration(int newDuration)
Deprecated. use AbstractReloadingMetadataProvider.setMaxRefreshDelay(long) instead |
void |
setSocketFactory(org.apache.commons.httpclient.protocol.ProtocolSocketFactory newSocketFactory)
Deprecated. set this information on HTTP client used by provider |
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 org.apache.commons.httpclient.HttpClient httpClient
private URI metadataURI
private String cachedMetadataETag
private String cachedMetadataLastModified
private org.apache.commons.httpclient.auth.AuthScope authScope
Constructor Detail |
---|
@Deprecated public HTTPMetadataProvider(String metadataURL, int requestTimeout) throws MetadataProviderException
metadataURL
- the URL to fetch the metadatarequestTimeout
- the time, in milliseconds, to wait for the metadata server to respond
MetadataProviderException
- thrown if the URL is not a valid URL or the metadata can not be retrieved from
the URLpublic HTTPMetadataProvider(Timer backgroundTaskTimer, org.apache.commons.httpclient.HttpClient client, String metadataURL) throws MetadataProviderException
client
- HTTP client used to pull in remote metadatabackgroundTaskTimer
- timer used to schedule background metadata refresh tasksmetadataURL
- URL to the remove remote metadata
MetadataProviderException
- thrown if the HTTP client is null or the metadata URL provided is invalidMethod Detail |
---|
public String getMetadataURI()
public void setBasicCredentials(String username, String password)
username
- the usernamepassword
- the passwordpublic int getRequestTimeout()
public void setSocketFactory(org.apache.commons.httpclient.protocol.ProtocolSocketFactory newSocketFactory)
newSocketFactory
- the socket factory used to produce sockets used to connect to the serverpublic int getMaxCacheDuration()
AbstractReloadingMetadataProvider.getMaxRefreshDelay()
instead
public void setMaxCacheDuration(int newDuration)
AbstractReloadingMetadataProvider.setMaxRefreshDelay(long)
instead
newDuration
- maximum amount of time, in seconds, metadata will be cached forpublic 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 AbstractReloadingMetadataProvider
protected String getMetadataIdentifier()
getMetadataIdentifier
in class AbstractReloadingMetadataProvider
protected byte[] fetchMetadata() throws MetadataProviderException
fetchMetadata
in class AbstractReloadingMetadataProvider
MetadataProviderException
- thrown if there is a problem retrieving the metadata from the remote serverprotected org.apache.commons.httpclient.methods.GetMethod buildGetMethod()
protected void processConditionalRetrievalHeaders(org.apache.commons.httpclient.methods.GetMethod getMethod)
getMethod
- GetMethod containing a valid HTTP responseprotected byte[] getMetadataBytesFromResponse(org.apache.commons.httpclient.methods.GetMethod getMethod) throws MetadataProviderException
getMethod
- GetMethod containing a valid HTTP response
MetadataProviderException
- thrown if there is a problem getting the raw metadata bytes from the response
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |