Class NimbusClientFactory
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.idp.plugin.authn.duo.nimbus.impl.NimbusClientFactory
- All Implemented Interfaces:
DuoOIDCClientFactory,Component,DestructableComponent,InitializableComponent
@ThreadSafe
public final class NimbusClientFactory
extends AbstractInitializableComponent
implements DuoOIDCClientFactory
Abstract factory implementation for creating new NimbusClients.
Each client instance shares the same, thread-safe, http client and object mapper.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.apache.hc.client5.http.classic.HttpClientHttpClient for contacting Duo.private HttpClientSecurityParametersHTTP client security parameters.private com.fasterxml.jackson.databind.ObjectMapperJSON object mapper. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateInstance(DuoOIDCIntegration integration) Create anDuoOIDCClientinstance from the supplied integration.protected voidprivate org.apache.hc.client5.http.classic.HttpClientInternally synchronized method for returning the HttpClient.private HttpClientSecurityParametersInternally synchronized method for returning the http client security parameters.private com.fasterxml.jackson.databind.ObjectMapperInternally synchronized method for returning the object mapper.voidsetHttpClient(org.apache.hc.client5.http.classic.HttpClient client) Set theHttpClientto use for contacting Duo.voidSet the optional client security parameters.voidsetObjectMapper(com.fasterxml.jackson.databind.ObjectMapper mapper) Set the JSONObjectMapper.Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitialized
-
Field Details
-
httpClient
HttpClient for contacting Duo. -
httpClientSecurityParameters
HTTP client security parameters. -
objectMapper
JSON object mapper.
-
-
Constructor Details
-
NimbusClientFactory
public NimbusClientFactory()
-
-
Method Details
-
createInstance
public DuoOIDCClient createInstance(@Nonnull DuoOIDCIntegration integration) throws DuoClientException Description copied from interface:DuoOIDCClientFactoryCreate anDuoOIDCClientinstance from the supplied integration.The client should be fully initialised and safely published.
- Specified by:
createInstancein interfaceDuoOIDCClientFactory- Parameters:
integration- the duo integration used to instantiate the client.- Returns:
- the created Duo client, never
null. - Throws:
DuoClientException- if there is an error creating the Duo client.
-
doInitialize
- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
getHttpClient
Internally synchronized method for returning the HttpClient.- Returns:
- the http client.
-
getHttpClientSecurityParameters
Internally synchronized method for returning the http client security parameters.- Returns:
- the http client security parameters.
-
getObjectMapper
Internally synchronized method for returning the object mapper.- Returns:
- the object mapper.
-
setHttpClient
public void setHttpClient(@Nonnull org.apache.hc.client5.http.classic.HttpClient client) Set theHttpClientto use for contacting Duo.- Parameters:
client- the http client.
-
setHttpClientSecurityParameters
Set the optional client security parameters.- Parameters:
params- the new client security parameters
-
setObjectMapper
public void setObjectMapper(@Nonnull com.fasterxml.jackson.databind.ObjectMapper mapper) Set the JSONObjectMapper.- Parameters:
mapper- object mapper
-