public interface RestCallerBuilder extends RestCaller, org.refcodes.net.HttpRequestBuilder<RestCallerBuilder>, org.refcodes.mixin.LocatorAccessor.LocatorProperty<String>, org.refcodes.mixin.LocatorAccessor.LocatorBuilder<String,RestCallerBuilder>, org.refcodes.net.HttpMethodAccessor.HttpMethodProperty, org.refcodes.net.HttpMethodAccessor.HttpMethodBuilder<RestCallerBuilder>, org.refcodes.component.LinkComponent.LinkComponentBuilder<RestCallerBuilder>, org.refcodes.component.ConnectionStatusAccessor, org.refcodes.net.QueryFieldsAccessor.QueryFieldsBuilder<RestCallerBuilder>, org.refcodes.net.HeaderFieldsAccessor.HeaderFieldsBuilder<org.refcodes.net.RequestHeaderFields,RestCallerBuilder>
RestCallerBuilder
extends an RestCaller
with builder
functionality and adds lambda
support for handling the responses
addressed to this RestCaller
. The lambda
defined as
RestResponseObserver
acts as the single listener to this
RestCaller
responsible for handling the responses for which this
RestCaller
is responsible.
The locator to which a RestCallerBuilder
targets for is defined by
the LocatorAccessor.getLocator()
property.org.refcodes.mixin.LocatorAccessor.LocatorBuilder<T,B extends org.refcodes.mixin.LocatorAccessor.LocatorBuilder<T,B>>, org.refcodes.mixin.LocatorAccessor.LocatorMutator<T>, org.refcodes.mixin.LocatorAccessor.LocatorProperty<T>
org.refcodes.net.QueryFieldsAccessor.QueryFieldsBuilder<B extends org.refcodes.net.QueryFieldsAccessor.QueryFieldsBuilder<?>>, org.refcodes.net.QueryFieldsAccessor.QueryFieldsMutator, org.refcodes.net.QueryFieldsAccessor.QueryFieldsProperty
org.refcodes.net.HttpMethodAccessor.HttpMethodBuilder<B extends org.refcodes.net.HttpMethodAccessor.HttpMethodBuilder<B>>, org.refcodes.net.HttpMethodAccessor.HttpMethodMutator, org.refcodes.net.HttpMethodAccessor.HttpMethodProperty
org.refcodes.net.HeaderFieldsAccessor.HeaderFieldsBuilder<T extends org.refcodes.net.HeaderFields<?,?>,B extends org.refcodes.net.HeaderFieldsAccessor.HeaderFieldsBuilder<T,B>>, org.refcodes.net.HeaderFieldsAccessor.HeaderFieldsMutator<T extends org.refcodes.net.HeaderFields<?,?>>, org.refcodes.net.HeaderFieldsAccessor.HeaderFieldsProperty<T extends org.refcodes.net.HeaderFields<?,?>>
org.refcodes.component.LinkComponent.LinkAutomaton, org.refcodes.component.LinkComponent.LinkComponentBuilder<B extends org.refcodes.component.LinkComponent.LinkComponentBuilder<B>>
org.refcodes.component.Openable.OpenAutomaton, org.refcodes.component.Openable.OpenBuilder<B extends org.refcodes.component.Openable.OpenBuilder<B>>
Modifier and Type | Method and Description |
---|---|
RestResponseObserver |
getResponseObserver()
Retrieves the
RestResponseObserver to which any responses are
delegated upon invocation of the RestResponseObserver.onResponse(RestResponseEvent)
method. |
void |
setResponseObserver(RestResponseObserver aLambda)
Sets the
RestResponseObserver to which any responses are
delegated upon invocation of the RestResponseObserver.onResponse(RestResponseEvent)
method. |
default RestCallerBuilder |
withClose()
With close.
|
default RestCallerBuilder |
withCloseIn(int aCloseInMillis)
With close in.
|
default RestCallerBuilder |
withCloseQuietly()
With close quietly.
|
default RestCallerBuilder |
withHeaderFields(org.refcodes.net.RequestHeaderFields aRequestHeaderFields)
With Header-Fields.
|
default RestCallerBuilder |
withHttpMethod(org.refcodes.net.HttpMethod aHttpMethod)
With http method.
|
default RestCallerBuilder |
withLocator(String aLocator)
With locator.
|
default RestCallerBuilder |
withOpen()
With open.
|
default RestCallerBuilder |
withQueryFields(org.refcodes.net.FormFields aQueryFields)
With query fields.
|
default <REQ> RestCallerBuilder |
withRequest(REQ aRequest)
With request.
|
default RestCallerBuilder |
withResponseObserver(RestResponseObserver aLambda)
Builder method for setting the
RestResponseObserver . |
onResponse
getRequest, setRequest, toHttpBody
setQueryFields
setHeaderFields
withAddToHeaderFields, withAddToHeaderFields, withAddToHeaderFields, withAddToHeaderFields, withAddToHeaderFields, withAddToQueryFields, withAddToQueryFields, withAddToQueryFields
default RestCallerBuilder withQueryFields(org.refcodes.net.FormFields aQueryFields)
withQueryFields
in interface org.refcodes.net.QueryFieldsAccessor.QueryFieldsBuilder<RestCallerBuilder>
aQueryFields
- the a query fieldsdefault RestCallerBuilder withLocator(String aLocator)
withLocator
in interface org.refcodes.mixin.LocatorAccessor.LocatorBuilder<String,RestCallerBuilder>
aLocator
- the a locatordefault RestCallerBuilder withHttpMethod(org.refcodes.net.HttpMethod aHttpMethod)
withHttpMethod
in interface org.refcodes.net.HttpMethodAccessor.HttpMethodBuilder<RestCallerBuilder>
aHttpMethod
- the a http methoddefault <REQ> RestCallerBuilder withRequest(REQ aRequest)
withRequest
in interface org.refcodes.net.HttpClientRequest
REQ
- the generic typeaRequest
- the a requestRestResponseObserver getResponseObserver()
RestResponseObserver
to which any responses are
delegated upon invocation of the RestResponseObserver.onResponse(RestResponseEvent)
method.RestResponseObserver
to handle
responses.void setResponseObserver(RestResponseObserver aLambda)
RestResponseObserver
to which any responses are
delegated upon invocation of the RestResponseObserver.onResponse(RestResponseEvent)
method.aLambda
- The (user defined) RestResponseObserver
to handle
responses, feel free to code it as lambda
expression!default RestCallerBuilder withResponseObserver(RestResponseObserver aLambda)
RestResponseObserver
.aLambda
- The (user defined) RestResponseObserver
to handle
responses, feel free to code it as lambda
expressionRestCallerBuilder
for the sake of a fluent API.default RestCallerBuilder withHeaderFields(org.refcodes.net.RequestHeaderFields aRequestHeaderFields)
withHeaderFields
in interface org.refcodes.net.HeaderFieldsAccessor.HeaderFieldsBuilder<org.refcodes.net.RequestHeaderFields,RestCallerBuilder>
aRequestHeaderFields
- the a request Header-Fieldsdefault RestCallerBuilder withOpen() throws org.refcodes.component.OpenException
withOpen
in interface org.refcodes.component.Openable.OpenBuilder<org.refcodes.component.LinkComponent.LinkComponentBuilder<RestCallerBuilder>>
org.refcodes.component.OpenException
- the open exceptiondefault RestCallerBuilder withClose() throws org.refcodes.component.CloseException
withClose
in interface org.refcodes.component.Closable.CloseBuilder<org.refcodes.component.LinkComponent.LinkComponentBuilder<RestCallerBuilder>>
org.refcodes.component.CloseException
- the close exceptiondefault RestCallerBuilder withCloseQuietly()
withCloseQuietly
in interface org.refcodes.component.Closable.CloseBuilder<org.refcodes.component.LinkComponent.LinkComponentBuilder<RestCallerBuilder>>
default RestCallerBuilder withCloseIn(int aCloseInMillis)
withCloseIn
in interface org.refcodes.component.Closable.CloseBuilder<org.refcodes.component.LinkComponent.LinkComponentBuilder<RestCallerBuilder>>
aCloseInMillis
- the a close in millisCopyright © 2017. All rights reserved.