public abstract class AbstractDynamicHTTPMetadataResolver extends AbstractDynamicMetadataResolver
AbstractDynamicMetadataResolver.BackingStoreCleanupSweeper, AbstractDynamicMetadataResolver.DynamicEntityBackingStore, AbstractDynamicMetadataResolver.EntityManagementDataAbstractMetadataResolver.EntityBackingStore| Modifier and Type | Field and Description |
|---|---|
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 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 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 |
closeResponse(org.apache.http.HttpResponse response,
URI requestURI)
Close the HTTP response instance.
|
protected void |
doDestroy() |
protected Iterable<EntityDescriptor> |
fetchByCriteria(net.shibboleth.utilities.java.support.resolver.CriteriaSet criteria)
Fetch metadata from an origin source based on the input criteria, store it in the backing store
and then return it.
|
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.
|
protected void |
processResponse(org.apache.http.HttpResponse response,
URI requestURI,
String expectedEntityID)
Process the received HTTP response, including validating the response, unmarshalling the received metadata,
and storing the metadata in the backing store.
|
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.
|
void |
validateHttpResponse(org.apache.http.HttpResponse response,
URI requestURI)
Validate the received HTTP response instance, such as checking for supported content types.
|
createNewBackingStore, getBackingStore, getCleanupTaskInterval, getMaxIdleEntityData, lookupEntityID, processNewMetadata, resolve, setCleanupTaskInterval, setMaxIdleEntityDatadoInitialize, filterMetadata, getMetadataFilter, getParserPool, getUnmarshallerFactory, indexEntityDescriptor, isFailFastInitialization, isRequireValidMetadata, isValid, lookupIndexedEntityID, preProcessEntitiesDescriptor, preProcessEntityDescriptor, releaseMetadataDOM, resolveSingle, setBackingStore, setFailFastInitialization, setMetadataFilter, setParserPool, setRequireValidMetadata, unmarshallMetadatasetIdgetIddestroy, initialize, isDestroyed, isInitializedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetMetadataFilter, isRequireValidMetadata, setMetadataFilter, setRequireValidMetadataresolveSinglegetIdpublic static final String[] DEFAULT_CONTENT_TYPES
private final Logger log
private HttpClient httpClient
private List<String> supportedContentTypes
private String supportedContentTypesValue
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 metadata@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@Nonnull @NonnullElements protected Iterable<EntityDescriptor> fetchByCriteria(@Nonnull net.shibboleth.utilities.java.support.resolver.CriteriaSet criteria) throws net.shibboleth.utilities.java.support.resolver.ResolverException
fetchByCriteria in class AbstractDynamicMetadataResolvercriteria - the input criteria setnet.shibboleth.utilities.java.support.resolver.ResolverException - if there is a fatal error attempting to resolve the metadata@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 void processResponse(@Nonnull org.apache.http.HttpResponse response, @Nonnull URI requestURI, @Nonnull String expectedEntityID) throws net.shibboleth.utilities.java.support.resolver.ResolverException
response - the received responserequestURI - the original request URIexpectedEntityID - the expected entityID of the resolved metadatanet.shibboleth.utilities.java.support.resolver.ResolverException - if there is a fatal error processing the responseprotected void closeResponse(@Nonnull org.apache.http.HttpResponse response, @Nonnull URI requestURI)
response - the received responserequestURI - the original request URIpublic void validateHttpResponse(@Nonnull org.apache.http.HttpResponse response, @Nonnull URI requestURI) throws net.shibboleth.utilities.java.support.resolver.ResolverException
response - the received responserequestURI - the original request URInet.shibboleth.utilities.java.support.resolver.ResolverException - if the response was not valid, or if there is a fatal error validating the responseCopyright © 1999–2014. All rights reserved.