Package org.refcodes.rest
Interface RestCallerBuilder
-
- All Superinterfaces:
org.refcodes.component.Closable
,org.refcodes.component.Closable.CloseBuilder<org.refcodes.component.LinkComponent.LinkComponentBuilder<RestCallerBuilder>>
,org.refcodes.component.ConnectionStatusAccessor
,org.refcodes.net.HeaderFieldsAccessor<org.refcodes.net.RequestHeaderFields>
,org.refcodes.net.HeaderFieldsAccessor.HeaderFieldsBuilder<org.refcodes.net.RequestHeaderFields,RestCallerBuilder>
,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.BadRequestException>
,org.refcodes.net.HttpClientRequest
,org.refcodes.net.HttpMethodAccessor
,org.refcodes.net.HttpMethodAccessor.HttpMethodBuilder<RestCallerBuilder>
,org.refcodes.net.HttpMethodAccessor.HttpMethodMutator
,org.refcodes.net.HttpMethodAccessor.HttpMethodProperty
,org.refcodes.net.HttpRequest
,org.refcodes.net.HttpRequestBuilder<RestCallerBuilder>
,org.refcodes.component.LinkComponent
,org.refcodes.component.LinkComponent.LinkComponentBuilder<RestCallerBuilder>
,org.refcodes.component.Openable
,org.refcodes.component.Openable.OpenBuilder<org.refcodes.component.LinkComponent.LinkComponentBuilder<RestCallerBuilder>>
,org.refcodes.net.QueryFieldsAccessor
,org.refcodes.net.QueryFieldsAccessor.QueryFieldsMutator
,org.refcodes.net.QueryFieldsAccessor.QueryFieldsProperty
,RestCaller
,RestResponseObserver
,org.refcodes.net.UrlAccessor
,org.refcodes.net.UrlAccessor.UrlBuilder
,org.refcodes.net.UrlAccessor.UrlMutator
- All Known Implementing Classes:
RestCallerBuilderImpl
public interface RestCallerBuilder extends RestCaller, org.refcodes.net.HttpRequestBuilder<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.HeaderFieldsAccessor.HeaderFieldsBuilder<org.refcodes.net.RequestHeaderFields,RestCallerBuilder>
AnRestCallerBuilder
extends anRestCaller
with builder functionality and addslambda
support for handling the responses addressed to thisRestCaller
. Thelambda
defined asRestResponseObserver
acts as the single listener to thisRestCaller
responsible for handling the responses for which thisRestCaller
is responsible. The locator to which aRestCallerBuilder
targets for is defined by theUrlAccessor.getUrl()
property.
-
-
Nested Class Summary
-
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.ConnectionStatusAccessor
org.refcodes.component.ConnectionStatusAccessor.ConnectionStatusMutator, org.refcodes.component.ConnectionStatusAccessor.ConnectionStatusProperty
-
Nested classes/interfaces inherited from interface org.refcodes.net.HeaderFieldsAccessor
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<?,?>>
-
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.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.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.net.QueryFieldsAccessor
org.refcodes.net.QueryFieldsAccessor.QueryFieldsBuilder<B extends org.refcodes.net.QueryFieldsAccessor.QueryFieldsBuilder<?>>, org.refcodes.net.QueryFieldsAccessor.QueryFieldsMutator, org.refcodes.net.QueryFieldsAccessor.QueryFieldsProperty
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default org.refcodes.net.FormFields
getQueryFields()
RestResponseObserver
getResponseObserver()
Retrieves theRestResponseObserver
to which any responses are delegated upon invocation of theRestResponseObserver.onResponse(RestResponseEvent)
method.default void
setQueryFields(org.refcodes.net.FormFields aQueryFields)
void
setResponseObserver(RestResponseObserver aLambda)
Sets theRestResponseObserver
to which any responses are delegated upon invocation of theRestResponseObserver.onResponse(RestResponseEvent)
method.default RestCallerBuilder
withClose()
default RestCallerBuilder
withCloseIn(int aCloseInMillis)
default RestCallerBuilder
withCloseQuietly()
default RestCallerBuilder
withHeaderFields(org.refcodes.net.RequestHeaderFields aRequestHeaderFields)
default RestCallerBuilder
withHttpMethod(org.refcodes.net.HttpMethod aHttpMethod)
default RestCallerBuilder
withOpen()
default <REQ> RestCallerBuilder
withRequest(REQ aRequest)
default RestCallerBuilder
withResponseObserver(RestResponseObserver aLambda)
Builder method for setting theRestResponseObserver
.default RestCallerBuilder
withUrl(org.refcodes.net.Url aUrl)
-
Methods inherited from interface org.refcodes.component.Closable
close, closeIn, closeQuietly, closeUnchecked
-
Methods inherited from interface org.refcodes.component.ConnectionStatusAccessor
getConnectionStatus, isConnectionOpened
-
Methods inherited from interface org.refcodes.net.HeaderFieldsAccessor.HeaderFieldsMutator
setHeaderFields
-
Methods inherited from interface org.refcodes.net.HttpClientRequest
getRequest, setRequest, toHttpBody
-
Methods inherited from interface org.refcodes.net.HttpMethodAccessor.HttpMethodMutator
setHttpMethod
-
Methods inherited from interface org.refcodes.net.HttpRequestBuilder
withAddToHeaderFields, withAddToHeaderFields, withAddToHeaderFields, withAddToHeaderFields, withAddToHeaderFields, withAddToQueryFields, withAddToQueryFields, withAddToQueryFields
-
Methods inherited from interface org.refcodes.rest.RestResponseObserver
onResponse
-
-
-
-
Method Detail
-
setQueryFields
default void setQueryFields(org.refcodes.net.FormFields aQueryFields)
- Specified by:
setQueryFields
in interfaceorg.refcodes.net.QueryFieldsAccessor.QueryFieldsMutator
-
getQueryFields
default org.refcodes.net.FormFields getQueryFields()
- Specified by:
getQueryFields
in interfaceorg.refcodes.net.QueryFieldsAccessor
-
withUrl
default RestCallerBuilder withUrl(org.refcodes.net.Url aUrl)
- Specified by:
withUrl
in interfaceorg.refcodes.net.UrlAccessor.UrlBuilder
-
withHttpMethod
default RestCallerBuilder withHttpMethod(org.refcodes.net.HttpMethod aHttpMethod)
- Specified by:
withHttpMethod
in interfaceorg.refcodes.net.HttpMethodAccessor.HttpMethodBuilder<RestCallerBuilder>
-
withRequest
default <REQ> RestCallerBuilder withRequest(REQ aRequest)
- Specified by:
withRequest
in interfaceorg.refcodes.net.HttpClientRequest
-
getResponseObserver
RestResponseObserver getResponseObserver()
Retrieves theRestResponseObserver
to which any responses are delegated upon invocation of theRestResponseObserver.onResponse(RestResponseEvent)
method.- Returns:
- The (user defined)
RestResponseObserver
to handle responses.
-
setResponseObserver
void setResponseObserver(RestResponseObserver aLambda)
Sets theRestResponseObserver
to which any responses are delegated upon invocation of theRestResponseObserver.onResponse(RestResponseEvent)
method.- Parameters:
aLambda
- The (user defined)RestResponseObserver
to handle responses, feel free to code it aslambda
expression!
-
withResponseObserver
default RestCallerBuilder withResponseObserver(RestResponseObserver aLambda)
Builder method for setting theRestResponseObserver
.- Parameters:
aLambda
- The (user defined)RestResponseObserver
to handle responses, feel free to code it aslambda
expression- Returns:
- The
RestCallerBuilder
for the sake of a fluent API.
-
withHeaderFields
default RestCallerBuilder withHeaderFields(org.refcodes.net.RequestHeaderFields aRequestHeaderFields)
- Specified by:
withHeaderFields
in interfaceorg.refcodes.net.HeaderFieldsAccessor.HeaderFieldsBuilder<org.refcodes.net.RequestHeaderFields,RestCallerBuilder>
-
withOpen
default RestCallerBuilder withOpen() throws org.refcodes.component.OpenException
- Specified by:
withOpen
in interfaceorg.refcodes.component.Openable.OpenBuilder<org.refcodes.component.LinkComponent.LinkComponentBuilder<RestCallerBuilder>>
- Throws:
org.refcodes.component.OpenException
-
withClose
default RestCallerBuilder withClose() throws org.refcodes.component.CloseException
- Specified by:
withClose
in interfaceorg.refcodes.component.Closable.CloseBuilder<org.refcodes.component.LinkComponent.LinkComponentBuilder<RestCallerBuilder>>
- Throws:
org.refcodes.component.CloseException
-
withCloseQuietly
default RestCallerBuilder withCloseQuietly()
- Specified by:
withCloseQuietly
in interfaceorg.refcodes.component.Closable.CloseBuilder<org.refcodes.component.LinkComponent.LinkComponentBuilder<RestCallerBuilder>>
-
withCloseIn
default RestCallerBuilder withCloseIn(int aCloseInMillis)
- Specified by:
withCloseIn
in interfaceorg.refcodes.component.Closable.CloseBuilder<org.refcodes.component.LinkComponent.LinkComponentBuilder<RestCallerBuilder>>
-
-