java.lang.Object
org.refcodes.rest.AbstractRestfulClient
org.refcodes.rest.HttpRestClient
- All Implemented Interfaces:
org.refcodes.component.Closable
,org.refcodes.component.ConnectionComponent<org.refcodes.web.HttpClientContext>
,org.refcodes.component.ConnectionOpenable<org.refcodes.web.HttpClientContext>
,org.refcodes.component.ConnectionStatusAccessor
,org.refcodes.component.LinkComponent
,org.refcodes.component.Openable
,org.refcodes.component.Openable.OpenBuilder<RestfulHttpClient>
,org.refcodes.component.OpenedAccessor
,RestDeleteClient
,RestfulClient
,RestfulHttpClient
,RestGetClient
,RestPostClient
,RestPutClient
,RestRequestClient
,RestRequestHandler
,org.refcodes.security.TrustStoreDescriptorAccessor
,org.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorBuilder<RestfulHttpClient>
,org.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorMutator
,org.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorProperty
,org.refcodes.web.BaseUrlAccessor
,org.refcodes.web.BaseUrlAccessor.BaseUrlBuilder<RestfulHttpClient>
,org.refcodes.web.BaseUrlAccessor.BaseUrlMutator
,org.refcodes.web.BaseUrlAccessor.BaseUrlProperty
,org.refcodes.web.BasicAuthCredentialsAccessor
,org.refcodes.web.BasicAuthCredentialsAccessor.BasicAuthCredentialsBuilder<RestfulClient>
,org.refcodes.web.BasicAuthCredentialsAccessor.BasicAuthCredentialsMutator
,org.refcodes.web.BasicAuthCredentialsAccessor.BasicAuthCredentialsProperty
,org.refcodes.web.HttpClientInterceptable
,org.refcodes.web.MediaTypeFactoryLookup
,org.refcodes.web.MediaTypeFactoryLookup.MutableMediaTypeFactoryLookup
,org.refcodes.web.OauthTokenAccessor
,org.refcodes.web.OauthTokenAccessor.OauthTokenBuilder<RestfulClient>
,org.refcodes.web.OauthTokenAccessor.OauthTokenMutator
,org.refcodes.web.OauthTokenAccessor.OauthTokenProperty
,org.refcodes.web.PostHttpClientInterceptable
,org.refcodes.web.PostHttpInterceptable<org.refcodes.web.PostHttpClientInterceptor>
,org.refcodes.web.PreHttpClientInterceptable
,org.refcodes.web.PreHttpInterceptable<org.refcodes.web.PreHttpClientInterceptor>
,org.refcodes.web.UserAgentAccessor
,org.refcodes.web.UserAgentAccessor.UserAgentBuilder<RestfulClient>
,org.refcodes.web.UserAgentAccessor.UserAgentMutator
,org.refcodes.web.UserAgentAccessor.UserAgentProperty
- Direct Known Subclasses:
HttpRestClientSingleton
The
HttpRestClient
implements the RestfulHttpClient
interface. The HttpRestClient
is being initialized with some common
MediaTypeFactory
instances (as implemented by the
AbstractRestfulClient
). At the time of writing this document the
MediaTypeFactory
instances being preconfigured are:
JsonMediaTypeFactory
XmlMediaTypeFactory
TextMediaTypeFactory
FormMediaTypeFactory
HtmlMediaTypeFactory
HttpRestClient
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 org.refcodes.web.BaseUrlAccessor
org.refcodes.web.BaseUrlAccessor.BaseUrlBuilder<B extends org.refcodes.web.BaseUrlAccessor.BaseUrlBuilder<B>>, org.refcodes.web.BaseUrlAccessor.BaseUrlMutator, org.refcodes.web.BaseUrlAccessor.BaseUrlProperty
Nested classes/interfaces inherited from interface org.refcodes.web.BasicAuthCredentialsAccessor
org.refcodes.web.BasicAuthCredentialsAccessor.BasicAuthCredentialsBuilder<B extends org.refcodes.web.BasicAuthCredentialsAccessor.BasicAuthCredentialsBuilder<B>>, org.refcodes.web.BasicAuthCredentialsAccessor.BasicAuthCredentialsMutator, org.refcodes.web.BasicAuthCredentialsAccessor.BasicAuthCredentialsProperty
Nested classes/interfaces inherited from interface org.refcodes.component.Closable
org.refcodes.component.Closable.CloseAutomaton, org.refcodes.component.Closable.CloseBuilder<B extends org.refcodes.component.Closable.CloseBuilder<B>>
Nested classes/interfaces inherited from interface org.refcodes.component.ConnectionComponent
org.refcodes.component.ConnectionComponent.ConnectionAutomaton<CON extends Object>, org.refcodes.component.ConnectionComponent.ConnectionComponentBuilder<CON extends Object,
B extends org.refcodes.component.ConnectionComponent.ConnectionComponentBuilder<CON, B>> Nested classes/interfaces inherited from interface org.refcodes.component.ConnectionOpenable
org.refcodes.component.ConnectionOpenable.ConnectionOpenAutomaton<CON extends Object>, org.refcodes.component.ConnectionOpenable.ConnectionOpenBuilder<CON extends Object,
B extends org.refcodes.component.ConnectionOpenable.ConnectionOpenBuilder<CON, B>> Nested classes/interfaces inherited from interface org.refcodes.component.ConnectionStatusAccessor
org.refcodes.component.ConnectionStatusAccessor.ConnectionStatusMutator, org.refcodes.component.ConnectionStatusAccessor.ConnectionStatusProperty
Nested classes/interfaces inherited from interface org.refcodes.component.LinkComponent
org.refcodes.component.LinkComponent.LinkAutomaton, org.refcodes.component.LinkComponent.LinkComponentBuilder<B extends org.refcodes.component.LinkComponent.LinkComponentBuilder<B>>
Nested classes/interfaces inherited from interface org.refcodes.web.MediaTypeFactoryLookup
org.refcodes.web.MediaTypeFactoryLookup.MutableMediaTypeFactoryLookup
Nested classes/interfaces inherited from interface org.refcodes.web.OauthTokenAccessor
org.refcodes.web.OauthTokenAccessor.OauthTokenBuilder<B extends org.refcodes.web.OauthTokenAccessor.OauthTokenBuilder<B>>, org.refcodes.web.OauthTokenAccessor.OauthTokenMutator, org.refcodes.web.OauthTokenAccessor.OauthTokenProperty
Nested classes/interfaces inherited from interface org.refcodes.component.Openable
org.refcodes.component.Openable.OpenAutomaton, org.refcodes.component.Openable.OpenBuilder<B extends org.refcodes.component.Openable.OpenBuilder<B>>
Nested classes/interfaces inherited from interface org.refcodes.component.OpenedAccessor
org.refcodes.component.OpenedAccessor.OpenedMutator, org.refcodes.component.OpenedAccessor.OpenedProperty
Nested classes/interfaces inherited from interface org.refcodes.security.TrustStoreDescriptorAccessor
org.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorBuilder<B extends org.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorBuilder<B>>, org.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorMutator, org.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorProperty
Nested classes/interfaces inherited from interface org.refcodes.web.UserAgentAccessor
org.refcodes.web.UserAgentAccessor.UserAgentBuilder<B extends org.refcodes.web.UserAgentAccessor.UserAgentBuilder<B>>, org.refcodes.web.UserAgentAccessor.UserAgentMutator, org.refcodes.web.UserAgentAccessor.UserAgentProperty
-
Field Summary
Fields inherited from interface org.refcodes.rest.RestfulHttpClient
DEFAULT_KEYSTORE_TYPE, DEFAULT_SSL_PROTOCOL
-
Constructor Summary
ConstructorDescriptionConstructs aHttpRestClient
.HttpRestClient
(ExecutorService aExecutorService) Constructs aHttpRestClient
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
addPostHttpInterceptor
(org.refcodes.web.PostHttpClientInterceptor aPostInterceptor) boolean
addPreHttpInterceptor
(org.refcodes.web.PreHttpClientInterceptor aPreInterceptor) void
close()
org.refcodes.web.Url
org.refcodes.component.ConnectionStatus
org.refcodes.security.TrustStoreDescriptor
boolean
hasPostHttpInterceptor
(org.refcodes.web.PostHttpClientInterceptor aPostInterceptor) boolean
hasPreHttpInterceptor
(org.refcodes.web.PreHttpClientInterceptor aPreInterceptor) void
open
(org.refcodes.web.Url aBaseUrl, org.refcodes.security.TrustStoreDescriptor aStoreDescriptor) Configures the HTTPS client connection with the provided configuration parameters.protected static void
pipe
(InputStream aInputStream, OutputStream aOutoutStream) Pipes theInputStream
to theOutputStream
.protected void
postIntercept
(org.refcodes.web.HttpClientRequest aRequest, org.refcodes.web.HttpClientResponse aResponse) Invoked to post-process aHttpClientRequest
alongside aHttpClientResponse
.protected void
preIntercept
(org.refcodes.web.HttpClientRequest aRequest, org.refcodes.web.HttpClientResponse aResponse) Invoked to pre-process aHttpClientRequest
alongside aHttpClientResponse
.boolean
removePostHttpInterceptor
(org.refcodes.web.PostHttpClientInterceptor aPostInterceptor) boolean
removePreHttpInterceptor
(org.refcodes.web.PreHttpClientInterceptor aPreInterceptor) void
setBaseUrl
(URL aBaseUrl) void
setBaseUrl
(org.refcodes.web.Url aBaseUrl) void
setTrustStoreDescriptor
(org.refcodes.security.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
(org.refcodes.data.Scheme aScheme, String aHost) withBaseUrl
(org.refcodes.data.Scheme aScheme, String aHost, int aPort) withBaseUrl
(org.refcodes.data.Scheme aScheme, String aHost, int aPort, String aPath) withBaseUrl
(org.refcodes.data.Scheme aScheme, String aHost, String aPath) withBaseUrl
(org.refcodes.web.Url aBaseUrl) withBasicAuthCredentials
(String aUserName, String aSecret) withBasicAuthCredentials
(org.refcodes.web.BasicAuthCredentials aBasicAuthCredentials) withOAuthToken
(org.refcodes.web.OauthToken aOauthToken) withOpen()
Open the component's connection(s).withOpen
(org.refcodes.security.TrustStoreDescriptor aStoreDescriptor) Configures the HTTPS client connection with the provided configuration parameters.withOpen
(org.refcodes.web.HttpClientContext aCtx) Opens the component with the given connection.withOpen
(org.refcodes.web.Url aBaseUrl) Configures the HTTPS client connection with the provided configuration parameters.withOpen
(org.refcodes.web.Url aBaseUrl, org.refcodes.security.TrustStoreDescriptor aStoreDescriptor) Configures the HTTPS client connection with the provided configuration parameters.withTrustStoreDescriptor
(org.refcodes.security.TrustStoreDescriptor aStoreDescriptor) withUserAgent
(String aUserAgent) Methods inherited from class org.refcodes.rest.AbstractRestfulClient
addMediaTypeFactory, buildRequest, doRequest, getBasicAuthCredentials, getFactoryMediaTypes, getOauthToken, getUserAgent, initMedaTypeFactories, onResponse, onResponse, onRestRequest, preProcessHeaderFields, setBasicAuthCredentials, setOauthToken, setUserAgent, toMediaTypeFactory
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.refcodes.web.BaseUrlAccessor.BaseUrlMutator
setBaseUrl, setBaseUrl, setBaseUrl, setBaseUrl, setBaseUrl, setBaseUrl, setBaseUrl, setBaseUrl, setBaseUrl
Methods inherited from interface org.refcodes.web.BaseUrlAccessor.BaseUrlProperty
letBaseUrl, letBaseUrl, letBaseUrl, letBaseUrl, letBaseUrl, letBaseUrl, letBaseUrl, letBaseUrl, letBaseUrl, letBaseUrl, letBaseUrl
Methods inherited from interface org.refcodes.web.BasicAuthCredentialsAccessor
getBasicAuthCredentials
Methods inherited from interface org.refcodes.web.BasicAuthCredentialsAccessor.BasicAuthCredentialsMutator
setBasicAuthCredentials, setBasicAuthCredentials
Methods inherited from interface org.refcodes.web.BasicAuthCredentialsAccessor.BasicAuthCredentialsProperty
letBasicAuthCredentials, letBasicAuthCredentials
Methods inherited from interface org.refcodes.component.Closable
closeIn, closeQuietly, closeUnchecked
Methods inherited from interface org.refcodes.component.ConnectionOpenable
openUnchecked
Methods inherited from interface org.refcodes.component.ConnectionStatusAccessor
isOpened
Methods inherited from interface org.refcodes.web.HttpClientInterceptable
addHttpInterceptor, hasHttpInterceptor, removeHttpInterceptor
Methods inherited from interface org.refcodes.web.MediaTypeFactoryLookup
getFactoryMediaTypes, hasMediaTypeFactory, toMediaTypeFactory
Methods inherited from interface org.refcodes.web.MediaTypeFactoryLookup.MutableMediaTypeFactoryLookup
addMediaTypeFactory
Methods inherited from interface org.refcodes.web.OauthTokenAccessor
getOauthToken
Methods inherited from interface org.refcodes.web.OauthTokenAccessor.OauthTokenMutator
setOauthToken
Methods inherited from interface org.refcodes.web.OauthTokenAccessor.OauthTokenProperty
letOauthToken
Methods inherited from interface org.refcodes.component.Openable
openUnchecked
Methods inherited from interface org.refcodes.rest.RestDeleteClient
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, onDelete
Methods inherited from interface org.refcodes.rest.RestfulHttpClient
open, open, open, open
Methods inherited from interface org.refcodes.rest.RestGetClient
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, onGet
Methods inherited from interface org.refcodes.rest.RestPostClient
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, onPost
Methods inherited from interface org.refcodes.rest.RestPutClient
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, onPut
Methods inherited from interface org.refcodes.rest.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, onResponse
Methods inherited from interface org.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorProperty
letTrustStoreDescriptor
Methods inherited from interface org.refcodes.web.UserAgentAccessor
getUserAgent
Methods inherited from interface org.refcodes.web.UserAgentAccessor.UserAgentMutator
setUserAgent
Methods inherited from interface org.refcodes.web.UserAgentAccessor.UserAgentProperty
letUserAgent
-
Constructor Details
-
HttpRestClient
public HttpRestClient()Constructs aHttpRestClient
. UseRestfulHttpClient.open()
or similar to activate it. -
HttpRestClient
Constructs aHttpRestClient
. UseRestfulHttpClient.open()
or similar to activate it.- Parameters:
aExecutorService
- An executor service to be used when creatingThread
s.
-
-
Method Details
-
close
- Specified by:
close
in interfaceorg.refcodes.component.Closable
- Throws:
IOException
-
getBaseUrl
public org.refcodes.web.Url getBaseUrl()- Specified by:
getBaseUrl
in interfaceorg.refcodes.web.BaseUrlAccessor
-
getConnectionStatus
public org.refcodes.component.ConnectionStatus getConnectionStatus()- Specified by:
getConnectionStatus
in interfaceorg.refcodes.component.ConnectionStatusAccessor
-
getTrustStoreDescriptor
public org.refcodes.security.TrustStoreDescriptor getTrustStoreDescriptor()- Specified by:
getTrustStoreDescriptor
in interfaceorg.refcodes.security.TrustStoreDescriptorAccessor
-
open
public void open(org.refcodes.web.Url aBaseUrl, org.refcodes.security.TrustStoreDescriptor aStoreDescriptor) throws IOException Configures the HTTPS client connection with the provided configuration parameters.- Specified by:
open
in interfaceRestfulHttpClient
- Parameters:
aBaseUrl
- The baseUrl
to be used.aStoreDescriptor
- TheTrustStoreDescriptor
pointing to yourKeyStore
.- Throws:
IOException
- thrown in case something went wrong.
-
setBaseUrl
public void setBaseUrl(org.refcodes.web.Url aBaseUrl) - Specified by:
setBaseUrl
in interfaceorg.refcodes.web.BaseUrlAccessor.BaseUrlMutator
-
setBaseUrl
- Specified by:
setBaseUrl
in interfaceorg.refcodes.web.BaseUrlAccessor.BaseUrlMutator
-
setTrustStoreDescriptor
public void setTrustStoreDescriptor(org.refcodes.security.TrustStoreDescriptor aTrustStoreDescriptor) - Specified by:
setTrustStoreDescriptor
in interfaceorg.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorMutator
-
hasPreHttpInterceptor
public boolean hasPreHttpInterceptor(org.refcodes.web.PreHttpClientInterceptor aPreInterceptor) - Specified by:
hasPreHttpInterceptor
in interfaceorg.refcodes.web.PreHttpInterceptable<org.refcodes.web.PreHttpClientInterceptor>
-
addPreHttpInterceptor
public boolean addPreHttpInterceptor(org.refcodes.web.PreHttpClientInterceptor aPreInterceptor) - Specified by:
addPreHttpInterceptor
in interfaceorg.refcodes.web.PreHttpInterceptable<org.refcodes.web.PreHttpClientInterceptor>
-
removePreHttpInterceptor
public boolean removePreHttpInterceptor(org.refcodes.web.PreHttpClientInterceptor aPreInterceptor) - Specified by:
removePreHttpInterceptor
in interfaceorg.refcodes.web.PreHttpInterceptable<org.refcodes.web.PreHttpClientInterceptor>
-
hasPostHttpInterceptor
public boolean hasPostHttpInterceptor(org.refcodes.web.PostHttpClientInterceptor aPostInterceptor) - Specified by:
hasPostHttpInterceptor
in interfaceorg.refcodes.web.PostHttpInterceptable<org.refcodes.web.PostHttpClientInterceptor>
-
addPostHttpInterceptor
public boolean addPostHttpInterceptor(org.refcodes.web.PostHttpClientInterceptor aPostInterceptor) - Specified by:
addPostHttpInterceptor
in interfaceorg.refcodes.web.PostHttpInterceptable<org.refcodes.web.PostHttpClientInterceptor>
-
removePostHttpInterceptor
public boolean removePostHttpInterceptor(org.refcodes.web.PostHttpClientInterceptor aPostInterceptor) - Specified by:
removePostHttpInterceptor
in interfaceorg.refcodes.web.PostHttpInterceptable<org.refcodes.web.PostHttpClientInterceptor>
-
withOpen
Open the component's connection(s).- Specified by:
withOpen
in interfaceorg.refcodes.component.Openable.OpenBuilder<RestfulHttpClient>
- Specified by:
withOpen
in interfaceRestfulHttpClient
- 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:
withOpen
in interfaceRestfulHttpClient
- 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
public HttpRestClient withOpen(org.refcodes.security.TrustStoreDescriptor aStoreDescriptor) throws IOException Configures the HTTPS client connection with the provided configuration parameters.- Specified by:
withOpen
in interfaceRestfulHttpClient
- Parameters:
aStoreDescriptor
- TheTrustStoreDescriptor
pointing 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:
withOpen
in interfaceRestfulHttpClient
- Parameters:
aBaseUrl
- The baseUrl
to be used.- Returns:
- This instance as of the builder pattern.
- Throws:
IOException
- thrown in case something went wrong.
-
withOpen
public HttpRestClient withOpen(org.refcodes.web.Url aBaseUrl, org.refcodes.security.TrustStoreDescriptor aStoreDescriptor) throws IOException Configures the HTTPS client connection with the provided configuration parameters.- Specified by:
withOpen
in interfaceRestfulHttpClient
- Parameters:
aBaseUrl
- The baseUrl
to be used.aStoreDescriptor
- TheTrustStoreDescriptor
pointing to yourKeyStore
.- Returns:
- This instance as of the builder pattern.
- Throws:
IOException
- thrown in case something went wrong.
-
withBaseUrl
- Specified by:
withBaseUrl
in interfaceorg.refcodes.web.BaseUrlAccessor.BaseUrlBuilder<RestfulHttpClient>
- Specified by:
withBaseUrl
in interfaceRestfulHttpClient
- Throws:
MalformedURLException
-
withBaseUrl
- Specified by:
withBaseUrl
in interfaceorg.refcodes.web.BaseUrlAccessor.BaseUrlBuilder<RestfulHttpClient>
- Specified by:
withBaseUrl
in interfaceRestfulHttpClient
-
withBaseUrl
- Specified by:
withBaseUrl
in interfaceorg.refcodes.web.BaseUrlAccessor.BaseUrlBuilder<RestfulHttpClient>
- Specified by:
withBaseUrl
in interfaceRestfulHttpClient
-
withBasicAuthCredentials
public HttpRestClient withBasicAuthCredentials(org.refcodes.web.BasicAuthCredentials aBasicAuthCredentials) - Specified by:
withBasicAuthCredentials
in interfaceorg.refcodes.web.BasicAuthCredentialsAccessor.BasicAuthCredentialsBuilder<RestfulClient>
- Specified by:
withBasicAuthCredentials
in interfaceRestfulHttpClient
-
withBasicAuthCredentials
- Specified by:
withBasicAuthCredentials
in interfaceorg.refcodes.web.BasicAuthCredentialsAccessor.BasicAuthCredentialsBuilder<RestfulClient>
- Specified by:
withBasicAuthCredentials
in interfaceRestfulHttpClient
-
withOAuthToken
- Specified by:
withOAuthToken
in interfaceorg.refcodes.web.OauthTokenAccessor.OauthTokenBuilder<RestfulClient>
- Specified by:
withOAuthToken
in interfaceRestfulHttpClient
-
withTrustStoreDescriptor
public HttpRestClient withTrustStoreDescriptor(org.refcodes.security.TrustStoreDescriptor aStoreDescriptor) - Specified by:
withTrustStoreDescriptor
in interfaceRestfulHttpClient
- Specified by:
withTrustStoreDescriptor
in interfaceorg.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorBuilder<RestfulHttpClient>
-
withUserAgent
- Specified by:
withUserAgent
in interfaceRestfulHttpClient
- Specified by:
withUserAgent
in interfaceorg.refcodes.web.UserAgentAccessor.UserAgentBuilder<RestfulClient>
-
withBaseUrl
- Specified by:
withBaseUrl
in interfaceorg.refcodes.web.BaseUrlAccessor.BaseUrlBuilder<RestfulHttpClient>
- Throws:
MalformedURLException
-
withBaseUrl
public HttpRestClient withBaseUrl(org.refcodes.data.Scheme aScheme, String aHost) throws MalformedURLException - Specified by:
withBaseUrl
in interfaceorg.refcodes.web.BaseUrlAccessor.BaseUrlBuilder<RestfulHttpClient>
- Throws:
MalformedURLException
-
withBaseUrl
public HttpRestClient withBaseUrl(String aProtocol, String aHost, String aPath) throws MalformedURLException - Specified by:
withBaseUrl
in interfaceorg.refcodes.web.BaseUrlAccessor.BaseUrlBuilder<RestfulHttpClient>
- Throws:
MalformedURLException
-
withBaseUrl
public HttpRestClient withBaseUrl(org.refcodes.data.Scheme aScheme, String aHost, String aPath) throws MalformedURLException - Specified by:
withBaseUrl
in interfaceorg.refcodes.web.BaseUrlAccessor.BaseUrlBuilder<RestfulHttpClient>
- Throws:
MalformedURLException
-
withBaseUrl
public HttpRestClient withBaseUrl(String aProtocol, String aHost, int aPort) throws MalformedURLException - Specified by:
withBaseUrl
in interfaceorg.refcodes.web.BaseUrlAccessor.BaseUrlBuilder<RestfulHttpClient>
- Throws:
MalformedURLException
-
withBaseUrl
public HttpRestClient withBaseUrl(org.refcodes.data.Scheme aScheme, String aHost, int aPort) throws MalformedURLException - Specified by:
withBaseUrl
in interfaceorg.refcodes.web.BaseUrlAccessor.BaseUrlBuilder<RestfulHttpClient>
- Throws:
MalformedURLException
-
withBaseUrl
public HttpRestClient withBaseUrl(String aProtocol, String aHost, int aPort, String aPath) throws MalformedURLException - Specified by:
withBaseUrl
in interfaceorg.refcodes.web.BaseUrlAccessor.BaseUrlBuilder<RestfulHttpClient>
- Throws:
MalformedURLException
-
withBaseUrl
public HttpRestClient withBaseUrl(org.refcodes.data.Scheme aScheme, String aHost, int aPort, String aPath) throws MalformedURLException - Specified by:
withBaseUrl
in interfaceorg.refcodes.web.BaseUrlAccessor.BaseUrlBuilder<RestfulHttpClient>
- Throws:
MalformedURLException
-
withOpenUnchecked
- Specified by:
withOpenUnchecked
in interfaceorg.refcodes.component.Openable.OpenBuilder<RestfulHttpClient>
-
pipe
Pipes theInputStream
to theOutputStream
.- Parameters:
aInputStream
- TheInputStream
from which to pipe.aOutoutStream
- TheOutputStream
to pipe to.- Throws:
IOException
- Signals that an I/O exception has occurred.
-
preIntercept
protected void preIntercept(org.refcodes.web.HttpClientRequest aRequest, org.refcodes.web.HttpClientResponse aResponse) Invoked to pre-process aHttpClientRequest
alongside aHttpClientResponse
.- Overrides:
preIntercept
in classAbstractRestfulClient
- Parameters:
aRequest
- TheHttpClientRequest
to pre-process.aResponse
- TheHttpClientResponse
to post-process.
-
postIntercept
protected void postIntercept(org.refcodes.web.HttpClientRequest aRequest, org.refcodes.web.HttpClientResponse aResponse) Invoked to post-process aHttpClientRequest
alongside aHttpClientResponse
.- Overrides:
postIntercept
in classAbstractRestfulClient
- Parameters:
aRequest
- TheHttpClientRequest
to post-process.aResponse
- TheHttpClientResponse
to post-process.
-