Package net.shibboleth.idp.attribute.resolver.dc.http.impl

# Class HTTPDataConnector

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
net.shibboleth.idp.attribute.resolver.AbstractResolverPlugin<Map<String,IdPAttribute>>
net.shibboleth.idp.attribute.resolver.AbstractDataConnector
net.shibboleth.idp.attribute.resolver.dc.impl.AbstractSearchDataConnector<HTTPSearch,HTTPResponseMappingStrategy>
net.shibboleth.idp.attribute.resolver.dc.http.impl.HTTPDataConnector

All Implemented Interfaces:
  `DataConnector`, `ResolverPlugin<Map<String,IdPAttribute>>`, `Component`, `DestructableComponent`, `IdentifiableComponent`, `IdentifiedComponent`, `InitializableComponent`, `UnmodifiableComponent`, `DisposableBean`

public class HTTPDataConnector extends AbstractSearchDataConnector<HTTPSearch,HTTPResponseMappingStrategy>
This class implements a `DataConnector` that obtains data from an HTTP service.

## Field Summary

Fields
Modifier and Type
Field
Description
`private org.apache.hc.client5.http.classic.HttpClient`
`httpClient`
The `HttpClient` to use.
`private HttpClientSecurityParameters`
`httpClientSecurityParameters`
HTTP client security parameters.

## Constructor Summary

Constructors
Constructor
Description
`HTTPDataConnector()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`void`
`doInitialize()`
`protected Map<String,IdPAttribute>`
`retrieveAttributes(HTTPSearch executable)`
Attempts to retrieve attributes from the data source.
`void`
`setHttpClient(org.apache.hc.client5.http.classic.HttpClient client)`
Set the `HttpClient` to use.
`void`
`setHttpClientSecurityParameters(HttpClientSecurityParameters params)`
Set the optional client security parameters.

### Methods inherited from class net.shibboleth.idp.attribute.resolver.dc.impl.AbstractSearchDataConnector

`doDataConnectorResolve, getExecutableSearchBuilder, getMappingStrategy, getResultsCache, getValidator, isFailFastInitialize, retrieveAttributes, setExecutableSearchBuilder, setFailFastInitialize, setMappingStrategy, setResultsCache, setValidator`

### Methods inherited from class net.shibboleth.idp.attribute.resolver.AbstractDataConnector

`doResolve, getExportAttributes, getFailoverDataConnectorId, getLastFail, getLastSuccess, getLogPrefix, getNoRetryDelay, setExportAttributes, setFailoverDataConnectorId, setLastFail, setLastSuccess, setNoRetryDelay`

### Methods inherited from class net.shibboleth.idp.attribute.resolver.AbstractResolverPlugin

`doDestroy, equals, getActivationCondition, getAttributeDependencies, getDataConnectorDependencies, hashCode, isPropagateResolutionExceptions, resolve, setActivationCondition, setAttributeDependencies, setDataConnectorDependencies, setPropagateResolutionExceptions`

### Methods inherited from class net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent

`setId`

### Methods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent

`ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException`

### Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent

`checkComponentActive, checkSetterPreconditions, destroy, initialize, isDestroyed, isInitialized`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface net.shibboleth.shared.component.DestructableComponent

`destroy, isDestroyed`

### Methods inherited from interface org.springframework.beans.factory.DisposableBean

`destroy`

### Methods inherited from interface net.shibboleth.shared.component.IdentifiedComponent

`getId`

### Methods inherited from interface net.shibboleth.shared.component.InitializableComponent

`initialize, isInitialized`

### Methods inherited from interface net.shibboleth.idp.attribute.resolver.ResolverPlugin

`getActivationCondition, getAttributeDependencies, getDataConnectorDependencies, isPropagateResolutionExceptions, resolve`

## Field Details

### httpClient

@NonnullAfterInit private org.apache.hc.client5.http.classic.HttpClient httpClient
The `HttpClient` to use.

### httpClientSecurityParameters

@Nullable private HttpClientSecurityParameters httpClientSecurityParameters
HTTP client security parameters.

## Constructor Details

### HTTPDataConnector

public HTTPDataConnector()
Constructor.

## Method Details

### setHttpClient

public void setHttpClient(@Nonnull org.apache.hc.client5.http.classic.HttpClient client)
Set the `HttpClient` to use.

Parameters:
  `client` - client to use

### setHttpClientSecurityParameters

public void setHttpClientSecurityParameters(@Nullable HttpClientSecurityParameters params)
Set the optional client security parameters.

Parameters:
  `params` - the new client security parameters

### doInitialize

public void doInitialize() throws ComponentInitializationException

Overrides:
  `doInitialize` in class `AbstractSearchDataConnector<HTTPSearch,HTTPResponseMappingStrategy>`
Throws:
  `ComponentInitializationException`

### retrieveAttributes

@Nullable @Unmodifiable @NotLive protected Map<String,IdPAttribute> retrieveAttributes(@Nonnull HTTPSearch executable) throws ResolutionException
Attempts to retrieve attributes from the data source.

Specified by:
  `retrieveAttributes` in class `AbstractSearchDataConnector<HTTPSearch,HTTPResponseMappingStrategy>`
Parameters:
  `executable` - used to retrieve data from the data source
Returns:
  attributes
Throws:
  `ResolutionException` - thrown if there is a problem retrieving data from the data source