Package org.refcodes.rest
Class RestRequestBuilderImpl
- java.lang.Object
-
- org.refcodes.net.HttpRequestImpl
-
- org.refcodes.net.HttpClientRequestImpl
-
- org.refcodes.rest.RestRequestBuilderImpl
-
- All Implemented Interfaces:
org.refcodes.mixin.Dumpable,org.refcodes.net.HeaderFieldsAccessor<org.refcodes.net.RequestHeaderFields>,org.refcodes.net.HeaderFieldsAccessor.HeaderFieldsBuilder<org.refcodes.net.RequestHeaderFields,RestRequestBuilder>,org.refcodes.net.HeaderFieldsAccessor.HeaderFieldsMutator<org.refcodes.net.RequestHeaderFields>,org.refcodes.net.HeaderFieldsAccessor.HeaderFieldsProperty<org.refcodes.net.RequestHeaderFields>,org.refcodes.net.HttpBodyAccessor.HttpBodyProvider<org.refcodes.net.RequestHeaderFields>,org.refcodes.net.HttpClientRequest,org.refcodes.net.HttpClientRequest.HttpClientRequestBuilder,org.refcodes.net.HttpMethodAccessor,org.refcodes.net.HttpMethodAccessor.HttpMethodBuilder<org.refcodes.net.RequestHeaderFields>,org.refcodes.net.HttpMethodAccessor.HttpMethodMutator,org.refcodes.net.HttpMethodAccessor.HttpMethodProperty,org.refcodes.net.HttpRequest,org.refcodes.net.HttpRequestBuilder<org.refcodes.net.RequestHeaderFields>,org.refcodes.net.RedirectDepthAccessor,org.refcodes.net.RedirectDepthAccessor.RedirectDepthBuilder<org.refcodes.net.RequestHeaderFields>,org.refcodes.net.RedirectDepthAccessor.RedirectDepthMutator,org.refcodes.net.RedirectDepthAccessor.RedirectDepthProperty,org.refcodes.net.UrlAccessor,org.refcodes.net.UrlAccessor.UrlBuilder,org.refcodes.net.UrlAccessor.UrlMutator,RestRequest,RestRequestBuilder
public class RestRequestBuilderImpl extends org.refcodes.net.HttpClientRequestImpl implements RestRequestBuilder
The implementation of theRestCallerBuilderinterface as good old POJO for use by differentRestClientimplementations.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.refcodes.net.HttpClientRequest
org.refcodes.net.HttpClientRequest.HttpClientRequestBuilder
-
Nested classes/interfaces inherited from interface org.refcodes.net.HttpMethodAccessor
org.refcodes.net.HttpMethodAccessor.HttpMethodBuilder<B extends org.refcodes.net.HttpMethodAccessor.HttpMethodBuilder<B>>, org.refcodes.net.HttpMethodAccessor.HttpMethodMutator, org.refcodes.net.HttpMethodAccessor.HttpMethodProperty
-
Nested classes/interfaces inherited from interface org.refcodes.net.RedirectDepthAccessor
org.refcodes.net.RedirectDepthAccessor.RedirectDepthBuilder<B extends org.refcodes.net.RedirectDepthAccessor.RedirectDepthBuilder<B>>, org.refcodes.net.RedirectDepthAccessor.RedirectDepthMutator, org.refcodes.net.RedirectDepthAccessor.RedirectDepthProperty
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedRestRequestBuilderImpl(org.refcodes.net.HttpMethod aHttpMethod, org.refcodes.net.Url aUrl, int aRedirectDepth, RestClient aRestClient)Instantiates a new rest request builder impl.protectedRestRequestBuilderImpl(org.refcodes.net.HttpMethod aHttpMethod, org.refcodes.net.Url aUrl, java.lang.Object aRequest, int aRedirectDepth, RestClient aRestClient)Instantiates a new rest request builder impl.protectedRestRequestBuilderImpl(org.refcodes.net.HttpMethod aHttpMethod, org.refcodes.net.Url aUrl, java.lang.Object aRequest, RestClient aRestClient)Instantiates a new rest request builder impl.protectedRestRequestBuilderImpl(org.refcodes.net.HttpMethod aHttpMethod, org.refcodes.net.Url aUrl, org.refcodes.net.RequestHeaderFields aHeaderFields, java.lang.Object aRequest, int aRedirectDepth, RestClient aRestClient)Instantiates a new rest request builder impl.protectedRestRequestBuilderImpl(org.refcodes.net.HttpMethod aHttpMethod, org.refcodes.net.Url aUrl, org.refcodes.net.RequestHeaderFields aHeaderFields, java.lang.Object aRequest, RestClient aRestClient)Instantiates a new rest request builder impl.protectedRestRequestBuilderImpl(org.refcodes.net.HttpMethod aHttpMethod, org.refcodes.net.Url aUrl, RestClient aRestClient)Instantiates a new rest request builder impl.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.refcodes.net.HttpMethodgetHttpMethod()org.refcodes.net.Url.UrlBuildergetUrl()voidsetHeaderFields(org.refcodes.net.RequestHeaderFields aHeaderFields)voidsetHttpMethod(org.refcodes.net.HttpMethod aHttpMethod)voidsetUrl(org.refcodes.net.Url aUrl)RestResponsetoRestResponse()Sends the request and returns synchronously the accordingRestResponse.java.lang.StringtoString()-
Methods inherited from interface org.refcodes.net.HttpClientRequest
getRequest, setRequest, toHttpBody
-
Methods inherited from class org.refcodes.net.HttpClientRequestImpl
getRedirectDepth, getRequest, setRedirectDepth, setRequest, toHttpBody
-
Methods inherited from interface org.refcodes.net.HttpRequestBuilder
withAddToHeaderFields, withAddToHeaderFields, withAddToHeaderFields, withAddToHeaderFields, withAddToHeaderFields, withAddToQueryFields, withAddToQueryFields, withAddToQueryFields
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.refcodes.net.RedirectDepthAccessor.RedirectDepthMutator
setRedirectDepth
-
Methods inherited from interface org.refcodes.rest.RestRequestBuilder
withHeaderFields, withHttpMethod, withRedirectDepth, withRequest, withUrl
-
-
-
-
Constructor Detail
-
RestRequestBuilderImpl
protected RestRequestBuilderImpl(org.refcodes.net.HttpMethod aHttpMethod, org.refcodes.net.Url aUrl, org.refcodes.net.RequestHeaderFields aHeaderFields, java.lang.Object aRequest, RestClient aRestClient)Instantiates a new rest request builder impl.- Parameters:
aHttpMethod- the http methodaUrl- TheUrlfrom which to take the URL specific data.aHeaderFields- the Header-FieldsaRequest- the requestaRestClient- the rest client
-
RestRequestBuilderImpl
protected RestRequestBuilderImpl(org.refcodes.net.HttpMethod aHttpMethod, org.refcodes.net.Url aUrl, RestClient aRestClient)Instantiates a new rest request builder impl.- Parameters:
aHttpMethod- the http methodaUrl- TheUrlfrom which to take the URL specific data.aRestClient- the rest client
-
RestRequestBuilderImpl
protected RestRequestBuilderImpl(org.refcodes.net.HttpMethod aHttpMethod, org.refcodes.net.Url aUrl, java.lang.Object aRequest, RestClient aRestClient)Instantiates a new rest request builder impl.- Parameters:
aHttpMethod- the http methodaUrl- TheUrlfrom which to take the URL specific data.aRequest- the requestaRestClient- the rest client
-
RestRequestBuilderImpl
protected RestRequestBuilderImpl(org.refcodes.net.HttpMethod aHttpMethod, org.refcodes.net.Url aUrl, int aRedirectDepth, RestClient aRestClient)Instantiates a new rest request builder impl.- Parameters:
aHttpMethod- the http methodaUrl- TheUrlfrom which to take the URL specific data.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.aRestClient- the rest client
-
RestRequestBuilderImpl
protected RestRequestBuilderImpl(org.refcodes.net.HttpMethod aHttpMethod, org.refcodes.net.Url aUrl, java.lang.Object aRequest, int aRedirectDepth, RestClient aRestClient)Instantiates a new rest request builder impl.- Parameters:
aHttpMethod- the http methodaUrl- TheUrlfrom which to take the URL specific data.aRequest- the requestaRedirectDepth- 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.aRestClient- the rest client
-
RestRequestBuilderImpl
protected RestRequestBuilderImpl(org.refcodes.net.HttpMethod aHttpMethod, org.refcodes.net.Url aUrl, org.refcodes.net.RequestHeaderFields aHeaderFields, java.lang.Object aRequest, int aRedirectDepth, RestClient aRestClient)Instantiates a new rest request builder impl.- Parameters:
aHttpMethod- the http methodaUrl- TheUrlfrom which to take the URL specific data.aHeaderFields- the Header-FieldsaRequest- the requestaRedirectDepth- 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.aRestClient- the rest client
-
-
Method Detail
-
getUrl
public org.refcodes.net.Url.UrlBuilder getUrl()
- Specified by:
getUrlin interfaceorg.refcodes.net.UrlAccessor- Overrides:
getUrlin classorg.refcodes.net.HttpRequestImpl
-
setUrl
public void setUrl(org.refcodes.net.Url aUrl)
- Specified by:
setUrlin interfaceorg.refcodes.net.UrlAccessor.UrlMutator
-
getHttpMethod
public org.refcodes.net.HttpMethod getHttpMethod()
- Specified by:
getHttpMethodin interfaceorg.refcodes.net.HttpMethodAccessor- Overrides:
getHttpMethodin classorg.refcodes.net.HttpRequestImpl
-
setHttpMethod
public void setHttpMethod(org.refcodes.net.HttpMethod aHttpMethod)
- Specified by:
setHttpMethodin interfaceorg.refcodes.net.HttpMethodAccessor.HttpMethodMutator
-
toString
public java.lang.String toString()
- Overrides:
toStringin classorg.refcodes.net.HttpClientRequestImpl
-
setHeaderFields
public void setHeaderFields(org.refcodes.net.RequestHeaderFields aHeaderFields)
- Specified by:
setHeaderFieldsin interfaceorg.refcodes.net.HeaderFieldsAccessor.HeaderFieldsMutator<org.refcodes.net.RequestHeaderFields>
-
toRestResponse
public RestResponse toRestResponse() throws org.refcodes.net.HttpResponseException
Sends the request and returns synchronously the accordingRestResponse.- Specified by:
toRestResponsein interfaceRestRequestBuilder- Returns:
- the rest response
- Throws:
org.refcodes.net.HttpResponseException- the http response exception
-
-