public abstract class AbstractDynamicHTTPMetadataResolver extends AbstractDynamicMetadataResolver
| Modifier and Type | Class and Description |
|---|---|
class |
AbstractDynamicHTTPMetadataResolver.BasicMetadataResponseHandler
Basic HttpClient response handler for processing metadata fetch requests.
|
AbstractDynamicMetadataResolver.BackingStoreCleanupSweeper, AbstractDynamicMetadataResolver.DynamicEntityBackingStore, AbstractDynamicMetadataResolver.EntityManagementDataAbstractMetadataResolver.EntityBackingStore| Modifier and Type | Field and Description |
|---|---|
private CredentialsProvider |
credentialsProvider
HttpClient credentials provider.
|
static String[] |
DEFAULT_CONTENT_TYPES
Default list of supported content MIME types.
|
private HttpClient |
httpClient
HTTP Client used to pull the metadata.
|
private Logger |
log
Class logger.
|
private ResponseHandler<org.opensaml.core.xml.XMLObject> |
responseHandler
HttpClient ResponseHandler instance to use.
|
private List<String> |
supportedContentTypes
List of supported MIME types for use in Accept request header and validation of
response Content-Type header.
|
private String |
supportedContentTypesValue
Generated Accept request header value.
|
| Constructor and Description |
|---|
AbstractDynamicHTTPMetadataResolver(HttpClient client)
Constructor.
|
AbstractDynamicHTTPMetadataResolver(Timer backgroundTaskTimer,
HttpClient client)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected HttpClientContext |
buildHttpClientContext()
Build the
HttpClientContext instance which will be used to invoke the HttpClient request. |
protected HttpUriRequest |
buildHttpRequest(net.shibboleth.utilities.java.support.resolver.CriteriaSet criteria)
Build an appropriate instance of
HttpUriRequest based on the input criteria set. |
protected abstract String |
buildRequestURL(net.shibboleth.utilities.java.support.resolver.CriteriaSet criteria)
Build the request URL based on the input criteria set.
|
protected void |
doDestroy() |
protected org.opensaml.core.xml.XMLObject |
fetchFromOriginSource(net.shibboleth.utilities.java.support.resolver.CriteriaSet criteria)
Fetch the metadata from the origin source.
|
List<String> |
getSupportedContentTypes()
Get the list of supported MIME types for use in Accept request header and validation of
response Content-Type header.
|
protected void |
initMetadataResolver()
Subclasses should override this method to perform any initialization logic necessary.
|
void |
setBasicCredentials(UsernamePasswordCredentials credentials)
A convenience method to set a (single) username and password used to access metadata.
|
void |
setBasicCredentialsWithScope(UsernamePasswordCredentials credentials,
AuthScope scope)
A convenience method to set a (single) username and password used to access metadata.
|
void |
setCredentialsProvider(CredentialsProvider provider)
Set an instance of
CredentialsProvider used for authentication by the HttpClient instance. |
void |
setSupportedContentTypes(List<String> types)
Set the list of supported MIME types for use in Accept request header and validation of
response Content-Type header.
|
computeExpirationTime, computeRefreshTriggerTime, createNewBackingStore, getBackingStore, getCleanupTaskInterval, getMaxCacheDuration, getMaxIdleEntityData, getMinCacheDuration, getRefreshDelayFactor, isRemoveIdleEntityData, lookupEntityID, preProcessEntityDescriptor, processNewMetadata, resolve, resolveFromOriginSource, setCleanupTaskInterval, setMaxCacheDuration, setMaxIdleEntityData, setMinCacheDuration, setRefreshDelayFactor, setRemoveIdleEntityData, shouldAttemptRefreshdoInitialize, filterMetadata, getMetadataFilter, getParserPool, getUnmarshallerFactory, indexEntityDescriptor, isFailFastInitialization, isRequireValidMetadata, isValid, lookupIndexedEntityID, preProcessEntitiesDescriptor, releaseMetadataDOM, removeByEntityID, resolveSingle, setBackingStore, setFailFastInitialization, setMetadataFilter, setParserPool, setRequireValidMetadata, unmarshallMetadatasetIdgetIddestroy, initialize, isDestroyed, isInitializedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetMetadataFilter, isRequireValidMetadata, setMetadataFilter, setRequireValidMetadatapublic static final String[] DEFAULT_CONTENT_TYPES
private final Logger log
private HttpClient httpClient
private List<String> supportedContentTypes
private String supportedContentTypesValue
private ResponseHandler<org.opensaml.core.xml.XMLObject> responseHandler
private CredentialsProvider credentialsProvider
public AbstractDynamicHTTPMetadataResolver(@Nonnull HttpClient client)
client - the instance of HttpClient used to fetch remote metadatapublic AbstractDynamicHTTPMetadataResolver(@Nullable Timer backgroundTaskTimer, @Nonnull HttpClient client)
backgroundTaskTimer - the Timer instance used to run resolver background managment tasksclient - the instance of HttpClient used to fetch remote metadatapublic void setCredentialsProvider(@Nullable CredentialsProvider provider)
CredentialsProvider used for authentication by the HttpClient instance.provider - the credentials providerpublic void setBasicCredentials(@Nullable UsernamePasswordCredentials credentials)
An AuthScope will be generated which specifies any host, port, scheme and realm.
To specify multiple usernames and passwords for multiple host, port, scheme, and realm combinations, instead
provide an instance of CredentialsProvider via setCredentialsProvider(CredentialsProvider).
credentials - the username and password credentialspublic void setBasicCredentialsWithScope(@Nullable UsernamePasswordCredentials credentials, @Nullable AuthScope scope)
If the authScope is null, an AuthScope will be generated which specifies
any host, port, scheme and realm.
To specify multiple usernames and passwords for multiple host, port, scheme, and realm combinations, instead
provide an instance of CredentialsProvider via setCredentialsProvider(CredentialsProvider).
credentials - the username and password credentialsscope - the HTTP client auth scope with which to scope the credentials, may be null@NonnullAfterInit @NotLive @Unmodifiable public List<String> getSupportedContentTypes()
public void setSupportedContentTypes(@Nullable List<String> types)
types - the new supported content types to setprotected void initMetadataResolver()
throws net.shibboleth.utilities.java.support.component.ComponentInitializationException
initMetadataResolver in class AbstractDynamicMetadataResolvernet.shibboleth.utilities.java.support.component.ComponentInitializationException - thrown if there is a problem initializing the providerprotected void doDestroy()
doDestroy in class AbstractDynamicMetadataResolver@Nullable protected org.opensaml.core.xml.XMLObject fetchFromOriginSource(@Nonnull net.shibboleth.utilities.java.support.resolver.CriteriaSet criteria) throws IOException
fetchFromOriginSource in class AbstractDynamicMetadataResolvercriteria - the input criteria setIOException - if there is a fatal error fetching metadata from the origin source@Nullable protected HttpUriRequest buildHttpRequest(@Nonnull net.shibboleth.utilities.java.support.resolver.CriteriaSet criteria)
HttpUriRequest based on the input criteria set.criteria - the input criteria set@Nullable protected abstract String buildRequestURL(@Nonnull net.shibboleth.utilities.java.support.resolver.CriteriaSet criteria)
criteria - the input criteria setprotected HttpClientContext buildHttpClientContext()
HttpClientContext instance which will be used to invoke the HttpClient request.HttpClientContextCopyright © 1999–2014. All rights reserved.