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 pre-configured with the following
MediaTypeFactory instances:
JsonMediaTypeFactoryXmlMediaTypeFactoryTextMediaTypeFactoryFormMediaTypeFactoryHtmlMediaTypeFactory
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.BasicAuthCredentialsPropertyNested classes/interfaces inherited from interface org.refcodes.web.MediaTypeFactoryLookup
org.refcodes.web.MediaTypeFactoryLookup.MutableMediaTypeFactoryLookupNested 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.OauthTokenPropertyNested 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
FieldsModifier and TypeFieldDescriptionprotected booleanprotected boolean -
Constructor Summary
ConstructorsConstructorDescriptionInstantiates a new abstract rest client.AbstractRestClient(ExecutorService aExecutorService) Instantiates a new abstract rest client. -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddMediaTypeFactory(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'sRestRequestBuilderinstance.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'sRestResponseinstance synchronously.protected voiddoRequestCorrelation(org.refcodes.web.RequestHeaderFields aRequestHeaderFields) Do request correlation.protected voiddoRequestCorrelation(org.refcodes.web.ResponseHeaderFields aResponseHeaderFields) Do request correlation.protected voiddoSessionCorrelation(org.refcodes.web.RequestHeaderFields aRequestHeaderFields) Do session correlation.protected voiddoSessionCorrelation(org.refcodes.web.ResponseHeaderFields aResponseHeaderFields) Do session correlation.org.refcodes.web.BasicAuthCredentialsorg.refcodes.web.MediaType[]org.refcodes.web.OauthTokenbooleanbooleanprotected voidAdds the defaultMediaTypeFactoryinstances.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 accordingRestResponseResultinstance 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 accordingRestResponseHandlerinstance used for the request.protected voidonRestRequest(RestRequestHandler aHandler) Sets the hook receiving a preparedRestResponseHandlerinstance to be used to do the technical request with the technology chosen by the implementing sub-class.protected org.refcodes.web.RequestHeaderFieldspreProcessHeaderFields(org.refcodes.web.RequestHeaderFields aHeaderFields) Pre-processes the given header fields before the HTTP-Request is issued.voidsetBasicAuthCredentials(org.refcodes.web.BasicAuthCredentials aBasicAuthCredentials) voidsetOauthToken(org.refcodes.web.OauthToken aOauthToken) voidsetRequestCorrelation(boolean hasRequestCorrelation) voidsetSessionCorrelation(boolean hasSessionCorrelation) voidsetUserAgent(String aUserAgent) org.refcodes.web.MediaTypeFactorytoMediaTypeFactory(org.refcodes.web.MediaType aMediaType) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.refcodes.web.BasicAuthCredentialsAccessor.BasicAuthCredentialsBuilder
withBasicAuthCredentials, withBasicAuthCredentialsMethods inherited from interface org.refcodes.web.BasicAuthCredentialsAccessor.BasicAuthCredentialsMutator
setBasicAuthCredentialsMethods inherited from interface org.refcodes.web.BasicAuthCredentialsAccessor.BasicAuthCredentialsProperty
letBasicAuthCredentials, letBasicAuthCredentialsMethods inherited from interface org.refcodes.web.MediaTypeFactoryLookup
hasMediaTypeFactoryMethods inherited from interface org.refcodes.web.OauthTokenAccessor.OauthTokenBuilder
withOAuthTokenMethods inherited from interface org.refcodes.web.OauthTokenAccessor.OauthTokenProperty
letOauthTokenMethods inherited from interface org.refcodes.runtime.RequestCorrelation
disableRequestCorrelation, enableRequestCorrelation, withDisableRequestCorrelation, withEnableRequestCorrelation, withRequestCorrelationMethods 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, onDeleteMethods 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, onGetMethods 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, onPostMethods 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, onPutMethods 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, onResponseMethods inherited from interface org.refcodes.runtime.SessionCorrelation
disableSessionCorrelation, enableSessionCorrelation, withDisableSessionCorrelation, withEnableSessionCorrelation, withSessionCorrelationMethods inherited from interface org.refcodes.web.UserAgentAccessor.UserAgentBuilder
withUserAgentMethods 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 defaultMediaTypeFactoryinstances. Can be overridden. -
getBasicAuthCredentials
public org.refcodes.web.BasicAuthCredentials getBasicAuthCredentials()- Specified by:
getBasicAuthCredentialsin interfaceorg.refcodes.web.BasicAuthCredentialsAccessor
-
setBasicAuthCredentials
public void setBasicAuthCredentials(org.refcodes.web.BasicAuthCredentials aBasicAuthCredentials) - Specified by:
setBasicAuthCredentialsin interfaceorg.refcodes.web.BasicAuthCredentialsAccessor.BasicAuthCredentialsMutator
-
setOauthToken
public void setOauthToken(org.refcodes.web.OauthToken aOauthToken) - Specified by:
setOauthTokenin interfaceorg.refcodes.web.OauthTokenAccessor.OauthTokenMutator
-
getOauthToken
public org.refcodes.web.OauthToken getOauthToken()- Specified by:
getOauthTokenin interfaceorg.refcodes.web.OauthTokenAccessor
-
setRequestCorrelation
public void setRequestCorrelation(boolean hasRequestCorrelation) - Specified by:
setRequestCorrelationin interfaceorg.refcodes.runtime.RequestCorrelation<RestClient>
-
hasRequestCorrelation
public boolean hasRequestCorrelation()- Specified by:
hasRequestCorrelationin interfaceorg.refcodes.runtime.RequestCorrelation<RestClient>
-
setSessionCorrelation
public void setSessionCorrelation(boolean hasSessionCorrelation) - Specified by:
setSessionCorrelationin interfaceorg.refcodes.runtime.SessionCorrelation<RestClient>
-
hasSessionCorrelation
public boolean hasSessionCorrelation()- Specified by:
hasSessionCorrelationin 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'sRestResponseinstance synchronously.- Specified by:
doRequestin interfaceRestRequestClient- Parameters:
aHttpMethod- The HTTP-Method for the request.aUrl- TheUrlfrom 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.POSTrequest.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
RestResponsefor 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 accordingRestResponseHandlerinstance used for the request. The HTTP-Request is actually sent not earlier than you callingRestResponseHandler.open()on the returnedRestResponseHandleras theRestResponseHandlerstill may be modified after invoking this method!- Specified by:
onResponsein interfaceRestRequestClient- Parameters:
aHttpMethod- The HTTP-Method for the request.aUrl- TheUrlfrom 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.POSTrequest.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
RestResponseHandlerwhich 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 accordingRestResponseResultinstance used for the request. The HTTP-Request is actually sent not earlier than you callingRestResponseResult.open()on the returnedRestResponseResultas theRestResponseResultstill may be modified after invoking this method!- Specified by:
onResponsein interfaceRestRequestClient- Parameters:
aHttpMethod- The HTTP-Method for the request.aUrl- TheUrlfrom 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.POSTrequest.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
RestResponseResultwhich 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'sRestRequestBuilderinstance. InvokingRestRequestBuilder.toRestResponse()starts the request and synchronously returns the response.- Specified by:
buildRequestin interfaceRestRequestClient- Parameters:
aHttpMethod- The HTTP-Method for the request.aUrl- TheUrlfrom 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.POSTrequest.aRedirectDepth- The number of redirect ping-pong cycles to follow before when issuing the HTTP-Request.- Returns:
- The
RestRequestBuilderat this request.
-
addMediaTypeFactory
public boolean addMediaTypeFactory(org.refcodes.web.MediaTypeFactory aMediaTypeFactory) - Specified by:
addMediaTypeFactoryin interfaceorg.refcodes.web.MediaTypeFactoryLookup.MutableMediaTypeFactoryLookup
-
toMediaTypeFactory
public org.refcodes.web.MediaTypeFactory toMediaTypeFactory(org.refcodes.web.MediaType aMediaType) - Specified by:
toMediaTypeFactoryin interfaceorg.refcodes.web.MediaTypeFactoryLookup
-
getFactoryMediaTypes
public org.refcodes.web.MediaType[] getFactoryMediaTypes()- Specified by:
getFactoryMediaTypesin interfaceorg.refcodes.web.MediaTypeFactoryLookup
-
getUserAgent
- Specified by:
getUserAgentin interfaceorg.refcodes.web.UserAgentAccessor
-
setUserAgent
- Specified by:
setUserAgentin interfaceorg.refcodes.web.UserAgentAccessor.UserAgentMutator
-
onRestRequest
Sets the hook receiving a preparedRestResponseHandlerinstance to be used to do the technical request with the technology chosen by the implementing sub-class.- Parameters:
aHandler- TheRestRequestHandlerfor 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- TheHeaderFieldsto 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
-