Class ConfigClientRequestTemplateFactory
java.lang.Object
org.springframework.cloud.config.client.ConfigClientRequestTemplateFactory
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAdds the provided headers to the request. -
Constructor Summary
ConstructorsConstructorDescriptionConfigClientRequestTemplateFactory(org.apache.commons.logging.Log log, ConfigClientProperties properties) ConfigClientRequestTemplateFactory(org.apache.commons.logging.Log log, ConfigClientProperties properties, List<org.springframework.http.client.ClientHttpRequestInterceptor> additionalInterceptors) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAuthorizationToken(org.springframework.http.HttpHeaders httpHeaders, String username, String password) voidaddInterceptor(org.springframework.http.client.ClientHttpRequestInterceptor interceptor) Add an interceptor to be applied to theRestTemplatereturned bycreate().org.springframework.web.client.RestTemplatecreate()protected org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManagerprotected org.springframework.http.client.ClientHttpRequestFactoryprotected org.apache.hc.core5.http.io.SocketConfig.Builderorg.apache.commons.logging.LoggetLog()
-
Constructor Details
-
ConfigClientRequestTemplateFactory
public ConfigClientRequestTemplateFactory(org.apache.commons.logging.Log log, ConfigClientProperties properties) -
ConfigClientRequestTemplateFactory
public ConfigClientRequestTemplateFactory(org.apache.commons.logging.Log log, ConfigClientProperties properties, List<org.springframework.http.client.ClientHttpRequestInterceptor> additionalInterceptors)
-
-
Method Details
-
addInterceptor
public void addInterceptor(org.springframework.http.client.ClientHttpRequestInterceptor interceptor) Add an interceptor to be applied to theRestTemplatereturned bycreate(). Used to attach authentication interceptors (for example the OAuth2 bearer-token interceptor) without coupling this factory to a specific security implementation.- Parameters:
interceptor- the interceptor to add
-
getLog
public org.apache.commons.logging.Log getLog() -
getProperties
-
create
public org.springframework.web.client.RestTemplate create() -
createHttpRequestFactory
protected org.springframework.http.client.ClientHttpRequestFactory createHttpRequestFactory(ConfigClientProperties client) -
createConnectionManagerForTls
protected org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager createConnectionManagerForTls(ConfigClientProperties client) throws GeneralSecurityException, IOException - Throws:
GeneralSecurityExceptionIOException
-
createSocketBuilderForTls
protected org.apache.hc.core5.http.io.SocketConfig.Builder createSocketBuilderForTls(ConfigClientProperties client) -
addAuthorizationToken
-