Interface RestServer
- All Superinterfaces:
BaseLocatorAccessor, BaseLocatorAccessor.BaseLocatorBuilder<RestServer>, BaseLocatorAccessor.BaseLocatorMutator, BaseLocatorAccessor.BaseLocatorProperty, MediaTypeFactoryLookup, MediaTypeFactoryLookup.MutableMediaTypeFactoryLookup, Observable<RestEndpoint>, Observers<RestEndpoint, RestServer>, RealmAccessor, RealmAccessor.RealmBuilder<RestServer>, RealmAccessor.RealmMutator, RealmAccessor.RealmProperty
- All Known Subinterfaces:
HttpRestRegistryServer<DESC,B>, HttpRestServer
- All Known Implementing Classes:
AbstractHttpRestRegistryServerDecorator, AbstractHttpRestServerDecorator, AbstractRestServer, JdkHttpRestServer, JdkHttpRestServerSingleton, LoopbackRestServer, LoopbackRestServerSingleton
public interface RestServer
extends Observable<RestEndpoint>, Observers<RestEndpoint, RestServer>, MediaTypeFactoryLookup.MutableMediaTypeFactoryLookup, RealmAccessor.RealmProperty, RealmAccessor.RealmBuilder<RestServer>, BaseLocatorAccessor.BaseLocatorProperty, BaseLocatorAccessor.BaseLocatorBuilder<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 RestRequestConsumers of
an RestEndpoint dedicated to an according locator (pattern) for a
specific HttpMethod.-
Nested Class Summary
Nested classes/interfaces inherited from interface BaseLocatorAccessor
BaseLocatorAccessor.BaseLocatorBuilder<B>, BaseLocatorAccessor.BaseLocatorMutator, BaseLocatorAccessor.BaseLocatorPropertyNested classes/interfaces inherited from interface MediaTypeFactoryLookup
MediaTypeFactoryLookup.MutableMediaTypeFactoryLookupNested classes/interfaces inherited from interface RealmAccessor
RealmAccessor.RealmBuilder<B>, RealmAccessor.RealmMutator, RealmAccessor.RealmProperty -
Method Summary
Modifier and TypeMethodDescriptiondefault RestEndpointBuilderonDelete(String aLocatorPathPattern, RestRequestConsumer aRequestConsumer) Even more convenient: Everything done here can also be done usingonRequest(HttpMethod, String, RestRequestConsumer): Registers aRestRequestConsumerwith the given Locator-Pattern to incoming DELETE methods.default RestEndpointBuilderonDelete(Pattern aLocatorRegExp, RestRequestConsumer aRequestConsumer) Even more convenient: Everything done here can also be done usingonRequest(HttpMethod, String, RestRequestConsumer): Registers aRestRequestConsumerwith the given Locator-Pattern to incoming DELETE methods.default RestEndpointBuilderonGet(String aLocatorPathPattern, RestRequestConsumer aRequestConsumer) Even more convenient: Everything done here can also be done usingonRequest(HttpMethod, String, RestRequestConsumer): Registers aRestRequestConsumerwith the given Locator-Pattern to incoming GET methods.default RestEndpointBuilderonGet(Pattern aLocatorRegExp, RestRequestConsumer aRequestConsumer) Even more convenient: Everything done here can also be done usingonRequest(HttpMethod, String, RestRequestConsumer): Registers aRestRequestConsumerwith the given Locator-Pattern to incoming GET methods.default RestEndpointBuilderonPost(String aLocatorPathPattern, RestRequestConsumer aRequestConsumer) Even more convenient: Everything done here can also be done usingonRequest(HttpMethod, String, RestRequestConsumer): Registers aRestRequestConsumerwith the given Locator-Pattern to incoming POST methods.default RestEndpointBuilderonPost(Pattern aLocatorRegExp, RestRequestConsumer aRequestConsumer) Even more convenient: Everything done here can also be done usingonRequest(HttpMethod, String, RestRequestConsumer): Registers aRestRequestConsumerwith the given Locator-Pattern to incoming POST methods.default RestEndpointBuilderonPut(String aLocatorPathPattern, RestRequestConsumer aRequestConsumer) Even more convenient: Everything done here can also be done usingonRequest(HttpMethod, String, RestRequestConsumer): Registers aRestRequestConsumerwith the given Locator-Pattern to incoming PUT methods.default RestEndpointBuilderonPut(Pattern aLocatorRegExp, RestRequestConsumer aRequestConsumer) Even more convenient: Everything done here can also be done usingonRequest(HttpMethod, String, RestRequestConsumer): Registers aRestRequestConsumerwith the given Locator-Pattern to incoming PUT methods.default RestEndpointBuilderonRequest(String aLocatorPathPattern, RestRequestConsumer aRequestConsumer) Registers a preconfiguredRestEndpoint, triggerd by any HTTP method, and returns its instance.default RestEndpointBuilderonRequest(Pattern aLocatorRegExp, RestRequestConsumer aRequestConsumer) Registers a preconfiguredRestEndpoint, triggerd by any HTTP method, and returns its instance.default booleanonRequest(RestEndpoint aRestEndpoint) For the sake of unified naming, this method just delegates toObservable.subscribeObserver(Object).default RestEndpointBuilderonRequest(HttpMethod aHttpMethod, String aLocatorPathPattern, RestRequestConsumer aRequestConsumer) Registers a preconfiguredRestEndpointwith the least required attributes and returns its instance.default RestEndpointBuilderonRequest(HttpMethod aHttpMethod, Pattern aLocatorRegExp, RestRequestConsumer aRequestConsumer) Registers a preconfiguredRestEndpointwith the least required attributes and returns its instance.default RestServerwithBaseLocator(String aBaseLocator) default RestServerdefault RestServerdefault RestServerwithObserversActive(boolean isActive) default RestServerMethods inherited from interface BaseLocatorAccessor
getBaseLocatorMethods inherited from interface BaseLocatorAccessor.BaseLocatorMutator
setBaseLocatorMethods inherited from interface BaseLocatorAccessor.BaseLocatorProperty
letBaseLocatorMethods inherited from interface MediaTypeFactoryLookup
getFactoryMediaTypes, hasMediaTypeFactory, toMediaTypeFactoryMethods inherited from interface MediaTypeFactoryLookup.MutableMediaTypeFactoryLookup
addMediaTypeFactoryMethods inherited from interface Observable
hasObserver, subscribeObserver, unsubscribeObserverMethods inherited from interface Observers
disableObservers, enableObservers, isObserversActive, observers, setObserversActiveMethods inherited from interface RealmAccessor
getRealmMethods inherited from interface RealmAccessor.RealmMutator
setRealmMethods inherited from interface RealmAccessor.RealmProperty
letRealm
-
Method Details
-
withObserversActive
- Specified by:
withObserversActivein interfaceObservers<RestEndpoint, RestServer>
-
withEnableObservers
- Specified by:
withEnableObserversin interfaceObservers<RestEndpoint, RestServer>
-
withDisableObservers
- Specified by:
withDisableObserversin interfaceObservers<RestEndpoint, 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:
withBaseLocatorin interfaceBaseLocatorAccessor.BaseLocatorBuilder<RestServer>
-
withRealm
- Specified by:
withRealmin interfaceRealmAccessor.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 thisRestEndpointis bound.aRequestConsumer- The listener processing a request targeted at thisRestEndpoint.- Returns:
- The preconfigured
RestEndpointwhich acts as handle to unsubscribe theRestEndpointviaObservable.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 thisRestEndpointis bound.aRequestConsumer- The listener processing a request targeted at thisRestEndpoint.- Returns:
- The preconfigured
RestEndpointwhich acts as handle to unsubscribe theRestEndpointviaObservable.unsubscribeObserver(Object).
-
onRequest
default RestEndpointBuilder onRequest(HttpMethod aHttpMethod, String aLocatorPathPattern, RestRequestConsumer aRequestConsumer) Registers a preconfiguredRestEndpointwith 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 thisRestEndpointis bound. A value ofnullmeans that any HTTP-Method may trigger thisRestEndpoint.aLocatorPathPattern- The local Locator-Pattern to which thisRestEndpointis bound. A value ofnullmeans that any locator may trigger thisRestEndpoint.aRequestConsumer- The listener processing a request targeted at thisRestEndpoint.- Returns:
- The preconfigured
RestEndpointwhich acts as handle to unsubscribe theRestEndpointviaObservable.unsubscribeObserver(Object).
-
onRequest
default RestEndpointBuilder onRequest(HttpMethod aHttpMethod, Pattern aLocatorRegExp, RestRequestConsumer aRequestConsumer) Registers a preconfiguredRestEndpointwith 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 thisRestEndpointis bound. A value ofnullmeans that any HTTP-Method may trigger thisRestEndpoint.aLocatorRegExp- The local locator (regular expression) pattern to which thisRestEndpointis bound. A value ofnullmeans that any locator may trigger thisRestEndpoint.aRequestConsumer- The listener processing a request targeted at thisRestEndpoint.- Returns:
- The preconfigured
RestEndpointwhich acts as handle to unsubscribe theRestEndpointviaObservable.unsubscribeObserver(Object).
-
onGet
Even more convenient: Everything done here can also be done usingonRequest(HttpMethod, String, RestRequestConsumer): Registers aRestRequestConsumerwith the given Locator-Pattern to incoming GET methods. Attention: InvokeRestEndpointBuilder.open()to activate this endpoint!- Parameters:
aLocatorPathPattern- The local Locator-Pattern to which thisRestEndpointis bound.aRequestConsumer- The listener processing a request targeted at thisRestEndpoint.- Returns:
- The preconfigured
RestEndpointwhich acts as handle to unsubscribe theRestEndpointviaObservable.unsubscribeObserver(Object).
-
onGet
Even more convenient: Everything done here can also be done usingonRequest(HttpMethod, String, RestRequestConsumer): Registers aRestRequestConsumerwith 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 thisRestEndpointis bound.aRequestConsumer- The listener processing a request targeted at thisRestEndpoint.- Returns:
- The preconfigured
RestEndpointwhich acts as handle to unsubscribe theRestEndpointviaObservable.unsubscribeObserver(Object).
-
onPut
Even more convenient: Everything done here can also be done usingonRequest(HttpMethod, String, RestRequestConsumer): Registers aRestRequestConsumerwith the given Locator-Pattern to incoming PUT methods. Attention: InvokeRestEndpointBuilder.open()to activate this endpoint!- Parameters:
aLocatorPathPattern- The local Locator-Pattern to which thisRestEndpointis bound.aRequestConsumer- The listener processing a request targeted at thisRestEndpoint.- Returns:
- The preconfigured
RestEndpointwhich acts as handle to unsubscribe theRestEndpointviaObservable.unsubscribeObserver(Object).
-
onPut
Even more convenient: Everything done here can also be done usingonRequest(HttpMethod, String, RestRequestConsumer): Registers aRestRequestConsumerwith 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 thisRestEndpointis bound.aRequestConsumer- The listener processing a request targeted at thisRestEndpoint.- Returns:
- The preconfigured
RestEndpointwhich acts as handle to unsubscribe theRestEndpointviaObservable.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 aRestRequestConsumerwith the given Locator-Pattern to incoming POST methods. Attention: InvokeRestEndpointBuilder.open()to activate this endpoint!- Parameters:
aLocatorPathPattern- The local Locator-Pattern to which thisRestEndpointis bound.aRequestConsumer- The listener processing a request targeted at thisRestEndpoint.- Returns:
- The preconfigured
RestEndpointwhich acts as handle to unsubscribe theRestEndpointviaObservable.unsubscribeObserver(Object).
-
onPost
Even more convenient: Everything done here can also be done usingonRequest(HttpMethod, String, RestRequestConsumer): Registers aRestRequestConsumerwith 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 thisRestEndpointis bound.aRequestConsumer- The listener processing a request targeted at thisRestEndpoint.- Returns:
- The preconfigured
RestEndpointwhich acts as handle to unsubscribe theRestEndpointviaObservable.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 aRestRequestConsumerwith the given Locator-Pattern to incoming DELETE methods. Attention: InvokeRestEndpointBuilder.open()to activate this endpoint!- Parameters:
aLocatorPathPattern- The local Locator-Pattern to which thisRestEndpointis bound.aRequestConsumer- The listener processing a request targeted at thisRestEndpoint.- Returns:
- The preconfigured
RestEndpointwhich acts as handle to unsubscribe theRestEndpointviaObservable.unsubscribeObserver(Object).
-
onDelete
Even more convenient: Everything done here can also be done usingonRequest(HttpMethod, String, RestRequestConsumer): Registers aRestRequestConsumerwith 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 thisRestEndpointis bound.aRequestConsumer- The listener processing a request targeted at thisRestEndpoint.- Returns:
- The preconfigured
RestEndpointwhich acts as handle to unsubscribe theRestEndpointviaObservable.unsubscribeObserver(Object).
-