Module org.refcodes.rest
Package org.refcodes.rest
Class AbstractRestfulHttpClientDecorator<B extends RestfulHttpClient>
java.lang.Object
org.refcodes.rest.AbstractRestfulHttpClientDecorator<B>
- Type Parameters:
B
- the generic type
- 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:
AbstractRestfulHttpDiscoveryClientDecorator
public abstract class AbstractRestfulHttpClientDecorator<B extends RestfulHttpClient>
extends Object
implements RestfulHttpClient
Abstract class for easily decorating a
RestfulHttpClient
.-
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
-
Method Summary
Modifier and TypeMethodDescriptionboolean
addMediaTypeFactory
(org.refcodes.web.MediaTypeFactory aMediaTypeFactory) boolean
addPostHttpInterceptor
(org.refcodes.web.PostHttpClientInterceptor aPostInterceptor) boolean
addPreHttpInterceptor
(org.refcodes.web.PreHttpClientInterceptor aPreInterceptor) buildRequest
(org.refcodes.web.HttpMethod aHttpMethod, org.refcodes.web.Url aUrl, org.refcodes.web.RequestHeaderFields aHeaderFields, Object aRequest, int aRedirectDepth) Prepares a request builder with the possible attributes and returns the according request'sRestRequestBuilder
instance.void
close()
void
closeIn
(int aCloseMillis) void
void
doRequest
(org.refcodes.web.HttpMethod aHttpMethod, org.refcodes.web.Url aUrl, org.refcodes.web.RequestHeaderFields aHeaderFields, Object aRequest, int aRedirectDepth) Sends a request with the possible attributes and returns the according request'sRestResponse
instance synchronously.org.refcodes.web.Url
org.refcodes.component.ConnectionStatus
org.refcodes.web.MediaType[]
org.refcodes.web.OauthToken
org.refcodes.security.TrustStoreDescriptor
boolean
hasMediaTypeFactory
(org.refcodes.web.MediaType aMediaType) boolean
hasPostHttpInterceptor
(org.refcodes.web.PostHttpClientInterceptor aPostInterceptor) boolean
hasPreHttpInterceptor
(org.refcodes.web.PreHttpClientInterceptor aPreInterceptor) onResponse
(org.refcodes.web.HttpMethod aHttpMethod, org.refcodes.web.Url aUrl, org.refcodes.web.RequestHeaderFields aHeaderFields, Object aRequest, int aRedirectDepth) Creates a request with the possible attributes and returns the accordingRestResponseResult
instance used for the request.onResponse
(org.refcodes.web.HttpMethod aHttpMethod, org.refcodes.web.Url aUrl, org.refcodes.web.RequestHeaderFields aHeaderFields, Object aRequest, int aRedirectDepth, RestResponseConsumer aResponseConsumer) Creates a request with the possible attributes and returns the accordingRestResponseHandler
instance used for the request.void
open()
void
open
(org.refcodes.web.Url aBaseUrl, org.refcodes.security.TrustStoreDescriptor aStoreDescriptor) Configures the HTTPS client connection with the provided configuration parameters.void
boolean
removePostHttpInterceptor
(org.refcodes.web.PostHttpClientInterceptor aPostInterceptor) boolean
removePreHttpInterceptor
(org.refcodes.web.PreHttpClientInterceptor aPreInterceptor) void
setBaseUrl
(String aBaseUrl) void
setBaseUrl
(String aProtocol, String aHost) void
setBaseUrl
(String aProtocol, String aHost, int aPort) void
setBaseUrl
(String aProtocol, String aHost, int aPort, String aPath) void
setBaseUrl
(String aProtocol, String aHost, String aPath) void
setBaseUrl
(URL aBaseUrl) void
setBaseUrl
(org.refcodes.data.Scheme aProtocol, String aHost) void
setBaseUrl
(org.refcodes.data.Scheme aProtocol, String aHost, int aPort) void
setBaseUrl
(org.refcodes.data.Scheme aProtocol, String aHost, int aPort, String aPath) void
setBaseUrl
(org.refcodes.data.Scheme aProtocol, String aHost, String aPath) void
setBaseUrl
(org.refcodes.web.Url aBaseUrl) void
setOauthToken
(org.refcodes.web.OauthToken aOauthToken) void
setTrustStoreDescriptor
(org.refcodes.security.TrustStoreDescriptor aTrustStoreDescriptor) void
setUserAgent
(String aUserAgent) org.refcodes.web.MediaTypeFactory
toMediaTypeFactory
(org.refcodes.web.MediaType aMediaType) protected org.refcodes.web.Url
toUrl
(org.refcodes.web.Url aUrl) Hook for sub-classes to modify the request URL.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 aProtocol, String aHost) withBaseUrl
(org.refcodes.data.Scheme aProtocol, String aHost, int aPort) withBaseUrl
(org.refcodes.data.Scheme aProtocol, String aHost, int aPort, String aPath) withBaseUrl
(org.refcodes.data.Scheme aProtocol, String aHost, String aPath) withBaseUrl
(org.refcodes.web.Url aBaseUrl) withUserAgent
(String aUserAgent) 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.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.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.OauthTokenAccessor.OauthTokenProperty
letOauthToken
Methods inherited from interface org.refcodes.component.Openable.OpenBuilder
withOpenUnchecked
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, withBasicAuthCredentials, withBasicAuthCredentials, withOAuthToken, withOpen, withOpen, withOpen, withOpen, withOpen, withTrustStoreDescriptor
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, 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
Methods inherited from interface org.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorProperty
letTrustStoreDescriptor
Methods inherited from interface org.refcodes.web.UserAgentAccessor.UserAgentProperty
letUserAgent
-
Field Details
-
_client
-
-
Constructor Details
-
AbstractRestfulHttpClientDecorator
Decorates the givenRestfulHttpClient
.- Parameters:
aClient
- TheRestfulHttpClient
to be decorated.
-
-
Method Details
-
getOauthToken
public org.refcodes.web.OauthToken getOauthToken()- Specified by:
getOauthToken
in interfaceorg.refcodes.web.OauthTokenAccessor
-
setOauthToken
public void setOauthToken(org.refcodes.web.OauthToken aOauthToken) - Specified by:
setOauthToken
in interfaceorg.refcodes.web.OauthTokenAccessor.OauthTokenMutator
-
getConnectionStatus
public org.refcodes.component.ConnectionStatus getConnectionStatus()- Specified by:
getConnectionStatus
in interfaceorg.refcodes.component.ConnectionStatusAccessor
-
addMediaTypeFactory
public boolean addMediaTypeFactory(org.refcodes.web.MediaTypeFactory aMediaTypeFactory) - Specified by:
addMediaTypeFactory
in interfaceorg.refcodes.web.MediaTypeFactoryLookup.MutableMediaTypeFactoryLookup
-
close
- Specified by:
close
in interfaceorg.refcodes.component.Closable
- Throws:
IOException
-
closeIn
public void closeIn(int aCloseMillis) - Specified by:
closeIn
in interfaceorg.refcodes.component.Closable
-
closeQuietly
public void closeQuietly()- Specified by:
closeQuietly
in interfaceorg.refcodes.component.Closable
-
closeUnchecked
public void closeUnchecked()- Specified by:
closeUnchecked
in interfaceorg.refcodes.component.Closable
-
getBaseUrl
public org.refcodes.web.Url getBaseUrl()- Specified by:
getBaseUrl
in interfaceorg.refcodes.web.BaseUrlAccessor
-
getFactoryMediaTypes
public org.refcodes.web.MediaType[] getFactoryMediaTypes()- Specified by:
getFactoryMediaTypes
in interfaceorg.refcodes.web.MediaTypeFactoryLookup
-
getTrustStoreDescriptor
public org.refcodes.security.TrustStoreDescriptor getTrustStoreDescriptor()- Specified by:
getTrustStoreDescriptor
in interfaceorg.refcodes.security.TrustStoreDescriptorAccessor
-
getUserAgent
- Specified by:
getUserAgent
in interfaceorg.refcodes.web.UserAgentAccessor
-
hasMediaTypeFactory
public boolean hasMediaTypeFactory(org.refcodes.web.MediaType aMediaType) - Specified by:
hasMediaTypeFactory
in interfaceorg.refcodes.web.MediaTypeFactoryLookup
-
open
- Specified by:
open
in interfaceorg.refcodes.component.Openable
- Specified by:
open
in interfaceRestfulHttpClient
- Throws:
IOException
-
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.
-
openUnchecked
public void openUnchecked()- Specified by:
openUnchecked
in interfaceorg.refcodes.component.Openable
-
setBaseUrl
public void setBaseUrl(org.refcodes.data.Scheme aProtocol, String aHost) throws MalformedURLException - Specified by:
setBaseUrl
in interfaceorg.refcodes.web.BaseUrlAccessor.BaseUrlMutator
- Throws:
MalformedURLException
-
setBaseUrl
public void setBaseUrl(org.refcodes.data.Scheme aProtocol, String aHost, int aPort) throws MalformedURLException - Specified by:
setBaseUrl
in interfaceorg.refcodes.web.BaseUrlAccessor.BaseUrlMutator
- Throws:
MalformedURLException
-
setBaseUrl
public void setBaseUrl(org.refcodes.data.Scheme aProtocol, String aHost, int aPort, String aPath) throws MalformedURLException - Specified by:
setBaseUrl
in interfaceorg.refcodes.web.BaseUrlAccessor.BaseUrlMutator
- Throws:
MalformedURLException
-
setBaseUrl
public void setBaseUrl(org.refcodes.data.Scheme aProtocol, String aHost, String aPath) throws MalformedURLException - Specified by:
setBaseUrl
in interfaceorg.refcodes.web.BaseUrlAccessor.BaseUrlMutator
- Throws:
MalformedURLException
-
setBaseUrl
- Specified by:
setBaseUrl
in interfaceorg.refcodes.web.BaseUrlAccessor.BaseUrlMutator
- Throws:
MalformedURLException
-
setBaseUrl
- Specified by:
setBaseUrl
in interfaceorg.refcodes.web.BaseUrlAccessor.BaseUrlMutator
- Throws:
MalformedURLException
-
setBaseUrl
- Specified by:
setBaseUrl
in interfaceorg.refcodes.web.BaseUrlAccessor.BaseUrlMutator
- Throws:
MalformedURLException
-
setBaseUrl
public void setBaseUrl(String aProtocol, String aHost, int aPort, String aPath) throws MalformedURLException - Specified by:
setBaseUrl
in interfaceorg.refcodes.web.BaseUrlAccessor.BaseUrlMutator
- Throws:
MalformedURLException
-
setBaseUrl
- Specified by:
setBaseUrl
in interfaceorg.refcodes.web.BaseUrlAccessor.BaseUrlMutator
- Throws:
MalformedURLException
-
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
-
setUserAgent
- Specified by:
setUserAgent
in interfaceorg.refcodes.web.UserAgentAccessor.UserAgentMutator
-
toMediaTypeFactory
public org.refcodes.web.MediaTypeFactory toMediaTypeFactory(org.refcodes.web.MediaType aMediaType) - Specified by:
toMediaTypeFactory
in interfaceorg.refcodes.web.MediaTypeFactoryLookup
-
withBaseUrl
- Specified by:
withBaseUrl
in interfaceorg.refcodes.web.BaseUrlAccessor.BaseUrlBuilder<B extends RestfulHttpClient>
- Throws:
MalformedURLException
-
withBaseUrl
public B withBaseUrl(org.refcodes.data.Scheme aProtocol, String aHost, int aPort) throws MalformedURLException - Specified by:
withBaseUrl
in interfaceorg.refcodes.web.BaseUrlAccessor.BaseUrlBuilder<B extends RestfulHttpClient>
- Throws:
MalformedURLException
-
withBaseUrl
public B withBaseUrl(org.refcodes.data.Scheme aProtocol, String aHost, int aPort, String aPath) throws MalformedURLException - Specified by:
withBaseUrl
in interfaceorg.refcodes.web.BaseUrlAccessor.BaseUrlBuilder<B extends RestfulHttpClient>
- Throws:
MalformedURLException
-
withBaseUrl
public B withBaseUrl(org.refcodes.data.Scheme aProtocol, String aHost, String aPath) throws MalformedURLException - Specified by:
withBaseUrl
in interfaceorg.refcodes.web.BaseUrlAccessor.BaseUrlBuilder<B extends RestfulHttpClient>
- Throws:
MalformedURLException
-
withBaseUrl
- Specified by:
withBaseUrl
in interfaceorg.refcodes.web.BaseUrlAccessor.BaseUrlBuilder<B extends RestfulHttpClient>
- Specified by:
withBaseUrl
in interfaceRestfulHttpClient
- Throws:
MalformedURLException
-
withBaseUrl
- Specified by:
withBaseUrl
in interfaceorg.refcodes.web.BaseUrlAccessor.BaseUrlBuilder<B extends RestfulHttpClient>
- Throws:
MalformedURLException
-
withBaseUrl
- Specified by:
withBaseUrl
in interfaceorg.refcodes.web.BaseUrlAccessor.BaseUrlBuilder<B extends RestfulHttpClient>
- Throws:
MalformedURLException
-
withBaseUrl
public B withBaseUrl(String aProtocol, String aHost, int aPort, String aPath) throws MalformedURLException - Specified by:
withBaseUrl
in interfaceorg.refcodes.web.BaseUrlAccessor.BaseUrlBuilder<B extends RestfulHttpClient>
- Throws:
MalformedURLException
-
withBaseUrl
- Specified by:
withBaseUrl
in interfaceorg.refcodes.web.BaseUrlAccessor.BaseUrlBuilder<B extends RestfulHttpClient>
- Throws:
MalformedURLException
-
withBaseUrl
- Specified by:
withBaseUrl
in interfaceorg.refcodes.web.BaseUrlAccessor.BaseUrlBuilder<B extends RestfulHttpClient>
- Specified by:
withBaseUrl
in interfaceRestfulHttpClient
-
withBaseUrl
- Specified by:
withBaseUrl
in interfaceorg.refcodes.web.BaseUrlAccessor.BaseUrlBuilder<B extends RestfulHttpClient>
- Specified by:
withBaseUrl
in interfaceRestfulHttpClient
-
withUserAgent
- Specified by:
withUserAgent
in interfaceRestfulHttpClient
- Specified by:
withUserAgent
in interfaceorg.refcodes.web.UserAgentAccessor.UserAgentBuilder<B extends RestfulHttpClient>
-
buildRequest
public RestRequestBuilder buildRequest(org.refcodes.web.HttpMethod aHttpMethod, org.refcodes.web.Url aUrl, org.refcodes.web.RequestHeaderFields aHeaderFields, Object aRequest, int aRedirectDepth) Prepares a request builder with the possible attributes and returns the according request'sRestRequestBuilder
instance. InvokingRestRequestBuilder.toRestResponse()
starts the request and synchronously returns the response.- Specified by:
buildRequest
in interfaceRestRequestClient
- Parameters:
aHttpMethod
- The HTTP-Method for the request.aUrl
- TheUrl
from which to take the URL specific data.aHeaderFields
- The HTTP-Header's fields to be used for the request.aRequest
- The body to be sent with the request (e.g. when doing aHttpMethod.POST
request.aRedirectDepth
- The number of redirect ping-pong cycles to follow before when issuing the HTTP-Request.- Returns:
- The
RestRequestBuilder
at this request.
-
doRequest
public RestResponse doRequest(org.refcodes.web.HttpMethod aHttpMethod, org.refcodes.web.Url aUrl, org.refcodes.web.RequestHeaderFields aHeaderFields, Object aRequest, int aRedirectDepth) throws org.refcodes.web.HttpResponseException Sends a request with the possible attributes and returns the according request'sRestResponse
instance synchronously.- Specified by:
doRequest
in interfaceRestRequestClient
- Parameters:
aHttpMethod
- The HTTP-Method for the request.aUrl
- TheUrl
from which to take the URL specific data.aHeaderFields
- The HTTP-Header's fields to be used for the request.aRequest
- The body to be sent with the request (e.g. when doing aHttpMethod.POST
request.aRedirectDepth
- The redirect depth provides the count of HTTP-Request and HTTP-Response cycles where the response represents a redirect as ofHttpStatusCode.isRedirectStatus()
. A value of -1 represents the default behavior, e.g. usingHttpURLConnection
's redirection means.- Returns:
- The
RestResponse
for this request. - Throws:
org.refcodes.web.HttpResponseException
- thrown in case of some unexpected response.
-
onResponse
public RestResponseHandler onResponse(org.refcodes.web.HttpMethod aHttpMethod, org.refcodes.web.Url aUrl, org.refcodes.web.RequestHeaderFields aHeaderFields, Object aRequest, int aRedirectDepth, RestResponseConsumer aResponseConsumer) Creates a request with the possible attributes and returns the accordingRestResponseHandler
instance used for the request. The HTTP-Request is actually sent not earlier than you callingRestResponseHandler.open()
on the returnedRestResponseHandler
as theRestResponseHandler
still may be modified after invoking this method!- Specified by:
onResponse
in interfaceRestRequestClient
- Parameters:
aHttpMethod
- The HTTP-Method for the request.aUrl
- TheUrl
from which to take the URL specific data.aHeaderFields
- The HTTP-Header's fields to be used for the request.aRequest
- The body to be sent with the request (e.g. when doing aHttpMethod.POST
request.aRedirectDepth
- The redirect depth provides the count of HTTP-Request and HTTP-Response cycles where the response represents a redirect as ofHttpStatusCode.isRedirectStatus()
. A value of -1 represents the default behavior, e.g. usingHttpURLConnection
's redirection means.aResponseConsumer
- The listener processing a response targeted at thisRestResponseHandler
.- Returns:
- The
RestResponseHandler
which is used by the request.
-
onResponse
public RestResponseResult onResponse(org.refcodes.web.HttpMethod aHttpMethod, org.refcodes.web.Url aUrl, org.refcodes.web.RequestHeaderFields aHeaderFields, Object aRequest, int aRedirectDepth) Creates a request with the possible attributes and returns the accordingRestResponseResult
instance used for the request. The HTTP-Request is actually sent not earlier than you callingRestResponseResult.open()
on the returnedRestResponseResult
as theRestResponseResult
still may be modified after invoking this method!- Specified by:
onResponse
in interfaceRestRequestClient
- Parameters:
aHttpMethod
- The HTTP-Method for the request.aUrl
- TheUrl
from which to take the URL specific data.aHeaderFields
- The HTTP-Header's fields to be used for the request.aRequest
- The body to be sent with the request (e.g. when doing aHttpMethod.POST
request.aRedirectDepth
- The redirect depth provides the count of HTTP-Request and HTTP-Response cycles where the response represents a redirect as ofHttpStatusCode.isRedirectStatus()
. A value of -1 represents the default behavior, e.g. usingHttpURLConnection
's redirection means.- Returns:
- The
RestResponseResult
which is used by the request.
-
hasPreHttpInterceptor
public boolean hasPreHttpInterceptor(org.refcodes.web.PreHttpClientInterceptor aPreInterceptor) - Specified by:
hasPreHttpInterceptor
in interfaceorg.refcodes.web.PreHttpInterceptable<B extends RestfulHttpClient>
-
addPreHttpInterceptor
public boolean addPreHttpInterceptor(org.refcodes.web.PreHttpClientInterceptor aPreInterceptor) - Specified by:
addPreHttpInterceptor
in interfaceorg.refcodes.web.PreHttpInterceptable<B extends RestfulHttpClient>
-
removePreHttpInterceptor
public boolean removePreHttpInterceptor(org.refcodes.web.PreHttpClientInterceptor aPreInterceptor) - Specified by:
removePreHttpInterceptor
in interfaceorg.refcodes.web.PreHttpInterceptable<B extends RestfulHttpClient>
-
hasPostHttpInterceptor
public boolean hasPostHttpInterceptor(org.refcodes.web.PostHttpClientInterceptor aPostInterceptor) - Specified by:
hasPostHttpInterceptor
in interfaceorg.refcodes.web.PostHttpInterceptable<B extends RestfulHttpClient>
-
addPostHttpInterceptor
public boolean addPostHttpInterceptor(org.refcodes.web.PostHttpClientInterceptor aPostInterceptor) - Specified by:
addPostHttpInterceptor
in interfaceorg.refcodes.web.PostHttpInterceptable<B extends RestfulHttpClient>
-
removePostHttpInterceptor
public boolean removePostHttpInterceptor(org.refcodes.web.PostHttpClientInterceptor aPostInterceptor) - Specified by:
removePostHttpInterceptor
in interfaceorg.refcodes.web.PostHttpInterceptable<B extends RestfulHttpClient>
-
toUrl
protected org.refcodes.web.Url toUrl(org.refcodes.web.Url aUrl) Hook for sub-classes to modify the request URL.- Parameters:
aUrl
- TheUrl
for the request.- Returns:
- The tinkered
Url
, by default it returns the providedUrl
unmodified.
-