- All Superinterfaces:
org.refcodes.web.BaseLocatorAccessor,org.refcodes.web.BaseLocatorAccessor.BaseLocatorBuilder<RestfulServer>,org.refcodes.web.BaseLocatorAccessor.BaseLocatorMutator,org.refcodes.web.BaseLocatorAccessor.BaseLocatorProperty,org.refcodes.web.MediaTypeFactoryLookup,org.refcodes.web.MediaTypeFactoryLookup.MutableMediaTypeFactoryLookup,org.refcodes.observer.Observable<RestEndpoint>,org.refcodes.observer.Observers<RestEndpoint,,RestfulServer> org.refcodes.web.RealmAccessor,org.refcodes.web.RealmAccessor.RealmBuilder<RestfulServer>,org.refcodes.web.RealmAccessor.RealmMutator,org.refcodes.web.RealmAccessor.RealmProperty
- All Known Subinterfaces:
RestfulHttpRegistryServer<DESC,,B> RestfulHttpServer
- All Known Implementing Classes:
AbstractRestfulHttpRegistryServerDecorator,AbstractRestfulHttpServerDecorator,AbstractRestfulServer,HttpRestServer,HttpRestServerSingleton,LoopbackRestServer,LoopbackRestServerSingleton
public interface RestfulServer
extends org.refcodes.observer.Observable<RestEndpoint>, org.refcodes.observer.Observers<RestEndpoint,RestfulServer>, org.refcodes.web.MediaTypeFactoryLookup.MutableMediaTypeFactoryLookup, org.refcodes.web.RealmAccessor.RealmProperty, org.refcodes.web.RealmAccessor.RealmBuilder<RestfulServer>, org.refcodes.web.BaseLocatorAccessor.BaseLocatorProperty, org.refcodes.web.BaseLocatorAccessor.BaseLocatorBuilder<RestfulServer>
The
RestfulServer 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 RestfulServer (
RestfulHttpServer). The RestfulServer
(RestfulHttpServer) 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 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.BaseLocatorPropertyNested classes/interfaces inherited from interface org.refcodes.web.MediaTypeFactoryLookup
org.refcodes.web.MediaTypeFactoryLookup.MutableMediaTypeFactoryLookupNested 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 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(org.refcodes.web.HttpMethod aHttpMethod, String aLocatorPathPattern, RestRequestConsumer aRequestConsumer) Registers a preconfiguredRestEndpointwith the least required attributes and returns its instance.default RestEndpointBuilderonRequest(org.refcodes.web.HttpMethod aHttpMethod, Pattern aLocatorRegExp, RestRequestConsumer aRequestConsumer) Registers a preconfiguredRestEndpointwith the least required attributes and returns its instance.default RestfulServerwithBaseLocator(String aBaseLocator) default RestfulServerdefault RestfulServerdefault RestfulServerwithObserversActive(boolean isActive) default RestfulServerMethods inherited from interface org.refcodes.web.BaseLocatorAccessor
getBaseLocatorMethods inherited from interface org.refcodes.web.BaseLocatorAccessor.BaseLocatorMutator
setBaseLocatorMethods inherited from interface org.refcodes.web.BaseLocatorAccessor.BaseLocatorProperty
letBaseLocatorMethods inherited from interface org.refcodes.web.MediaTypeFactoryLookup
getFactoryMediaTypes, hasMediaTypeFactory, toMediaTypeFactoryMethods inherited from interface org.refcodes.web.MediaTypeFactoryLookup.MutableMediaTypeFactoryLookup
addMediaTypeFactoryMethods inherited from interface org.refcodes.observer.Observable
hasObserver, subscribeObserver, unsubscribeObserverMethods inherited from interface org.refcodes.observer.Observers
disableObservers, enableObservers, isObserversActive, observers, setObserversActiveMethods inherited from interface org.refcodes.web.RealmAccessor
getRealmMethods inherited from interface org.refcodes.web.RealmAccessor.RealmMutator
setRealmMethods inherited from interface org.refcodes.web.RealmAccessor.RealmProperty
letRealm
-
Method Details
-
withObserversActive
- Specified by:
withObserversActivein interfaceorg.refcodes.observer.Observers<RestEndpoint,RestfulServer>
-
withEnableObservers
- Specified by:
withEnableObserversin interfaceorg.refcodes.observer.Observers<RestEndpoint,RestfulServer>
-
withDisableObservers
- Specified by:
withDisableObserversin interfaceorg.refcodes.observer.Observers<RestEndpoint,RestfulServer>
-
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 interfaceorg.refcodes.web.BaseLocatorAccessor.BaseLocatorBuilder<RestfulServer>
-
withRealm
- Specified by:
withRealmin interfaceorg.refcodes.web.RealmAccessor.RealmBuilder<RestfulServer>
-
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(org.refcodes.web.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(org.refcodes.web.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).
-