java.lang.Object
org.refcodes.rest.AbstractRestClient
- All Implemented Interfaces:
RestClient
,RestDeleteClient
,RestGetClient
,RestPostClient
,RestPutClient
,RestRequestClient
,RestRequestHandler
,org.refcodes.runtime.RequestCorrelation<RestClient>
,org.refcodes.runtime.SessionCorrelation<RestClient>
,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:
HttpRestClientImpl
,LoopbackRestClientImpl
Abstract base implementation of the
RestClient
interface being the
foundation for various RestClient
implementations such as
HttpRestClientImpl
or LoopbackRestClientImpl
. The
AbstractRestClient
is preconfigured with the following
MediaTypeFactory
instances:
JsonMediaTypeFactory
XmlMediaTypeFactory
TextMediaTypeFactory
FormMediaTypeFactory
HtmlMediaTypeFactory
initMedaTypeFactories()
,
therein calling addMediaTypeFactory(MediaTypeFactory)
to add (by
also invoking super's initMedaTypeFactories()
) or to set your own
(without invoking super's initMedaTypeFactories()
)
MediaTypeFactory
instances.-
Nested Class Summary
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.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.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
Modifier and TypeFieldDescriptionprotected boolean
protected boolean
-
Constructor Summary
ConstructorDescriptionInstantiates a new abstract rest client.AbstractRestClient
(ExecutorService aExecutorService) Instantiates a new abstract rest client. -
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.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.protected void
doRequestCorrelation
(org.refcodes.web.RequestHeaderFields aRequestHeaderFields) Do request correlation.protected void
doRequestCorrelation
(org.refcodes.web.ResponseHeaderFields aResponseHeaderFields) Do request correlation.protected void
doSessionCorrelation
(org.refcodes.web.RequestHeaderFields aRequestHeaderFields) Do session correlation.protected void
doSessionCorrelation
(org.refcodes.web.ResponseHeaderFields aResponseHeaderFields) Do session correlation.org.refcodes.web.BasicAuthCredentials
org.refcodes.web.MediaType[]
org.refcodes.web.OauthToken
boolean
boolean
protected void
Adds the defaultMediaTypeFactory
instances.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.protected void
onRestRequest
(RestRequestHandler aHandler) Sets the hook receiving a preparedRestResponseHandler
instance to be used to do the technical request with the technology chosen by the implementing sub-class.protected org.refcodes.web.RequestHeaderFields
preProcessHeaderFields
(org.refcodes.web.RequestHeaderFields aHeaderFields) Pre-processes the given header fields before the HTTP-Request is issued.void
setBasicAuthCredentials
(org.refcodes.web.BasicAuthCredentials aBasicAuthCredentials) void
setOauthToken
(org.refcodes.web.OauthToken aOauthToken) void
setRequestCorrelation
(boolean hasRequestCorrelation) void
setSessionCorrelation
(boolean hasSessionCorrelation) void
setUserAgent
(String aUserAgent) org.refcodes.web.MediaTypeFactory
toMediaTypeFactory
(org.refcodes.web.MediaType aMediaType) 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.BasicAuthCredentialsAccessor.BasicAuthCredentialsBuilder
withBasicAuthCredentials, withBasicAuthCredentials
Methods inherited from interface org.refcodes.web.BasicAuthCredentialsAccessor.BasicAuthCredentialsMutator
setBasicAuthCredentials
Methods inherited from interface org.refcodes.web.BasicAuthCredentialsAccessor.BasicAuthCredentialsProperty
letBasicAuthCredentials, letBasicAuthCredentials
Methods inherited from interface org.refcodes.web.MediaTypeFactoryLookup
hasMediaTypeFactory
Methods inherited from interface org.refcodes.web.OauthTokenAccessor.OauthTokenBuilder
withOAuthToken
Methods inherited from interface org.refcodes.web.OauthTokenAccessor.OauthTokenProperty
letOauthToken
Methods inherited from interface org.refcodes.runtime.RequestCorrelation
disableRequestCorrelation, enableRequestCorrelation, withDisableRequestCorrelation, withEnableRequestCorrelation, withRequestCorrelation
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.runtime.SessionCorrelation
disableSessionCorrelation, enableSessionCorrelation, withDisableSessionCorrelation, withEnableSessionCorrelation, withSessionCorrelation
Methods inherited from interface org.refcodes.web.UserAgentAccessor.UserAgentBuilder
withUserAgent
Methods inherited from interface org.refcodes.web.UserAgentAccessor.UserAgentProperty
letUserAgent
-
Field Details
-
_hasRequestCorrelation
protected boolean _hasRequestCorrelation -
_hasSessionCorrelation
protected boolean _hasSessionCorrelation
-
-
Constructor Details
-
AbstractRestClient
Instantiates a new abstract rest client.- Parameters:
aExecutorService
- the executor service
-
AbstractRestClient
public AbstractRestClient()Instantiates a new abstract rest client.
-
-
Method Details
-
initMedaTypeFactories
protected void initMedaTypeFactories()Adds the defaultMediaTypeFactory
instances. Can be overridden. -
getBasicAuthCredentials
public org.refcodes.web.BasicAuthCredentials getBasicAuthCredentials()- Specified by:
getBasicAuthCredentials
in interfaceorg.refcodes.web.BasicAuthCredentialsAccessor
-
setBasicAuthCredentials
public void setBasicAuthCredentials(org.refcodes.web.BasicAuthCredentials aBasicAuthCredentials) - Specified by:
setBasicAuthCredentials
in interfaceorg.refcodes.web.BasicAuthCredentialsAccessor.BasicAuthCredentialsMutator
-
setOauthToken
public void setOauthToken(org.refcodes.web.OauthToken aOauthToken) - Specified by:
setOauthToken
in interfaceorg.refcodes.web.OauthTokenAccessor.OauthTokenMutator
-
getOauthToken
public org.refcodes.web.OauthToken getOauthToken()- Specified by:
getOauthToken
in interfaceorg.refcodes.web.OauthTokenAccessor
-
setRequestCorrelation
public void setRequestCorrelation(boolean hasRequestCorrelation) - Specified by:
setRequestCorrelation
in interfaceorg.refcodes.runtime.RequestCorrelation<RestClient>
-
hasRequestCorrelation
public boolean hasRequestCorrelation()- Specified by:
hasRequestCorrelation
in interfaceorg.refcodes.runtime.RequestCorrelation<RestClient>
-
setSessionCorrelation
public void setSessionCorrelation(boolean hasSessionCorrelation) - Specified by:
setSessionCorrelation
in interfaceorg.refcodes.runtime.SessionCorrelation<RestClient>
-
hasSessionCorrelation
public boolean hasSessionCorrelation()- Specified by:
hasSessionCorrelation
in interfaceorg.refcodes.runtime.SessionCorrelation<RestClient>
-
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.
-
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.
-
addMediaTypeFactory
public boolean addMediaTypeFactory(org.refcodes.web.MediaTypeFactory aMediaTypeFactory) - Specified by:
addMediaTypeFactory
in interfaceorg.refcodes.web.MediaTypeFactoryLookup.MutableMediaTypeFactoryLookup
-
toMediaTypeFactory
public org.refcodes.web.MediaTypeFactory toMediaTypeFactory(org.refcodes.web.MediaType aMediaType) - Specified by:
toMediaTypeFactory
in interfaceorg.refcodes.web.MediaTypeFactoryLookup
-
getFactoryMediaTypes
public org.refcodes.web.MediaType[] getFactoryMediaTypes()- Specified by:
getFactoryMediaTypes
in interfaceorg.refcodes.web.MediaTypeFactoryLookup
-
getUserAgent
- Specified by:
getUserAgent
in interfaceorg.refcodes.web.UserAgentAccessor
-
setUserAgent
- Specified by:
setUserAgent
in interfaceorg.refcodes.web.UserAgentAccessor.UserAgentMutator
-
onRestRequest
Sets the hook receiving a preparedRestResponseHandler
instance to be used to do the technical request with the technology chosen by the implementing sub-class.- Parameters:
aHandler
- TheRestRequestHandler
for handling the HTTP request.
-
preProcessHeaderFields
protected org.refcodes.web.RequestHeaderFields preProcessHeaderFields(org.refcodes.web.RequestHeaderFields aHeaderFields) Pre-processes the given header fields before the HTTP-Request is issued. By default the User-Agent is set and (if present) the OAuth token.- Parameters:
aHeaderFields
- TheHeaderFields
to be pre-prcessed.
-
doRequestCorrelation
protected void doRequestCorrelation(org.refcodes.web.RequestHeaderFields aRequestHeaderFields) Do request correlation.- Parameters:
aRequestHeaderFields
- the request Header-Fields
-
doSessionCorrelation
protected void doSessionCorrelation(org.refcodes.web.RequestHeaderFields aRequestHeaderFields) Do session correlation.- Parameters:
aRequestHeaderFields
- the request Header-Fields
-
doRequestCorrelation
protected void doRequestCorrelation(org.refcodes.web.ResponseHeaderFields aResponseHeaderFields) Do request correlation.- Parameters:
aResponseHeaderFields
- the response Header-Fields
-
doSessionCorrelation
protected void doSessionCorrelation(org.refcodes.web.ResponseHeaderFields aResponseHeaderFields) Do session correlation.- Parameters:
aResponseHeaderFields
- the response Header-Fields
-