Module org.refcodes.rest
Package org.refcodes.rest
Class AbstractHttpRestClientDecorator<B extends HttpRestClient>
java.lang.Object
org.refcodes.rest.AbstractHttpRestClientDecorator<B>
- 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<HttpRestClient>
,org.refcodes.component.OpenedAccessor
,HttpRestClient
,RestClient
,RestDeleteClient
,RestGetClient
,RestPostClient
,RestPutClient
,RestRequestClient
,RestRequestHandler
,org.refcodes.runtime.RequestCorrelation<RestClient>
,org.refcodes.runtime.SessionCorrelation<RestClient>
,org.refcodes.security.TrustStoreDescriptorAccessor
,org.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorBuilder<HttpRestClient>
,org.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorMutator
,org.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorProperty
,org.refcodes.web.BaseUrlAccessor
,org.refcodes.web.BaseUrlAccessor.BaseUrlBuilder<HttpRestClient>
,org.refcodes.web.BaseUrlAccessor.BaseUrlMutator
,org.refcodes.web.BaseUrlAccessor.BaseUrlProperty
,org.refcodes.web.BasicAuthCredentialsAccessor
,org.refcodes.web.BasicAuthCredentialsAccessor.BasicAuthCredentialsBuilder<RestClient>
,org.refcodes.web.BasicAuthCredentialsAccessor.BasicAuthCredentialsMutator
,org.refcodes.web.BasicAuthCredentialsAccessor.BasicAuthCredentialsProperty
,org.refcodes.web.MediaTypeFactoryLookup
,org.refcodes.web.MediaTypeFactoryLookup.MutableMediaTypeFactoryLookup
,org.refcodes.web.OauthTokenAccessor
,org.refcodes.web.OauthTokenAccessor.OauthTokenBuilder<RestClient>
,org.refcodes.web.OauthTokenAccessor.OauthTokenMutator
,org.refcodes.web.OauthTokenAccessor.OauthTokenProperty
,org.refcodes.web.UserAgentAccessor
,org.refcodes.web.UserAgentAccessor.UserAgentBuilder<RestClient>
,org.refcodes.web.UserAgentAccessor.UserAgentMutator
,org.refcodes.web.UserAgentAccessor.UserAgentProperty
- Direct Known Subclasses:
AbstractHttpDiscoveryRestClientDecorator
public abstract class AbstractHttpRestClientDecorator<B extends HttpRestClient>
extends Object
implements HttpRestClient
Abstract class for easily decorating a
HttpRestClient
.-
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.HttpRestClient
DEFAULT_KEYSTORE_TYPE, DEFAULT_SSL_PROTOCOL
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
addMediaTypeFactory
(org.refcodes.web.MediaTypeFactory aMediaTypeFactory) 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
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.void
void
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
boolean
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
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
setRequestCorrelation
(boolean hasRequestCorrelation) void
setSessionCorrelation
(boolean hasSessionCorrelation) 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) withRequestCorrelation
(boolean hasRequestCorrelation) withSessionCorrelation
(boolean hasSessionCorrelation) 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.rest.HttpRestClient
open, open, open, withBasicAuthCredentials, withBasicAuthCredentials, withOAuthToken, withOpen, withOpen, withOpen, withOpen, withOpen, withTrustStoreDescriptor
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.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
-
AbstractHttpRestClientDecorator
Decorates the givenHttpRestClient
.- Parameters:
aClient
- TheHttpRestClient
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
-
disableRequestCorrelation
public void disableRequestCorrelation()- Specified by:
disableRequestCorrelation
in interfaceorg.refcodes.runtime.RequestCorrelation<B extends HttpRestClient>
-
disableSessionCorrelation
public void disableSessionCorrelation()- Specified by:
disableSessionCorrelation
in interfaceorg.refcodes.runtime.SessionCorrelation<B extends HttpRestClient>
-
enableRequestCorrelation
public void enableRequestCorrelation()- Specified by:
enableRequestCorrelation
in interfaceorg.refcodes.runtime.RequestCorrelation<B extends HttpRestClient>
-
enableSessionCorrelation
public void enableSessionCorrelation()- Specified by:
enableSessionCorrelation
in interfaceorg.refcodes.runtime.SessionCorrelation<B extends HttpRestClient>
-
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
-
hasRequestCorrelation
public boolean hasRequestCorrelation()- Specified by:
hasRequestCorrelation
in interfaceorg.refcodes.runtime.RequestCorrelation<B extends HttpRestClient>
-
hasSessionCorrelation
public boolean hasSessionCorrelation()- Specified by:
hasSessionCorrelation
in interfaceorg.refcodes.runtime.SessionCorrelation<B extends HttpRestClient>
-
open
- Specified by:
open
in interfaceHttpRestClient
- Specified by:
open
in interfaceorg.refcodes.component.Openable
- 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 interfaceHttpRestClient
- 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
-
setRequestCorrelation
public void setRequestCorrelation(boolean hasRequestCorrelation) - Specified by:
setRequestCorrelation
in interfaceorg.refcodes.runtime.RequestCorrelation<B extends HttpRestClient>
-
setSessionCorrelation
public void setSessionCorrelation(boolean hasSessionCorrelation) - Specified by:
setSessionCorrelation
in interfaceorg.refcodes.runtime.SessionCorrelation<B extends HttpRestClient>
-
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 HttpRestClient>
- 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 HttpRestClient>
- 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 HttpRestClient>
- 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 HttpRestClient>
- Throws:
MalformedURLException
-
withBaseUrl
- Specified by:
withBaseUrl
in interfaceorg.refcodes.web.BaseUrlAccessor.BaseUrlBuilder<B extends HttpRestClient>
- Specified by:
withBaseUrl
in interfaceHttpRestClient
- Throws:
MalformedURLException
-
withBaseUrl
- Specified by:
withBaseUrl
in interfaceorg.refcodes.web.BaseUrlAccessor.BaseUrlBuilder<B extends HttpRestClient>
- Throws:
MalformedURLException
-
withBaseUrl
- Specified by:
withBaseUrl
in interfaceorg.refcodes.web.BaseUrlAccessor.BaseUrlBuilder<B extends HttpRestClient>
- 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 HttpRestClient>
- Throws:
MalformedURLException
-
withBaseUrl
- Specified by:
withBaseUrl
in interfaceorg.refcodes.web.BaseUrlAccessor.BaseUrlBuilder<B extends HttpRestClient>
- Throws:
MalformedURLException
-
withBaseUrl
- Specified by:
withBaseUrl
in interfaceorg.refcodes.web.BaseUrlAccessor.BaseUrlBuilder<B extends HttpRestClient>
- Specified by:
withBaseUrl
in interfaceHttpRestClient
-
withBaseUrl
- Specified by:
withBaseUrl
in interfaceorg.refcodes.web.BaseUrlAccessor.BaseUrlBuilder<B extends HttpRestClient>
- Specified by:
withBaseUrl
in interfaceHttpRestClient
-
withDisableRequestCorrelation
- Specified by:
withDisableRequestCorrelation
in interfaceHttpRestClient
- Specified by:
withDisableRequestCorrelation
in interfaceorg.refcodes.runtime.RequestCorrelation<B extends HttpRestClient>
-
withDisableSessionCorrelation
- Specified by:
withDisableSessionCorrelation
in interfaceHttpRestClient
- Specified by:
withDisableSessionCorrelation
in interfaceorg.refcodes.runtime.SessionCorrelation<B extends HttpRestClient>
-
withEnableRequestCorrelation
- Specified by:
withEnableRequestCorrelation
in interfaceHttpRestClient
- Specified by:
withEnableRequestCorrelation
in interfaceorg.refcodes.runtime.RequestCorrelation<B extends HttpRestClient>
-
withEnableSessionCorrelation
- Specified by:
withEnableSessionCorrelation
in interfaceHttpRestClient
- Specified by:
withEnableSessionCorrelation
in interfaceorg.refcodes.runtime.SessionCorrelation<B extends HttpRestClient>
-
withRequestCorrelation
- Specified by:
withRequestCorrelation
in interfaceHttpRestClient
- Specified by:
withRequestCorrelation
in interfaceorg.refcodes.runtime.RequestCorrelation<B extends HttpRestClient>
-
withSessionCorrelation
- Specified by:
withSessionCorrelation
in interfaceHttpRestClient
- Specified by:
withSessionCorrelation
in interfaceorg.refcodes.runtime.SessionCorrelation<B extends HttpRestClient>
-
withUserAgent
- Specified by:
withUserAgent
in interfaceHttpRestClient
- Specified by:
withUserAgent
in interfaceorg.refcodes.web.UserAgentAccessor.UserAgentBuilder<B extends HttpRestClient>
-
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.
-
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.
-