- All Superinterfaces:
org.refcodes.web.BaseLocatorAccessor
,org.refcodes.web.BaseLocatorAccessor.BaseLocatorBuilder<RestServer>
,org.refcodes.web.BaseLocatorAccessor.BaseLocatorMutator
,org.refcodes.web.BaseLocatorAccessor.BaseLocatorProperty
,HttpExceptionHandlerAccessor
,HttpExceptionHandlerAccessor.HttpExceptionHandlerBuilder<RestServer>
,HttpExceptionHandlerAccessor.HttpExceptionHandlerMutator
,HttpExceptionHandlerAccessor.HttpExceptionHandlerProperty
,HttpExceptionHandlingAccessor
,HttpExceptionHandlingAccessor.HttpExceptionHandlingBuilder<RestServer>
,HttpExceptionHandlingAccessor.HttpExceptionHandlingMutator
,HttpExceptionHandlingAccessor.HttpExceptionHandlingProperty
,org.refcodes.web.MediaTypeFactoryLookup
,org.refcodes.web.MediaTypeFactoryLookup.MutableMediaTypeFactoryLookup
,org.refcodes.observer.Observable<RestEndpoint>
,org.refcodes.observer.Observers<RestEndpoint,
,RestServer> org.refcodes.web.RealmAccessor
,org.refcodes.web.RealmAccessor.RealmBuilder<RestServer>
,org.refcodes.web.RealmAccessor.RealmMutator
,org.refcodes.web.RealmAccessor.RealmProperty
,org.refcodes.runtime.RequestCorrelation<RestServer>
,org.refcodes.runtime.SessionCorrelation<RestServer>
- All Known Subinterfaces:
HttpRegistryRestServer<DESC,
,B> HttpRestServer
,LoopbackRestServer
- All Known Implementing Classes:
AbstractHttpRegistryRestServerDecorator
,AbstractHttpRestServerDecorator
,AbstractRestServer
,HttpRestServerImpl
,HttpRestServerSingleton
,LoopbackRestServerImpl
,LoopbackRestServerSingleton
public interface RestServer
extends HttpExceptionHandlerAccessor.HttpExceptionHandlerProperty, HttpExceptionHandlerAccessor.HttpExceptionHandlerBuilder<RestServer>, HttpExceptionHandlingAccessor.HttpExceptionHandlingProperty, HttpExceptionHandlingAccessor.HttpExceptionHandlingBuilder<RestServer>, org.refcodes.observer.Observable<RestEndpoint>, org.refcodes.observer.Observers<RestEndpoint,RestServer>, org.refcodes.web.MediaTypeFactoryLookup.MutableMediaTypeFactoryLookup, org.refcodes.web.RealmAccessor.RealmProperty, org.refcodes.web.RealmAccessor.RealmBuilder<RestServer>, org.refcodes.web.BaseLocatorAccessor.BaseLocatorProperty, org.refcodes.web.BaseLocatorAccessor.BaseLocatorBuilder<RestServer>, org.refcodes.runtime.RequestCorrelation<RestServer>, org.refcodes.runtime.SessionCorrelation<RestServer>
The
RestServer
acts as the target for clients issuing REST requests.
RestEndpointBuilder
instances, most easily being created with the
onRequest(HttpMethod, String, RestRequestConsumer)
method (or the
like), are registered as listeners to the RestServer
(
HttpRestServer
). The RestServer
(HttpRestServer
)
fires RestRequestEvent
events to the RestRequestConsumer
s of
an RestEndpoint
dedicated to an according locator (pattern) for a
specific HttpMethod
.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.refcodes.web.BaseLocatorAccessor
org.refcodes.web.BaseLocatorAccessor.BaseLocatorBuilder<B extends org.refcodes.web.BaseLocatorAccessor.BaseLocatorBuilder<B>>, org.refcodes.web.BaseLocatorAccessor.BaseLocatorMutator, org.refcodes.web.BaseLocatorAccessor.BaseLocatorProperty
Nested classes/interfaces inherited from interface org.refcodes.rest.HttpExceptionHandlerAccessor
HttpExceptionHandlerAccessor.HttpExceptionHandlerBuilder<B extends HttpExceptionHandlerAccessor.HttpExceptionHandlerBuilder<B>>, HttpExceptionHandlerAccessor.HttpExceptionHandlerMutator, HttpExceptionHandlerAccessor.HttpExceptionHandlerProperty
Nested classes/interfaces inherited from interface org.refcodes.rest.HttpExceptionHandlingAccessor
HttpExceptionHandlingAccessor.HttpExceptionHandlingBuilder<B extends HttpExceptionHandlingAccessor.HttpExceptionHandlingBuilder<B>>, HttpExceptionHandlingAccessor.HttpExceptionHandlingMutator, HttpExceptionHandlingAccessor.HttpExceptionHandlingProperty
Nested classes/interfaces inherited from interface org.refcodes.web.MediaTypeFactoryLookup
org.refcodes.web.MediaTypeFactoryLookup.MutableMediaTypeFactoryLookup
Nested classes/interfaces inherited from interface org.refcodes.web.RealmAccessor
org.refcodes.web.RealmAccessor.RealmBuilder<B extends org.refcodes.web.RealmAccessor.RealmBuilder<B>>, org.refcodes.web.RealmAccessor.RealmMutator, org.refcodes.web.RealmAccessor.RealmProperty
-
Method Summary
Modifier and TypeMethodDescriptiondefault RestEndpointBuilder
onDelete
(String aLocatorPathPattern, RestRequestConsumer aRequestConsumer) Even more convenient: Everything done here can also be done usingonRequest(HttpMethod, String, RestRequestConsumer)
: Registers aRestRequestConsumer
with the given Locator-Pattern to incoming DELETE methods.default RestEndpointBuilder
onDelete
(Pattern aLocatorRegExp, RestRequestConsumer aRequestConsumer) Even more convenient: Everything done here can also be done usingonRequest(HttpMethod, String, RestRequestConsumer)
: Registers aRestRequestConsumer
with the given Locator-Pattern to incoming DELETE methods.default RestEndpointBuilder
onGet
(String aLocatorPathPattern, RestRequestConsumer aRequestConsumer) Even more convenient: Everything done here can also be done usingonRequest(HttpMethod, String, RestRequestConsumer)
: Registers aRestRequestConsumer
with the given Locator-Pattern to incoming GET methods.default RestEndpointBuilder
onGet
(Pattern aLocatorRegExp, RestRequestConsumer aRequestConsumer) Even more convenient: Everything done here can also be done usingonRequest(HttpMethod, String, RestRequestConsumer)
: Registers aRestRequestConsumer
with the given Locator-Pattern to incoming GET methods.default RestEndpointBuilder
onPost
(String aLocatorPathPattern, RestRequestConsumer aRequestConsumer) Even more convenient: Everything done here can also be done usingonRequest(HttpMethod, String, RestRequestConsumer)
: Registers aRestRequestConsumer
with the given Locator-Pattern to incoming POST methods.default RestEndpointBuilder
onPost
(Pattern aLocatorRegExp, RestRequestConsumer aRequestConsumer) Even more convenient: Everything done here can also be done usingonRequest(HttpMethod, String, RestRequestConsumer)
: Registers aRestRequestConsumer
with the given Locator-Pattern to incoming POST methods.default RestEndpointBuilder
onPut
(String aLocatorPathPattern, RestRequestConsumer aRequestConsumer) Even more convenient: Everything done here can also be done usingonRequest(HttpMethod, String, RestRequestConsumer)
: Registers aRestRequestConsumer
with the given Locator-Pattern to incoming PUT methods.default RestEndpointBuilder
onPut
(Pattern aLocatorRegExp, RestRequestConsumer aRequestConsumer) Even more convenient: Everything done here can also be done usingonRequest(HttpMethod, String, RestRequestConsumer)
: Registers aRestRequestConsumer
with the given Locator-Pattern to incoming PUT methods.default RestEndpointBuilder
onRequest
(String aLocatorPathPattern, RestRequestConsumer aRequestConsumer) Registers a preconfiguredRestEndpoint
, triggerd by any HTTP method, and returns its instance.default RestEndpointBuilder
onRequest
(Pattern aLocatorRegExp, RestRequestConsumer aRequestConsumer) Registers a preconfiguredRestEndpoint
, triggerd by any HTTP method, and returns its instance.default boolean
onRequest
(RestEndpoint aRestEndpoint) For the sake of unified naming, this method just delegates toObservable.subscribeObserver(Object)
.default RestEndpointBuilder
onRequest
(org.refcodes.web.HttpMethod aHttpMethod, String aLocatorPathPattern, RestRequestConsumer aRequestConsumer) Registers a preconfiguredRestEndpoint
with the least required attributes and returns its instance.default RestEndpointBuilder
onRequest
(org.refcodes.web.HttpMethod aHttpMethod, Pattern aLocatorRegExp, RestRequestConsumer aRequestConsumer) Registers a preconfiguredRestEndpoint
with the least required attributes and returns its instance.default RestServer
withBaseLocator
(String aBaseLocator) default RestServer
default RestServer
default RestServer
default RestServer
default RestServer
default RestServer
default RestServer
withObserversActive
(boolean isActive) default RestServer
default RestServer
withRequestCorrelation
(boolean hasRequestCorrelation) default RestServer
withSessionCorrelation
(boolean hasSessionCorrelation) Methods inherited from interface org.refcodes.web.BaseLocatorAccessor
getBaseLocator
Methods inherited from interface org.refcodes.web.BaseLocatorAccessor.BaseLocatorMutator
setBaseLocator
Methods inherited from interface org.refcodes.web.BaseLocatorAccessor.BaseLocatorProperty
letBaseLocator
Methods inherited from interface org.refcodes.rest.HttpExceptionHandlerAccessor
getHttpExceptionHandler
Methods inherited from interface org.refcodes.rest.HttpExceptionHandlerAccessor.HttpExceptionHandlerBuilder
withHttpExceptionHandler, withOnHttpException
Methods inherited from interface org.refcodes.rest.HttpExceptionHandlerAccessor.HttpExceptionHandlerMutator
onHttpException, setHttpExceptionHandler
Methods inherited from interface org.refcodes.rest.HttpExceptionHandlerAccessor.HttpExceptionHandlerProperty
letHttpExceptionHandler
Methods inherited from interface org.refcodes.rest.HttpExceptionHandlingAccessor
getHttpExceptionHandling
Methods inherited from interface org.refcodes.rest.HttpExceptionHandlingAccessor.HttpExceptionHandlingBuilder
withHttpExceptionHandling
Methods inherited from interface org.refcodes.rest.HttpExceptionHandlingAccessor.HttpExceptionHandlingMutator
setHttpExceptionHandling
Methods inherited from interface org.refcodes.rest.HttpExceptionHandlingAccessor.HttpExceptionHandlingProperty
letHttpExceptionHandling
Methods inherited from interface org.refcodes.web.MediaTypeFactoryLookup
getFactoryMediaTypes, hasMediaTypeFactory, toMediaTypeFactory
Methods inherited from interface org.refcodes.web.MediaTypeFactoryLookup.MutableMediaTypeFactoryLookup
addMediaTypeFactory
Methods inherited from interface org.refcodes.observer.Observable
hasObserverSubscription, subscribeObserver, unsubscribeObserver
Methods inherited from interface org.refcodes.observer.Observers
disableObservers, enableObservers, isObserversActive, observers, setObserversActive
Methods inherited from interface org.refcodes.web.RealmAccessor
getRealm
Methods inherited from interface org.refcodes.web.RealmAccessor.RealmMutator
setRealm
Methods inherited from interface org.refcodes.web.RealmAccessor.RealmProperty
letRealm
Methods inherited from interface org.refcodes.runtime.RequestCorrelation
disableRequestCorrelation, enableRequestCorrelation, hasRequestCorrelation, setRequestCorrelation
Methods inherited from interface org.refcodes.runtime.SessionCorrelation
disableSessionCorrelation, enableSessionCorrelation, hasSessionCorrelation, setSessionCorrelation
-
Method Details
-
withObserversActive
- Specified by:
withObserversActive
in interfaceorg.refcodes.observer.Observers<RestEndpoint,
RestServer>
-
withEnableObservers
- Specified by:
withEnableObservers
in interfaceorg.refcodes.observer.Observers<RestEndpoint,
RestServer>
-
withDisableObservers
- Specified by:
withDisableObservers
in interfaceorg.refcodes.observer.Observers<RestEndpoint,
RestServer>
-
withSessionCorrelation
- Specified by:
withSessionCorrelation
in interfaceorg.refcodes.runtime.SessionCorrelation<RestServer>
-
withEnableSessionCorrelation
- Specified by:
withEnableSessionCorrelation
in interfaceorg.refcodes.runtime.SessionCorrelation<RestServer>
-
withDisableSessionCorrelation
- Specified by:
withDisableSessionCorrelation
in interfaceorg.refcodes.runtime.SessionCorrelation<RestServer>
-
withRequestCorrelation
- Specified by:
withRequestCorrelation
in interfaceorg.refcodes.runtime.RequestCorrelation<RestServer>
-
withEnableRequestCorrelation
- Specified by:
withEnableRequestCorrelation
in interfaceorg.refcodes.runtime.RequestCorrelation<RestServer>
-
withDisableRequestCorrelation
- Specified by:
withDisableRequestCorrelation
in interfaceorg.refcodes.runtime.RequestCorrelation<RestServer>
-
onRequest
For the sake of unified naming, this method just delegates toObservable.subscribeObserver(Object)
.- Parameters:
aRestEndpoint
- the rest endpoint- Returns:
- true, if successful
-
withBaseLocator
- Specified by:
withBaseLocator
in interfaceorg.refcodes.web.BaseLocatorAccessor.BaseLocatorBuilder<RestServer>
-
withRealm
- Specified by:
withRealm
in interfaceorg.refcodes.web.RealmAccessor.RealmBuilder<RestServer>
-
onRequest
default RestEndpointBuilder onRequest(String aLocatorPathPattern, RestRequestConsumer aRequestConsumer) Registers a preconfiguredRestEndpoint
, triggerd by any HTTP method, and returns its instance. To unsubscribe viaObservable.unsubscribeObserver(Object)
, use the returned instance. Attention: InvokeRestEndpointBuilder.open()
to activate this endpoint!- Parameters:
aLocatorPathPattern
- The local locator (regular expression) pattern to which thisRestEndpoint
is bound.aRequestConsumer
- The listener processing a request targeted at thisRestEndpoint
.- Returns:
- The preconfigured
RestEndpoint
which acts as handle to unsubscribe theRestEndpoint
viaObservable.unsubscribeObserver(Object)
.
-
onRequest
Registers a preconfiguredRestEndpoint
, triggerd by any HTTP method, and returns its instance. To unsubscribe viaObservable.unsubscribeObserver(Object)
, use the returned instance. Attention: InvokeRestEndpointBuilder.open()
to activate this endpoint!- Parameters:
aLocatorRegExp
- The local locator (regular expression) pattern to which thisRestEndpoint
is bound.aRequestConsumer
- The listener processing a request targeted at thisRestEndpoint
.- Returns:
- The preconfigured
RestEndpoint
which acts as handle to unsubscribe theRestEndpoint
viaObservable.unsubscribeObserver(Object)
.
-
onRequest
default RestEndpointBuilder onRequest(org.refcodes.web.HttpMethod aHttpMethod, String aLocatorPathPattern, RestRequestConsumer aRequestConsumer) Registers a preconfiguredRestEndpoint
with the least required attributes and returns its instance. To unsubscribe viaObservable.unsubscribeObserver(Object)
, use the returned instance. Attention: InvokeRestEndpointBuilder.open()
to activate this endpoint!- Parameters:
aHttpMethod
- The HTTP-Method to which thisRestEndpoint
is bound. A value ofnull
means that any HTTP-Method may trigger thisRestEndpoint
.aLocatorPathPattern
- The local Locator-Pattern to which thisRestEndpoint
is bound. A value ofnull
means that any locator may trigger thisRestEndpoint
.aRequestConsumer
- The listener processing a request targeted at thisRestEndpoint
.- Returns:
- The preconfigured
RestEndpoint
which acts as handle to unsubscribe theRestEndpoint
viaObservable.unsubscribeObserver(Object)
.
-
onRequest
default RestEndpointBuilder onRequest(org.refcodes.web.HttpMethod aHttpMethod, Pattern aLocatorRegExp, RestRequestConsumer aRequestConsumer) Registers a preconfiguredRestEndpoint
with the least required attributes and returns its instance. To unsubscribe viaObservable.unsubscribeObserver(Object)
, use the returned instance. Attention: InvokeRestEndpointBuilder.open()
to activate this endpoint!- Parameters:
aHttpMethod
- The HTTP-Method to which thisRestEndpoint
is bound. A value ofnull
means that any HTTP-Method may trigger thisRestEndpoint
.aLocatorRegExp
- The local locator (regular expression) pattern to which thisRestEndpoint
is bound. A value ofnull
means that any locator may trigger thisRestEndpoint
.aRequestConsumer
- The listener processing a request targeted at thisRestEndpoint
.- Returns:
- The preconfigured
RestEndpoint
which acts as handle to unsubscribe theRestEndpoint
viaObservable.unsubscribeObserver(Object)
.
-
onGet
Even more convenient: Everything done here can also be done usingonRequest(HttpMethod, String, RestRequestConsumer)
: Registers aRestRequestConsumer
with the given Locator-Pattern to incoming GET methods. Attention: InvokeRestEndpointBuilder.open()
to activate this endpoint!- Parameters:
aLocatorPathPattern
- The local Locator-Pattern to which thisRestEndpoint
is bound.aRequestConsumer
- The listener processing a request targeted at thisRestEndpoint
.- Returns:
- The preconfigured
RestEndpoint
which acts as handle to unsubscribe theRestEndpoint
viaObservable.unsubscribeObserver(Object)
.
-
onGet
Even more convenient: Everything done here can also be done usingonRequest(HttpMethod, String, RestRequestConsumer)
: Registers aRestRequestConsumer
with the given Locator-Pattern to incoming GET methods. Attention: InvokeRestEndpointBuilder.open()
to activate this endpoint!- Parameters:
aLocatorRegExp
- The local locator (regular expression) pattern to which thisRestEndpoint
is bound.aRequestConsumer
- The listener processing a request targeted at thisRestEndpoint
.- Returns:
- The preconfigured
RestEndpoint
which acts as handle to unsubscribe theRestEndpoint
viaObservable.unsubscribeObserver(Object)
.
-
onPut
Even more convenient: Everything done here can also be done usingonRequest(HttpMethod, String, RestRequestConsumer)
: Registers aRestRequestConsumer
with the given Locator-Pattern to incoming PUT methods. Attention: InvokeRestEndpointBuilder.open()
to activate this endpoint!- Parameters:
aLocatorPathPattern
- The local Locator-Pattern to which thisRestEndpoint
is bound.aRequestConsumer
- The listener processing a request targeted at thisRestEndpoint
.- Returns:
- The preconfigured
RestEndpoint
which acts as handle to unsubscribe theRestEndpoint
viaObservable.unsubscribeObserver(Object)
.
-
onPut
Even more convenient: Everything done here can also be done usingonRequest(HttpMethod, String, RestRequestConsumer)
: Registers aRestRequestConsumer
with the given Locator-Pattern to incoming PUT methods. Attention: InvokeRestEndpointBuilder.open()
to activate this endpoint!- Parameters:
aLocatorRegExp
- The local locator (regular expression) pattern to which thisRestEndpoint
is bound.aRequestConsumer
- The listener processing a request targeted at thisRestEndpoint
.- Returns:
- The preconfigured
RestEndpoint
which acts as handle to unsubscribe theRestEndpoint
viaObservable.unsubscribeObserver(Object)
.
-
onPost
default RestEndpointBuilder onPost(String aLocatorPathPattern, RestRequestConsumer aRequestConsumer) Even more convenient: Everything done here can also be done usingonRequest(HttpMethod, String, RestRequestConsumer)
: Registers aRestRequestConsumer
with the given Locator-Pattern to incoming POST methods. Attention: InvokeRestEndpointBuilder.open()
to activate this endpoint!- Parameters:
aLocatorPathPattern
- The local Locator-Pattern to which thisRestEndpoint
is bound.aRequestConsumer
- The listener processing a request targeted at thisRestEndpoint
.- Returns:
- The preconfigured
RestEndpoint
which acts as handle to unsubscribe theRestEndpoint
viaObservable.unsubscribeObserver(Object)
.
-
onPost
Even more convenient: Everything done here can also be done usingonRequest(HttpMethod, String, RestRequestConsumer)
: Registers aRestRequestConsumer
with the given Locator-Pattern to incoming POST methods. Attention: InvokeRestEndpointBuilder.open()
to activate this endpoint!- Parameters:
aLocatorRegExp
- The local locator (regular expression) pattern to which thisRestEndpoint
is bound.aRequestConsumer
- The listener processing a request targeted at thisRestEndpoint
.- Returns:
- The preconfigured
RestEndpoint
which acts as handle to unsubscribe theRestEndpoint
viaObservable.unsubscribeObserver(Object)
.
-
onDelete
default RestEndpointBuilder onDelete(String aLocatorPathPattern, RestRequestConsumer aRequestConsumer) Even more convenient: Everything done here can also be done usingonRequest(HttpMethod, String, RestRequestConsumer)
: Registers aRestRequestConsumer
with the given Locator-Pattern to incoming DELETE methods. Attention: InvokeRestEndpointBuilder.open()
to activate this endpoint!- Parameters:
aLocatorPathPattern
- The local Locator-Pattern to which thisRestEndpoint
is bound.aRequestConsumer
- The listener processing a request targeted at thisRestEndpoint
.- Returns:
- The preconfigured
RestEndpoint
which acts as handle to unsubscribe theRestEndpoint
viaObservable.unsubscribeObserver(Object)
.
-
onDelete
Even more convenient: Everything done here can also be done usingonRequest(HttpMethod, String, RestRequestConsumer)
: Registers aRestRequestConsumer
with the given Locator-Pattern to incoming DELETE methods. Attention: InvokeRestEndpointBuilder.open()
to activate this endpoint!- Parameters:
aLocatorRegExp
- The local locator (regular expression) pattern to which thisRestEndpoint
is bound.aRequestConsumer
- The listener processing a request targeted at thisRestEndpoint
.- Returns:
- The preconfigured
RestEndpoint
which acts as handle to unsubscribe theRestEndpoint
viaObservable.unsubscribeObserver(Object)
.
-