Package org.citrusframework.http.client
Class BasicAuthClientHttpRequestFactory
java.lang.Object
org.citrusframework.http.client.BasicAuthClientHttpRequestFactory
- All Implemented Interfaces:
InitializingPhase,org.springframework.beans.factory.FactoryBean<org.springframework.http.client.HttpComponentsClientHttpRequestFactory>
public class BasicAuthClientHttpRequestFactory
extends Object
implements org.springframework.beans.factory.FactoryBean<org.springframework.http.client.HttpComponentsClientHttpRequestFactory>, InitializingPhase
Factory bean constructing a client request factory with
user credentials for basic authentication.
- Since:
- 1.2
- Author:
- Christoph Deppisch
-
Field Summary
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.client.HttpComponentsClientHttpRequestFactoryConstruct the client factory bean with user credentials.Class<?>Get the object type.voidbooleanIs singleton bean?voidsetAuthScope(org.apache.hc.client5.http.auth.AuthScope authScope) Sets the authScope.voidsetCredentials(org.apache.hc.client5.http.auth.Credentials credentials) Sets the credentials.voidsetHttpClient(org.apache.hc.client5.http.impl.classic.HttpClientBuilder httpClient) Sets the httpClient.
-
Constructor Details
-
BasicAuthClientHttpRequestFactory
public BasicAuthClientHttpRequestFactory()
-
-
Method Details
-
getObject
public org.springframework.http.client.HttpComponentsClientHttpRequestFactory getObject() throws ExceptionConstruct the client factory bean with user credentials.- Specified by:
getObjectin interfaceorg.springframework.beans.factory.FactoryBean<org.springframework.http.client.HttpComponentsClientHttpRequestFactory>- Throws:
Exception
-
getObjectType
Get the object type.- Specified by:
getObjectTypein interfaceorg.springframework.beans.factory.FactoryBean<org.springframework.http.client.HttpComponentsClientHttpRequestFactory>
-
isSingleton
public boolean isSingleton()Is singleton bean?- Specified by:
isSingletonin interfaceorg.springframework.beans.factory.FactoryBean<org.springframework.http.client.HttpComponentsClientHttpRequestFactory>
-
initialize
public void initialize()- Specified by:
initializein interfaceInitializingPhase
-
setCredentials
public void setCredentials(org.apache.hc.client5.http.auth.Credentials credentials) Sets the credentials.- Parameters:
credentials- the credentials to set
-
setAuthScope
public void setAuthScope(org.apache.hc.client5.http.auth.AuthScope authScope) Sets the authScope.- Parameters:
authScope- the authScope to set
-
setHttpClient
public void setHttpClient(org.apache.hc.client5.http.impl.classic.HttpClientBuilder httpClient) Sets the httpClient.- Parameters:
httpClient- the httpClient to set
-