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<B>
,org.refcodes.component.ConnectionOpenable<B>
,org.refcodes.component.ConnectionStatusAccessor
,org.refcodes.component.LinkComponent
,org.refcodes.component.Openable
,org.refcodes.net.BaseUrlAccessor
,org.refcodes.net.BaseUrlAccessor.BaseUrlBuilder<B>
,org.refcodes.net.BaseUrlAccessor.BaseUrlMutator
,org.refcodes.net.BaseUrlAccessor.BaseUrlProperty
,org.refcodes.net.MediaTypeFactoryLookup
,org.refcodes.net.MediaTypeFactoryLookup.MutableMediaTypeFactoryLookup
,org.refcodes.net.OauthTokenAccessor
,org.refcodes.net.OauthTokenAccessor.OauthTokenBuilder<B>
,org.refcodes.net.OauthTokenAccessor.OauthTokenMutator
,org.refcodes.net.OauthTokenAccessor.OauthTokenProperty
,org.refcodes.net.UserAgentAccessor
,org.refcodes.net.UserAgentAccessor.UserAgentBuilder<B>
,org.refcodes.net.UserAgentAccessor.UserAgentMutator
,org.refcodes.net.UserAgentAccessor.UserAgentProperty
,HttpRestClient
,RestClient
,RestDeleteClient
,RestGetClient
,RestPostClient
,RestPutClient
,RestRequestClient
,org.refcodes.runtime.RequestCorrelation<B>
,org.refcodes.runtime.SessionCorrelation<B>
,org.refcodes.security.TrustStoreDescriptorAccessor
,org.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorBuilder<B>
,org.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorMutator
,org.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorProperty
- Direct Known Subclasses:
AbstractHttpDiscoveryRestClientDecorator
public abstract class AbstractHttpRestClientDecorator<B extends HttpRestClient> extends Object implements HttpRestClient
Abstract class for easily decorating aHttpRestClient
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.refcodes.net.BaseUrlAccessor
org.refcodes.net.BaseUrlAccessor.BaseUrlBuilder<B extends org.refcodes.net.BaseUrlAccessor.BaseUrlBuilder<B>>, org.refcodes.net.BaseUrlAccessor.BaseUrlMutator, org.refcodes.net.BaseUrlAccessor.BaseUrlProperty
-
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.net.MediaTypeFactoryLookup
org.refcodes.net.MediaTypeFactoryLookup.MutableMediaTypeFactoryLookup
-
Nested classes/interfaces inherited from interface org.refcodes.net.OauthTokenAccessor
org.refcodes.net.OauthTokenAccessor.OauthTokenBuilder<B extends org.refcodes.net.OauthTokenAccessor.OauthTokenBuilder<B>>, org.refcodes.net.OauthTokenAccessor.OauthTokenMutator, org.refcodes.net.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.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.net.UserAgentAccessor
org.refcodes.net.UserAgentAccessor.UserAgentBuilder<B extends org.refcodes.net.UserAgentAccessor.UserAgentBuilder<B>>, org.refcodes.net.UserAgentAccessor.UserAgentMutator, org.refcodes.net.UserAgentAccessor.UserAgentProperty
-
-
Field Summary
-
Fields inherited from interface org.refcodes.rest.HttpRestClient
DEFAULT_KEYSTORE_TYPE, DEFAULT_SSL_PROTOCOL
-
-
Constructor Summary
Constructors Constructor Description AbstractHttpRestClientDecorator(HttpRestClient aClient)
Decorates the givenHttpRestClient
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addMediaTypeFactory(org.refcodes.net.MediaTypeFactory aMediaTypeFactory)
RestRequestBuilder
buildRequest(org.refcodes.net.HttpMethod aHttpMethod, org.refcodes.net.Url aUrl, org.refcodes.net.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 aCloseInMillis)
void
closeQuietly()
void
closeUnchecked()
void
disableRequestCorrelation()
void
disableSessionCorrelation()
RestResponse
doRequest(org.refcodes.net.HttpMethod aHttpMethod, org.refcodes.net.Url aUrl, org.refcodes.net.RequestHeaderFields aHeaderFields, Object aRequest, int aRedirectDepth)
Sends a request with the possible attributes and returns the according request'sRestResponse
instance synchronously.RestCallerBuilder
doRequest(org.refcodes.net.HttpMethod aHttpMethod, org.refcodes.net.Url aUrl, org.refcodes.net.RequestHeaderFields aHeaderFields, Object aRequest, int aRedirectDepth, RestResponseObserver aResponseObserver)
Creates a request with the possible attributes and returns the accordingRestCallerBuilder
instance used for the request.void
enableRequestCorrelation()
void
enableSessionCorrelation()
org.refcodes.net.Url
getBaseUrl()
org.refcodes.component.ConnectionStatus
getConnectionStatus()
org.refcodes.net.MediaType[]
getFactoryMediaTypes()
org.refcodes.net.OauthToken
getOauthToken()
org.refcodes.security.TrustStoreDescriptor
getTrustStoreDescriptor()
String
getUserAgent()
boolean
hasMediaTypeFactory(org.refcodes.net.MediaType aMediaType)
boolean
hasRequestCorrelation()
boolean
hasSessionCorrelation()
void
open()
void
open(org.refcodes.net.Url aBaseUrl, org.refcodes.security.TrustStoreDescriptor aStoreDescriptor)
Configures the HTTPS client connection with the provided configuration parameters.void
openUnchecked()
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.net.Url aBaseUrl)
void
setOauthToken(org.refcodes.net.OauthToken aOauthToken)
void
setRequestCorrelation(boolean hasRequestCorrelation)
void
setSessionCorrelation(boolean hasSessionCorrelation)
void
setTrustStoreDescriptor(org.refcodes.security.TrustStoreDescriptor aStoreDescriptor)
void
setUserAgent(String aUserAgent)
org.refcodes.net.MediaTypeFactory
toMediaTypeFactory(org.refcodes.net.MediaType aMediaType)
protected org.refcodes.net.Url
toUrl(org.refcodes.net.Url aUrl)
Hook for sub-classes to modify the request URL.B
withBaseUrl(String aBaseUrl)
B
withBaseUrl(String aProtocol, String aHost)
B
withBaseUrl(String aProtocol, String aHost, int aPort)
B
withBaseUrl(String aProtocol, String aHost, int aPort, String aPath)
B
withBaseUrl(String aProtocol, String aHost, String aPath)
B
withBaseUrl(URL aBaseURL)
B
withBaseUrl(org.refcodes.data.Scheme aProtocol, String aHost)
B
withBaseUrl(org.refcodes.data.Scheme aProtocol, String aHost, int aPort)
B
withBaseUrl(org.refcodes.data.Scheme aProtocol, String aHost, int aPort, String aPath)
B
withBaseUrl(org.refcodes.data.Scheme aProtocol, String aHost, String aPath)
B
withBaseUrl(org.refcodes.net.Url aBaseUrl)
B
withDisableRequestCorrelation()
B
withDisableSessionCorrelation()
B
withEnableRequestCorrelation()
B
withEnableSessionCorrelation()
B
withRequestCorrelation(boolean hasRequestCorrelation)
B
withSessionCorrelation(boolean hasSessionCorrelation)
B
withUserAgent(String aUserAgent)
-
Methods inherited from interface org.refcodes.rest.HttpRestClient
open, open, open, withTrustStoreDescriptor
-
Methods inherited from interface org.refcodes.net.OauthTokenAccessor.OauthTokenBuilder
withOAuthToken
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
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, 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
-
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, 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
-
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, 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
-
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, 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
-
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, 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
-
-
-
-
Constructor Detail
-
AbstractHttpRestClientDecorator
public AbstractHttpRestClientDecorator(HttpRestClient aClient)
Decorates the givenHttpRestClient
.- Parameters:
aClient
- TheHttpRestClient
to be decorated.
-
-
Method Detail
-
getOauthToken
public org.refcodes.net.OauthToken getOauthToken()
- Specified by:
getOauthToken
in interfaceorg.refcodes.net.OauthTokenAccessor
-
setOauthToken
public void setOauthToken(org.refcodes.net.OauthToken aOauthToken)
- Specified by:
setOauthToken
in interfaceorg.refcodes.net.OauthTokenAccessor.OauthTokenMutator
-
getConnectionStatus
public org.refcodes.component.ConnectionStatus getConnectionStatus()
- Specified by:
getConnectionStatus
in interfaceorg.refcodes.component.ConnectionStatusAccessor
-
addMediaTypeFactory
public boolean addMediaTypeFactory(org.refcodes.net.MediaTypeFactory aMediaTypeFactory)
- Specified by:
addMediaTypeFactory
in interfaceorg.refcodes.net.MediaTypeFactoryLookup.MutableMediaTypeFactoryLookup
-
close
public void close() throws org.refcodes.component.CloseException
- Specified by:
close
in interfaceorg.refcodes.component.Closable
- Throws:
org.refcodes.component.CloseException
-
closeIn
public void closeIn(int aCloseInMillis)
- 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.net.Url getBaseUrl()
- Specified by:
getBaseUrl
in interfaceorg.refcodes.net.BaseUrlAccessor
-
getFactoryMediaTypes
public org.refcodes.net.MediaType[] getFactoryMediaTypes()
- Specified by:
getFactoryMediaTypes
in interfaceorg.refcodes.net.MediaTypeFactoryLookup
-
getTrustStoreDescriptor
public org.refcodes.security.TrustStoreDescriptor getTrustStoreDescriptor()
- Specified by:
getTrustStoreDescriptor
in interfaceorg.refcodes.security.TrustStoreDescriptorAccessor
-
getUserAgent
public String getUserAgent()
- Specified by:
getUserAgent
in interfaceorg.refcodes.net.UserAgentAccessor
-
hasMediaTypeFactory
public boolean hasMediaTypeFactory(org.refcodes.net.MediaType aMediaType)
- Specified by:
hasMediaTypeFactory
in interfaceorg.refcodes.net.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
public void open() throws org.refcodes.component.OpenException
- Specified by:
open
in interfaceHttpRestClient
- Specified by:
open
in interfaceorg.refcodes.component.Openable
- Throws:
org.refcodes.component.OpenException
-
open
public void open(org.refcodes.net.Url aBaseUrl, org.refcodes.security.TrustStoreDescriptor aStoreDescriptor) throws org.refcodes.component.OpenException
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:
org.refcodes.component.OpenException
- 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.net.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.net.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.net.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.net.BaseUrlAccessor.BaseUrlMutator
- Throws:
MalformedURLException
-
setBaseUrl
public void setBaseUrl(String aBaseUrl) throws MalformedURLException
- Specified by:
setBaseUrl
in interfaceorg.refcodes.net.BaseUrlAccessor.BaseUrlMutator
- Throws:
MalformedURLException
-
setBaseUrl
public void setBaseUrl(String aProtocol, String aHost) throws MalformedURLException
- Specified by:
setBaseUrl
in interfaceorg.refcodes.net.BaseUrlAccessor.BaseUrlMutator
- Throws:
MalformedURLException
-
setBaseUrl
public void setBaseUrl(String aProtocol, String aHost, int aPort) throws MalformedURLException
- Specified by:
setBaseUrl
in interfaceorg.refcodes.net.BaseUrlAccessor.BaseUrlMutator
- Throws:
MalformedURLException
-
setBaseUrl
public void setBaseUrl(String aProtocol, String aHost, int aPort, String aPath) throws MalformedURLException
- Specified by:
setBaseUrl
in interfaceorg.refcodes.net.BaseUrlAccessor.BaseUrlMutator
- Throws:
MalformedURLException
-
setBaseUrl
public void setBaseUrl(String aProtocol, String aHost, String aPath) throws MalformedURLException
- Specified by:
setBaseUrl
in interfaceorg.refcodes.net.BaseUrlAccessor.BaseUrlMutator
- Throws:
MalformedURLException
-
setBaseUrl
public void setBaseUrl(org.refcodes.net.Url aBaseUrl)
- Specified by:
setBaseUrl
in interfaceorg.refcodes.net.BaseUrlAccessor.BaseUrlMutator
-
setBaseUrl
public void setBaseUrl(URL aBaseUrl)
- Specified by:
setBaseUrl
in interfaceorg.refcodes.net.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 aStoreDescriptor)
- Specified by:
setTrustStoreDescriptor
in interfaceorg.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorMutator
-
setUserAgent
public void setUserAgent(String aUserAgent)
- Specified by:
setUserAgent
in interfaceorg.refcodes.net.UserAgentAccessor.UserAgentMutator
-
toMediaTypeFactory
public org.refcodes.net.MediaTypeFactory toMediaTypeFactory(org.refcodes.net.MediaType aMediaType)
- Specified by:
toMediaTypeFactory
in interfaceorg.refcodes.net.MediaTypeFactoryLookup
-
withBaseUrl
public B withBaseUrl(org.refcodes.data.Scheme aProtocol, String aHost) throws MalformedURLException
- Specified by:
withBaseUrl
in interfaceorg.refcodes.net.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.net.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.net.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.net.BaseUrlAccessor.BaseUrlBuilder<B extends HttpRestClient>
- Throws:
MalformedURLException
-
withBaseUrl
public B withBaseUrl(String aBaseUrl) throws MalformedURLException
- Specified by:
withBaseUrl
in interfaceorg.refcodes.net.BaseUrlAccessor.BaseUrlBuilder<B extends HttpRestClient>
- Throws:
MalformedURLException
-
withBaseUrl
public B withBaseUrl(String aProtocol, String aHost) throws MalformedURLException
- Specified by:
withBaseUrl
in interfaceorg.refcodes.net.BaseUrlAccessor.BaseUrlBuilder<B extends HttpRestClient>
- Throws:
MalformedURLException
-
withBaseUrl
public B withBaseUrl(String aProtocol, String aHost, int aPort) throws MalformedURLException
- Specified by:
withBaseUrl
in interfaceorg.refcodes.net.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.net.BaseUrlAccessor.BaseUrlBuilder<B extends HttpRestClient>
- Throws:
MalformedURLException
-
withBaseUrl
public B withBaseUrl(String aProtocol, String aHost, String aPath) throws MalformedURLException
- Specified by:
withBaseUrl
in interfaceorg.refcodes.net.BaseUrlAccessor.BaseUrlBuilder<B extends HttpRestClient>
- Throws:
MalformedURLException
-
withBaseUrl
public B withBaseUrl(org.refcodes.net.Url aBaseUrl)
- Specified by:
withBaseUrl
in interfaceorg.refcodes.net.BaseUrlAccessor.BaseUrlBuilder<B extends HttpRestClient>
-
withBaseUrl
public B withBaseUrl(URL aBaseURL)
- Specified by:
withBaseUrl
in interfaceorg.refcodes.net.BaseUrlAccessor.BaseUrlBuilder<B extends HttpRestClient>
-
withDisableRequestCorrelation
public B withDisableRequestCorrelation()
- Specified by:
withDisableRequestCorrelation
in interfaceHttpRestClient
- Specified by:
withDisableRequestCorrelation
in interfaceorg.refcodes.runtime.RequestCorrelation<B extends HttpRestClient>
- Specified by:
withDisableRequestCorrelation
in interfaceRestClient
-
withDisableSessionCorrelation
public B withDisableSessionCorrelation()
- Specified by:
withDisableSessionCorrelation
in interfaceHttpRestClient
- Specified by:
withDisableSessionCorrelation
in interfaceRestClient
- Specified by:
withDisableSessionCorrelation
in interfaceorg.refcodes.runtime.SessionCorrelation<B extends HttpRestClient>
-
withEnableRequestCorrelation
public B withEnableRequestCorrelation()
- Specified by:
withEnableRequestCorrelation
in interfaceHttpRestClient
- Specified by:
withEnableRequestCorrelation
in interfaceorg.refcodes.runtime.RequestCorrelation<B extends HttpRestClient>
- Specified by:
withEnableRequestCorrelation
in interfaceRestClient
-
withEnableSessionCorrelation
public B withEnableSessionCorrelation()
- Specified by:
withEnableSessionCorrelation
in interfaceHttpRestClient
- Specified by:
withEnableSessionCorrelation
in interfaceRestClient
- Specified by:
withEnableSessionCorrelation
in interfaceorg.refcodes.runtime.SessionCorrelation<B extends HttpRestClient>
-
withRequestCorrelation
public B withRequestCorrelation(boolean hasRequestCorrelation)
- Specified by:
withRequestCorrelation
in interfaceHttpRestClient
- Specified by:
withRequestCorrelation
in interfaceorg.refcodes.runtime.RequestCorrelation<B extends HttpRestClient>
- Specified by:
withRequestCorrelation
in interfaceRestClient
-
withSessionCorrelation
public B withSessionCorrelation(boolean hasSessionCorrelation)
- Specified by:
withSessionCorrelation
in interfaceHttpRestClient
- Specified by:
withSessionCorrelation
in interfaceRestClient
- Specified by:
withSessionCorrelation
in interfaceorg.refcodes.runtime.SessionCorrelation<B extends HttpRestClient>
-
withUserAgent
public B withUserAgent(String aUserAgent)
- Specified by:
withUserAgent
in interfaceHttpRestClient
- Specified by:
withUserAgent
in interfaceRestClient
- Specified by:
withUserAgent
in interfaceorg.refcodes.net.UserAgentAccessor.UserAgentBuilder<B extends HttpRestClient>
-
buildRequest
public RestRequestBuilder buildRequest(org.refcodes.net.HttpMethod aHttpMethod, org.refcodes.net.Url aUrl, org.refcodes.net.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.net.HttpMethod aHttpMethod, org.refcodes.net.Url aUrl, org.refcodes.net.RequestHeaderFields aHeaderFields, Object aRequest, int aRedirectDepth) throws org.refcodes.net.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.net.HttpResponseException
- thrown in case of some unexpected response.
-
doRequest
public RestCallerBuilder doRequest(org.refcodes.net.HttpMethod aHttpMethod, org.refcodes.net.Url aUrl, org.refcodes.net.RequestHeaderFields aHeaderFields, Object aRequest, int aRedirectDepth, RestResponseObserver aResponseObserver)
Creates a request with the possible attributes and returns the accordingRestCallerBuilder
instance used for the request. The HTTP-Request is actually sent not earlier than you callingOpenable.open()
on the returnedRestCallerBuilder
as theRestCallerBuilder
still may be modified after invoking this method!- 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.aResponseObserver
- The listener processing a response targeted at thisRestCallerBuilder
.- Returns:
- The
RestCallerBuilder
which is used by the request.
-
toUrl
protected org.refcodes.net.Url toUrl(org.refcodes.net.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.
-
-