Class JdkHttpRestClient
java.lang.Object
org.refcodes.rest.AbstractRestClient
org.refcodes.rest.JdkHttpRestClient
- All Implemented Interfaces:
Closable, ConnectionComponent<HttpClientContext>, ConnectionOpenable<HttpClientContext>, ConnectionStatusAccessor, LinkComponent, Openable, Openable.OpenBuilder<HttpRestClient>, OpenedAccessor, DeleteRestClient, GetRestClient, HttpRestClient, PostRestClient, PutRestClient, RestClient, RestRequestClient, RestRequestHandler, TrustStoreDescriptorAccessor, TrustStoreDescriptorAccessor.TrustStoreDescriptorBuilder<HttpRestClient>, TrustStoreDescriptorAccessor.TrustStoreDescriptorMutator, TrustStoreDescriptorAccessor.TrustStoreDescriptorProperty, BaseUrlAccessor, BaseUrlAccessor.BaseUrlBuilder<HttpRestClient>, BaseUrlAccessor.BaseUrlMutator, BaseUrlAccessor.BaseUrlProperty, BasicAuthCredentialsAccessor, BasicAuthCredentialsAccessor.BasicAuthCredentialsBuilder<RestClient>, BasicAuthCredentialsAccessor.BasicAuthCredentialsMutator, BasicAuthCredentialsAccessor.BasicAuthCredentialsProperty, HttpClientInterceptable, MediaTypeFactoryLookup, MediaTypeFactoryLookup.MutableMediaTypeFactoryLookup, OauthTokenAccessor, OauthTokenAccessor.OauthTokenBuilder<RestClient>, OauthTokenAccessor.OauthTokenMutator, OauthTokenAccessor.OauthTokenProperty, PostHttpClientInterceptable, PostHttpInterceptable<PostHttpClientInterceptor>, PreHttpClientInterceptable, PreHttpInterceptable<PreHttpClientInterceptor>, UserAgentAccessor, UserAgentAccessor.UserAgentBuilder<RestClient>, UserAgentAccessor.UserAgentMutator, UserAgentAccessor.UserAgentProperty
- Direct Known Subclasses:
JdkHttpRestClientSingleton
The JdkHttpRestClient implements the HttpRestClient
interface. The JdkHttpRestClient is being initialized with some
common MediaTypeFactory instances (as implemented by the
AbstractRestClient). At the time of writing this document the
MediaTypeFactory instances being preconfigured are:
JsonMediaTypeFactoryXmlMediaTypeFactoryTextMediaTypeFactoryFormMediaTypeFactoryHtmlMediaTypeFactory
The JdkHttpRestClient supports HTTP as well as HTTPS protocols as
being based on the HttpURLConnection. For configuring HTTPS
capabilities, refer to the methods such as
open(Url, TrustStoreDescriptor) or
open(Url, TrustStoreDescriptor).
-
Nested Class Summary
Nested classes/interfaces inherited from interface BaseUrlAccessor
BaseUrlAccessor.BaseUrlBuilder<B>, BaseUrlAccessor.BaseUrlMutator, BaseUrlAccessor.BaseUrlPropertyNested classes/interfaces inherited from interface BasicAuthCredentialsAccessor
BasicAuthCredentialsAccessor.BasicAuthCredentialsBuilder<B>, BasicAuthCredentialsAccessor.BasicAuthCredentialsMutator, BasicAuthCredentialsAccessor.BasicAuthCredentialsPropertyNested classes/interfaces inherited from interface Closable
Closable.CloseAutomaton, Closable.CloseBuilder<B>Nested classes/interfaces inherited from interface ConnectionComponent
ConnectionComponent.ConnectionAutomaton<CON>, ConnectionComponent.ConnectionComponentBuilder<CON,B> Nested classes/interfaces inherited from interface ConnectionOpenable
ConnectionOpenable.ConnectionOpenAutomaton<CON>, ConnectionOpenable.ConnectionOpenBuilder<CON,B> Nested classes/interfaces inherited from interface ConnectionStatusAccessor
ConnectionStatusAccessor.ConnectionStatusMutator, ConnectionStatusAccessor.ConnectionStatusPropertyNested classes/interfaces inherited from interface LinkComponent
LinkComponent.LinkAutomaton, LinkComponent.LinkComponentBuilder<B>Nested classes/interfaces inherited from interface MediaTypeFactoryLookup
MediaTypeFactoryLookup.MutableMediaTypeFactoryLookupNested classes/interfaces inherited from interface OauthTokenAccessor
OauthTokenAccessor.OauthTokenBuilder<B>, OauthTokenAccessor.OauthTokenMutator, OauthTokenAccessor.OauthTokenPropertyNested classes/interfaces inherited from interface Openable
Openable.OpenAutomaton, Openable.OpenBuilder<B>Nested classes/interfaces inherited from interface OpenedAccessor
OpenedAccessor.OpenedMutator, OpenedAccessor.OpenedPropertyNested classes/interfaces inherited from interface TrustStoreDescriptorAccessor
TrustStoreDescriptorAccessor.TrustStoreDescriptorBuilder<B>, TrustStoreDescriptorAccessor.TrustStoreDescriptorMutator, TrustStoreDescriptorAccessor.TrustStoreDescriptorPropertyNested classes/interfaces inherited from interface UserAgentAccessor
UserAgentAccessor.UserAgentBuilder<B>, UserAgentAccessor.UserAgentMutator, UserAgentAccessor.UserAgentProperty -
Field Summary
Fields inherited from interface HttpRestClient
DEFAULT_KEYSTORE_TYPE, DEFAULT_SSL_PROTOCOL -
Constructor Summary
ConstructorsConstructorDescriptionConstructs aJdkHttpRestClient.JdkHttpRestClient(ExecutorService aExecutorService) Constructs aJdkHttpRestClient. -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddPostHttpInterceptor(PostHttpClientInterceptor aPostInterceptor) booleanaddPreHttpInterceptor(PreHttpClientInterceptor aPreInterceptor) voidclose()booleanhasPostHttpInterceptor(PostHttpClientInterceptor aPostInterceptor) booleanhasPreHttpInterceptor(PreHttpClientInterceptor aPreInterceptor) voidopen(Url aBaseUrl, TrustStoreDescriptor aStoreDescriptor) Configures the HTTPS client connection with the provided configuration parameters.protected static voidpipe(InputStream aInputStream, OutputStream aOutoutStream) Pipes theInputStreamto theOutputStream.protected voidpostIntercept(HttpClientRequest aRequest, HttpClientResponse aResponse) Invoked to post-process aHttpClientRequestalongside aHttpClientResponse.protected voidpreIntercept(HttpClientRequest aRequest, HttpClientResponse aResponse) Invoked to pre-process aHttpClientRequestalongside aHttpClientResponse.booleanremovePostHttpInterceptor(PostHttpClientInterceptor aPostInterceptor) booleanremovePreHttpInterceptor(PreHttpClientInterceptor aPreInterceptor) voidsetBaseUrl(URL aBaseUrl) voidsetBaseUrl(Url aBaseUrl) voidsetTrustStoreDescriptor(TrustStoreDescriptor aTrustStoreDescriptor) withBaseUrl(String aBaseUrl) withBaseUrl(String aProtocol, String aHost) withBaseUrl(String aProtocol, String aHost, int aPort) withBaseUrl(String aProtocol, String aHost, int aPort, String aPath) withBaseUrl(String aProtocol, String aHost, String aPath) withBaseUrl(URL aBaseURL) withBaseUrl(Scheme aScheme, String aHost) withBaseUrl(Scheme aScheme, String aHost, int aPort) withBaseUrl(Scheme aScheme, String aHost, int aPort, String aPath) withBaseUrl(Scheme aScheme, String aHost, String aPath) withBaseUrl(Url aBaseUrl) withBasicAuthCredentials(String aUserName, String aSecret) withBasicAuthCredentials(BasicAuthCredentials aBasicAuthCredentials) withOAuthToken(OauthToken aOauthToken) withOpen()Open the component's connection(s).withOpen(TrustStoreDescriptor aStoreDescriptor) Configures the HTTPS client connection with the provided configuration parameters.withOpen(HttpClientContext aCtx) Opens the component with the given connection.Configures the HTTPS client connection with the provided configuration parameters.withOpen(Url aBaseUrl, TrustStoreDescriptor aStoreDescriptor) Configures the HTTPS client connection with the provided configuration parameters.withTrustStoreDescriptor(TrustStoreDescriptor aStoreDescriptor) withUserAgent(String aUserAgent) Methods inherited from class AbstractRestClient
addMediaTypeFactory, buildRequest, doRequest, getBasicAuthCredentials, getFactoryMediaTypes, getOauthToken, getUserAgent, initMedaTypeFactories, onResponse, onResponse, onRestRequest, preProcessHeaderFields, setBasicAuthCredentials, setOauthToken, setUserAgent, toMediaTypeFactoryMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BaseUrlAccessor.BaseUrlMutator
setBaseUrl, setBaseUrl, setBaseUrl, setBaseUrl, setBaseUrl, setBaseUrl, setBaseUrl, setBaseUrl, setBaseUrlMethods inherited from interface BaseUrlAccessor.BaseUrlProperty
letBaseUrl, letBaseUrl, letBaseUrl, letBaseUrl, letBaseUrl, letBaseUrl, letBaseUrl, letBaseUrl, letBaseUrl, letBaseUrl, letBaseUrlMethods inherited from interface BasicAuthCredentialsAccessor
getBasicAuthCredentialsMethods inherited from interface BasicAuthCredentialsAccessor.BasicAuthCredentialsMutator
setBasicAuthCredentials, setBasicAuthCredentialsMethods inherited from interface BasicAuthCredentialsAccessor.BasicAuthCredentialsProperty
letBasicAuthCredentials, letBasicAuthCredentialsMethods inherited from interface Closable
closeIn, closeQuietly, closeUncheckedMethods inherited from interface ConnectionOpenable
openUncheckedMethods inherited from interface ConnectionStatusAccessor
isOpenedMethods inherited from interface DeleteRestClient
buildDelete, buildDelete, buildDelete, buildDelete, buildDelete, buildDelete, buildDelete, buildDelete, buildDelete, buildDelete, buildDelete, buildDelete, buildDelete, buildDelete, buildDelete, buildDelete, buildDelete, buildDelete, buildDelete, buildDelete, buildDelete, buildDelete, buildDelete, buildDelete, buildDelete, buildDelete, buildDelete, buildDelete, buildDelete, buildDelete, buildDelete, buildDelete, buildDelete, buildDelete, buildDelete, buildDelete, buildDelete, buildDelete, buildDelete, buildDelete, buildDelete, buildDelete, doDelete, doDelete, doDelete, doDelete, doDelete, doDelete, doDelete, doDelete, doDelete, doDelete, doDelete, doDelete, doDelete, doDelete, doDelete, doDelete, doDelete, doDelete, doDelete, doDelete, doDelete, doDelete, doDelete, doDelete, doDelete, doDelete, doDelete, doDelete, doDelete, doDelete, doDelete, doDelete, doDelete, doDelete, doDelete, doDelete, doDelete, doDelete, doDelete, doDelete, doDelete, doDelete, doDelete, doDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDelete, onDeleteMethods inherited from interface GetRestClient
buildGet, buildGet, buildGet, buildGet, buildGet, buildGet, buildGet, buildGet, buildGet, buildGet, buildGet, buildGet, buildGet, buildGet, buildGet, buildGet, buildGet, buildGet, buildGet, buildGet, buildGet, buildGet, buildGet, buildGet, buildGet, buildGet, buildGet, buildGet, buildGet, buildGet, buildGet, buildGet, buildGet, buildGet, buildGet, buildGet, buildGet, buildGet, buildGet, buildGet, buildGet, buildGet, doGet, doGet, doGet, doGet, doGet, doGet, doGet, doGet, doGet, doGet, doGet, doGet, doGet, doGet, doGet, doGet, doGet, doGet, doGet, doGet, doGet, doGet, doGet, doGet, doGet, doGet, doGet, doGet, doGet, doGet, doGet, doGet, doGet, doGet, doGet, doGet, doGet, doGet, doGet, doGet, doGet, doGet, doGet, doGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGet, onGetMethods inherited from interface HttpClientInterceptable
addHttpInterceptor, hasHttpInterceptor, removeHttpInterceptorMethods inherited from interface HttpRestClient
open, open, open, openMethods inherited from interface MediaTypeFactoryLookup
getFactoryMediaTypes, hasMediaTypeFactory, toMediaTypeFactoryMethods inherited from interface MediaTypeFactoryLookup.MutableMediaTypeFactoryLookup
addMediaTypeFactoryMethods inherited from interface OauthTokenAccessor
getOauthTokenMethods inherited from interface OauthTokenAccessor.OauthTokenMutator
setOauthTokenMethods inherited from interface OauthTokenAccessor.OauthTokenProperty
letOauthTokenMethods inherited from interface Openable
openUncheckedMethods inherited from interface PostRestClient
buildPost, buildPost, buildPost, buildPost, buildPost, buildPost, buildPost, buildPost, buildPost, buildPost, buildPost, buildPost, buildPost, buildPost, buildPost, buildPost, buildPost, buildPost, buildPost, buildPost, buildPost, buildPost, buildPost, buildPost, buildPost, buildPost, buildPost, buildPost, buildPost, buildPost, buildPost, buildPost, buildPost, buildPost, buildPost, buildPost, buildPost, buildPost, buildPost, buildPost, buildPost, buildPost, doPost, doPost, doPost, doPost, doPost, doPost, doPost, doPost, doPost, doPost, doPost, doPost, doPost, doPost, doPost, doPost, doPost, doPost, doPost, doPost, doPost, doPost, doPost, doPost, doPost, doPost, doPost, doPost, doPost, doPost, doPost, doPost, doPost, doPost, doPost, doPost, doPost, doPost, doPost, doPost, doPost, doPost, doPost, doPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPost, onPostMethods inherited from interface PutRestClient
buildPut, buildPut, buildPut, buildPut, buildPut, buildPut, buildPut, buildPut, buildPut, buildPut, buildPut, buildPut, buildPut, buildPut, buildPut, buildPut, buildPut, buildPut, buildPut, buildPut, buildPut, buildPut, buildPut, buildPut, buildPut, buildPut, buildPut, buildPut, buildPut, buildPut, buildPut, buildPut, buildPut, buildPut, buildPut, buildPut, buildPut, buildPut, buildPut, buildPut, buildPut, buildPut, doPut, doPut, doPut, doPut, doPut, doPut, doPut, doPut, doPut, doPut, doPut, doPut, doPut, doPut, doPut, doPut, doPut, doPut, doPut, doPut, doPut, doPut, doPut, doPut, doPut, doPut, doPut, doPut, doPut, doPut, doPut, doPut, doPut, doPut, doPut, doPut, doPut, doPut, doPut, doPut, doPut, doPut, doPut, doPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPut, onPutMethods inherited from interface RestRequestClient
buildRequest, buildRequest, buildRequest, buildRequest, buildRequest, buildRequest, buildRequest, buildRequest, buildRequest, buildRequest, buildRequest, buildRequest, buildRequest, buildRequest, buildRequest, buildRequest, buildRequest, buildRequest, buildRequest, buildRequest, buildRequest, buildRequest, buildRequest, buildRequest, buildRequest, buildRequest, buildRequest, buildRequest, buildRequest, buildRequest, buildRequest, buildRequest, buildRequest, buildRequest, doRequest, doRequest, doRequest, doRequest, doRequest, doRequest, doRequest, doRequest, doRequest, doRequest, doRequest, doRequest, doRequest, doRequest, doRequest, doRequest, doRequest, doRequest, doRequest, doRequest, doRequest, doRequest, doRequest, doRequest, doRequest, doRequest, doRequest, doRequest, doRequest, doRequest, doRequest, doRequest, doRequest, doRequest, doRequest, doRequest, doRequest, doRequest, doRequest, doRequest, doRequest, doRequest, doRequest, doRequest, doRequest, doRequest, doRequest, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponse, onResponseMethods inherited from interface TrustStoreDescriptorAccessor.TrustStoreDescriptorProperty
letTrustStoreDescriptorMethods inherited from interface UserAgentAccessor
getUserAgentMethods inherited from interface UserAgentAccessor.UserAgentMutator
setUserAgentMethods inherited from interface UserAgentAccessor.UserAgentProperty
letUserAgent
-
Constructor Details
-
JdkHttpRestClient
public JdkHttpRestClient()Constructs aJdkHttpRestClient. UseHttpRestClient.open()or similar to activate it. -
JdkHttpRestClient
Constructs aJdkHttpRestClient. UseHttpRestClient.open()or similar to activate it.- Parameters:
aExecutorService- An executor service to be used when creatingThreads.
-
-
Method Details
-
close
- Specified by:
closein interfaceClosable- Throws:
IOException
-
getBaseUrl
- Specified by:
getBaseUrlin interfaceBaseUrlAccessor
-
getConnectionStatus
- Specified by:
getConnectionStatusin interfaceConnectionStatusAccessor
-
getTrustStoreDescriptor
- Specified by:
getTrustStoreDescriptorin interfaceTrustStoreDescriptorAccessor
-
open
Configures the HTTPS client connection with the provided configuration parameters.- Specified by:
openin interfaceHttpRestClient- Parameters:
aBaseUrl- The baseUrlto be used.aStoreDescriptor- TheTrustStoreDescriptorpointing to yourKeyStore.- Throws:
IOException- thrown in case something went wrong.
-
setBaseUrl
- Specified by:
setBaseUrlin interfaceBaseUrlAccessor.BaseUrlMutator
-
setBaseUrl
- Specified by:
setBaseUrlin interfaceBaseUrlAccessor.BaseUrlMutator
-
setTrustStoreDescriptor
- Specified by:
setTrustStoreDescriptorin interfaceTrustStoreDescriptorAccessor.TrustStoreDescriptorMutator
-
hasPreHttpInterceptor
- Specified by:
hasPreHttpInterceptorin interfacePreHttpInterceptable<PreHttpClientInterceptor>
-
addPreHttpInterceptor
- Specified by:
addPreHttpInterceptorin interfacePreHttpInterceptable<PreHttpClientInterceptor>
-
removePreHttpInterceptor
- Specified by:
removePreHttpInterceptorin interfacePreHttpInterceptable<PreHttpClientInterceptor>
-
hasPostHttpInterceptor
- Specified by:
hasPostHttpInterceptorin interfacePostHttpInterceptable<PostHttpClientInterceptor>
-
addPostHttpInterceptor
- Specified by:
addPostHttpInterceptorin interfacePostHttpInterceptable<PostHttpClientInterceptor>
-
removePostHttpInterceptor
- Specified by:
removePostHttpInterceptorin interfacePostHttpInterceptable<PostHttpClientInterceptor>
-
withOpen
Open the component's connection(s).- Specified by:
withOpenin interfaceHttpRestClient- Specified by:
withOpenin interfaceOpenable.OpenBuilder<HttpRestClient>- Returns:
- This instance as of the builder pattern.
- Throws:
IOException- Thrown in case opening or accessing an open line (connection, junction, link) caused problems.
-
withOpen
Opens the component with the given connection.- Specified by:
withOpenin interfaceHttpRestClient- Parameters:
aCtx- The context used for opening the connection.- Returns:
- This instance as of the builder pattern.
- Throws:
IOException- Thrown in case opening or accessing an open line (connection, junction, link) caused problems.
-
withOpen
Configures the HTTPS client connection with the provided configuration parameters.- Specified by:
withOpenin interfaceHttpRestClient- Parameters:
aStoreDescriptor- TheTrustStoreDescriptorpointing to yourKeyStore.- Returns:
- This instance as of the builder pattern.
- Throws:
IOException- thrown in case something went wrong.
-
withOpen
Configures the HTTPS client connection with the provided configuration parameters.- Specified by:
withOpenin interfaceHttpRestClient- Parameters:
aBaseUrl- The baseUrlto be used.- Returns:
- This instance as of the builder pattern.
- Throws:
IOException- thrown in case something went wrong.
-
withOpen
public JdkHttpRestClient withOpen(Url aBaseUrl, TrustStoreDescriptor aStoreDescriptor) throws IOException Configures the HTTPS client connection with the provided configuration parameters.- Specified by:
withOpenin interfaceHttpRestClient- Parameters:
aBaseUrl- The baseUrlto be used.aStoreDescriptor- TheTrustStoreDescriptorpointing to yourKeyStore.- Returns:
- This instance as of the builder pattern.
- Throws:
IOException- thrown in case something went wrong.
-
withBaseUrl
- Specified by:
withBaseUrlin interfaceBaseUrlAccessor.BaseUrlBuilder<HttpRestClient>- Specified by:
withBaseUrlin interfaceHttpRestClient- Throws:
MalformedURLException
-
withBaseUrl
- Specified by:
withBaseUrlin interfaceBaseUrlAccessor.BaseUrlBuilder<HttpRestClient>- Specified by:
withBaseUrlin interfaceHttpRestClient
-
withBaseUrl
- Specified by:
withBaseUrlin interfaceBaseUrlAccessor.BaseUrlBuilder<HttpRestClient>- Specified by:
withBaseUrlin interfaceHttpRestClient
-
withBasicAuthCredentials
- Specified by:
withBasicAuthCredentialsin interfaceBasicAuthCredentialsAccessor.BasicAuthCredentialsBuilder<RestClient>- Specified by:
withBasicAuthCredentialsin interfaceHttpRestClient
-
withBasicAuthCredentials
- Specified by:
withBasicAuthCredentialsin interfaceBasicAuthCredentialsAccessor.BasicAuthCredentialsBuilder<RestClient>- Specified by:
withBasicAuthCredentialsin interfaceHttpRestClient
-
withOAuthToken
- Specified by:
withOAuthTokenin interfaceHttpRestClient- Specified by:
withOAuthTokenin interfaceOauthTokenAccessor.OauthTokenBuilder<RestClient>
-
withTrustStoreDescriptor
- Specified by:
withTrustStoreDescriptorin interfaceHttpRestClient- Specified by:
withTrustStoreDescriptorin interfaceTrustStoreDescriptorAccessor.TrustStoreDescriptorBuilder<HttpRestClient>
-
withUserAgent
- Specified by:
withUserAgentin interfaceHttpRestClient- Specified by:
withUserAgentin interfaceUserAgentAccessor.UserAgentBuilder<RestClient>
-
withBaseUrl
- Specified by:
withBaseUrlin interfaceBaseUrlAccessor.BaseUrlBuilder<HttpRestClient>- Throws:
MalformedURLException
-
withBaseUrl
- Specified by:
withBaseUrlin interfaceBaseUrlAccessor.BaseUrlBuilder<HttpRestClient>- Throws:
MalformedURLException
-
withBaseUrl
public JdkHttpRestClient withBaseUrl(String aProtocol, String aHost, String aPath) throws MalformedURLException - Specified by:
withBaseUrlin interfaceBaseUrlAccessor.BaseUrlBuilder<HttpRestClient>- Throws:
MalformedURLException
-
withBaseUrl
public JdkHttpRestClient withBaseUrl(Scheme aScheme, String aHost, String aPath) throws MalformedURLException - Specified by:
withBaseUrlin interfaceBaseUrlAccessor.BaseUrlBuilder<HttpRestClient>- Throws:
MalformedURLException
-
withBaseUrl
public JdkHttpRestClient withBaseUrl(String aProtocol, String aHost, int aPort) throws MalformedURLException - Specified by:
withBaseUrlin interfaceBaseUrlAccessor.BaseUrlBuilder<HttpRestClient>- Throws:
MalformedURLException
-
withBaseUrl
public JdkHttpRestClient withBaseUrl(Scheme aScheme, String aHost, int aPort) throws MalformedURLException - Specified by:
withBaseUrlin interfaceBaseUrlAccessor.BaseUrlBuilder<HttpRestClient>- Throws:
MalformedURLException
-
withBaseUrl
public JdkHttpRestClient withBaseUrl(String aProtocol, String aHost, int aPort, String aPath) throws MalformedURLException - Specified by:
withBaseUrlin interfaceBaseUrlAccessor.BaseUrlBuilder<HttpRestClient>- Throws:
MalformedURLException
-
withBaseUrl
public JdkHttpRestClient withBaseUrl(Scheme aScheme, String aHost, int aPort, String aPath) throws MalformedURLException - Specified by:
withBaseUrlin interfaceBaseUrlAccessor.BaseUrlBuilder<HttpRestClient>- Throws:
MalformedURLException
-
withOpenUnchecked
- Specified by:
withOpenUncheckedin interfaceOpenable.OpenBuilder<HttpRestClient>
-
pipe
Pipes theInputStreamto theOutputStream.- Parameters:
aInputStream- TheInputStreamfrom which to pipe.aOutoutStream- TheOutputStreamto pipe to.- Throws:
IOException- Signals that an I/O exception has occurred.
-
preIntercept
Invoked to pre-process aHttpClientRequestalongside aHttpClientResponse.- Overrides:
preInterceptin classAbstractRestClient- Parameters:
aRequest- TheHttpClientRequestto pre-process.aResponse- TheHttpClientResponseto post-process.
-
postIntercept
Invoked to post-process aHttpClientRequestalongside aHttpClientResponse.- Overrides:
postInterceptin classAbstractRestClient- Parameters:
aRequest- TheHttpClientRequestto post-process.aResponse- TheHttpClientResponseto post-process.
-