Package org.refcodes.rest
Interface RestServer
-
- All Superinterfaces:
org.refcodes.net.BaseLocatorAccessor,org.refcodes.net.BaseLocatorAccessor.BaseLocatorBuilder<RestServer>,org.refcodes.net.BaseLocatorAccessor.BaseLocatorMutator,org.refcodes.net.BaseLocatorAccessor.BaseLocatorProperty,HttpExceptionHandlerAccessor,HttpExceptionHandlerAccessor.HttpExceptionHandlerBuilder<RestServer>,HttpExceptionHandlerAccessor.HttpExceptionHandlerMutator,HttpExceptionHandlerAccessor.HttpExceptionHandlerProperty,HttpExceptionHandlingAccessor,HttpExceptionHandlingAccessor.HttpExceptionHandlingBuilder<RestServer>,HttpExceptionHandlingAccessor.HttpExceptionHandlingMutator,HttpExceptionHandlingAccessor.HttpExceptionHandlingProperty,org.refcodes.net.MediaTypeFactoryLookup,org.refcodes.net.MediaTypeFactoryLookup.MutableMediaTypeFactoryLookup,org.refcodes.observer.Observable<RestEndpoint>,org.refcodes.observer.Observers<RestEndpoint,RestServer>,org.refcodes.net.RealmAccessor,org.refcodes.net.RealmAccessor.RealmBuilder<RestServer>,org.refcodes.net.RealmAccessor.RealmMutator,org.refcodes.net.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.net.MediaTypeFactoryLookup.MutableMediaTypeFactoryLookup, org.refcodes.net.RealmAccessor.RealmProperty, org.refcodes.net.RealmAccessor.RealmBuilder<RestServer>, org.refcodes.net.BaseLocatorAccessor.BaseLocatorProperty, org.refcodes.net.BaseLocatorAccessor.BaseLocatorBuilder<RestServer>, org.refcodes.runtime.RequestCorrelation<RestServer>, org.refcodes.runtime.SessionCorrelation<RestServer>
TheRestServeracts as the target for clients issuing REST requests.RestEndpointBuilderinstances, most easily being created with theonRequest(HttpMethod, String, RestRequestObserver)method (or the like), are registered as listeners to theRestServer(HttpRestServer). TheRestServer(HttpRestServer) firesRestRequestEventevents to theRestRequestObservers of anRestEndpointdedicated to an according locator (pattern) for a specificHttpMethod.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.refcodes.net.BaseLocatorAccessor
org.refcodes.net.BaseLocatorAccessor.BaseLocatorBuilder<B extends org.refcodes.net.BaseLocatorAccessor.BaseLocatorBuilder<B>>, org.refcodes.net.BaseLocatorAccessor.BaseLocatorMutator, org.refcodes.net.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
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default RestEndpointBuilderonDelete(java.lang.String aLocatorPattern, RestRequestObserver aRequestObserver)Even more convenient: Everything done here can also be done usingonRequest(HttpMethod, String, RestRequestObserver): Registers aRestRequestObserverwith the given Locator-Pattern to incoming DELETE methods.default RestEndpointBuilderonGet(java.lang.String aLocatorPattern, RestRequestObserver aRequestObserver)Even more convenient: Everything done here can also be done usingonRequest(HttpMethod, String, RestRequestObserver): Registers aRestRequestObserverwith the given Locator-Pattern to incoming GET methods.default RestEndpointBuilderonPost(java.lang.String aLocatorPattern, RestRequestObserver aRequestObserver)Even more convenient: Everything done here can also be done usingonRequest(HttpMethod, String, RestRequestObserver): Registers aRestRequestObserverwith the given Locator-Pattern to incoming POST methods.default RestEndpointBuilderonPut(java.lang.String aLocatorPattern, RestRequestObserver aRequestObserver)Even more convenient: Everything done here can also be done usingonRequest(HttpMethod, String, RestRequestObserver): Registers aRestRequestObserverwith the given Locator-Pattern to incoming PUT methods.default RestEndpointBuilderonRequest(java.lang.String aLocatorPattern, RestRequestObserver aRequestObserver)Registers a pre-configuredRestEndpoint, triggerd by any HTTP method, and returns its instance.default RestEndpointBuilderonRequest(org.refcodes.net.HttpMethod aHttpMethod, java.lang.String aLocatorPattern, RestRequestObserver aRequestObserver)Registers a pre-configuredRestEndpointwith the least required attributes and returns its instance.default booleanonRequest(RestEndpoint aRestEndpoint)For the sake of unified naming, this method just delegates toObservable.subscribeObserver(Object).default RestServerwithBaseLocator(java.lang.String aBaseLocator)default RestServerwithDisableObservers()default RestServerwithDisableRequestCorrelation()default RestServerwithDisableSessionCorrelation()default RestServerwithEnableObservers()default RestServerwithEnableRequestCorrelation()default RestServerwithEnableSessionCorrelation()default RestServerwithObserversActive(boolean isActive)default RestServerwithRealm(java.lang.String aRealm)default RestServerwithRequestCorrelation(boolean hasRequestCorrelation)default RestServerwithSessionCorrelation(boolean hasSessionCorrelation)-
Methods inherited from interface org.refcodes.net.BaseLocatorAccessor.BaseLocatorMutator
setBaseLocator
-
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.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.net.MediaTypeFactoryLookup
getFactoryMediaTypes, hasMediaTypeFactory, toMediaTypeFactory
-
Methods inherited from interface org.refcodes.net.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
-
-
-
-
Method Detail
-
withObserversActive
default RestServer withObserversActive(boolean isActive)
- Specified by:
withObserversActivein interfaceorg.refcodes.observer.Observers<RestEndpoint,RestServer>
-
withEnableObservers
default RestServer withEnableObservers()
- Specified by:
withEnableObserversin interfaceorg.refcodes.observer.Observers<RestEndpoint,RestServer>
-
withDisableObservers
default RestServer withDisableObservers()
- Specified by:
withDisableObserversin interfaceorg.refcodes.observer.Observers<RestEndpoint,RestServer>
-
withSessionCorrelation
default RestServer withSessionCorrelation(boolean hasSessionCorrelation)
- Specified by:
withSessionCorrelationin interfaceorg.refcodes.runtime.SessionCorrelation<RestServer>
-
withEnableSessionCorrelation
default RestServer withEnableSessionCorrelation()
- Specified by:
withEnableSessionCorrelationin interfaceorg.refcodes.runtime.SessionCorrelation<RestServer>
-
withDisableSessionCorrelation
default RestServer withDisableSessionCorrelation()
- Specified by:
withDisableSessionCorrelationin interfaceorg.refcodes.runtime.SessionCorrelation<RestServer>
-
withRequestCorrelation
default RestServer withRequestCorrelation(boolean hasRequestCorrelation)
- Specified by:
withRequestCorrelationin interfaceorg.refcodes.runtime.RequestCorrelation<RestServer>
-
withEnableRequestCorrelation
default RestServer withEnableRequestCorrelation()
- Specified by:
withEnableRequestCorrelationin interfaceorg.refcodes.runtime.RequestCorrelation<RestServer>
-
withDisableRequestCorrelation
default RestServer withDisableRequestCorrelation()
- Specified by:
withDisableRequestCorrelationin interfaceorg.refcodes.runtime.RequestCorrelation<RestServer>
-
onRequest
default boolean onRequest(RestEndpoint aRestEndpoint)
For the sake of unified naming, this method just delegates toObservable.subscribeObserver(Object).- Parameters:
aRestEndpoint- the rest endpoint- Returns:
- true, if successful
-
withBaseLocator
default RestServer withBaseLocator(java.lang.String aBaseLocator)
- Specified by:
withBaseLocatorin interfaceorg.refcodes.net.BaseLocatorAccessor.BaseLocatorBuilder<RestServer>
-
withRealm
default RestServer withRealm(java.lang.String aRealm)
- Specified by:
withRealmin interfaceorg.refcodes.net.RealmAccessor.RealmBuilder<RestServer>
-
onRequest
default RestEndpointBuilder onRequest(java.lang.String aLocatorPattern, RestRequestObserver aRequestObserver)
Registers a pre-configuredRestEndpoint, triggerd by any HTTP method, and returns its instance. To unsubscribe viaObservable.unsubscribeObserver(Object), use the returned instance. Attention: InvokeOpenable.open()to activate this endpoint!- Parameters:
aLocatorPattern- The local Locator-Pattern to which thisRestEndpointis bound.aRequestObserver- The listener processing a request targeted at thisRestEndpoint.- Returns:
- The pre-configured
RestEndpointwhich acts as handle to unsubscribe theRestEndpointviaObservable.unsubscribeObserver(Object).
-
onRequest
default RestEndpointBuilder onRequest(org.refcodes.net.HttpMethod aHttpMethod, java.lang.String aLocatorPattern, RestRequestObserver aRequestObserver)
Registers a pre-configuredRestEndpointwith the least required attributes and returns its instance. To unsubscribe viaObservable.unsubscribeObserver(Object), use the returned instance. Attention: InvokeOpenable.open()to activate this endpoint!- Parameters:
aHttpMethod- The HTTP-Method to which thisRestEndpointis bound. A value ofnullmeans that any HTTP-Method may trigger thisRestEndpoint.aLocatorPattern- The local Locator-Pattern to which thisRestEndpointis bound. A value ofnullmeans that any locator may trigger thisRestEndpoint.aRequestObserver- The listener processing a request targeted at thisRestEndpoint.- Returns:
- The pre-configured
RestEndpointwhich acts as handle to unsubscribe theRestEndpointviaObservable.unsubscribeObserver(Object).
-
onGet
default RestEndpointBuilder onGet(java.lang.String aLocatorPattern, RestRequestObserver aRequestObserver)
Even more convenient: Everything done here can also be done usingonRequest(HttpMethod, String, RestRequestObserver): Registers aRestRequestObserverwith the given Locator-Pattern to incoming GET methods. Attention: InvokeOpenable.open()to activate this endpoint!- Parameters:
aLocatorPattern- The local Locator-Pattern to which thisRestEndpointis bound.aRequestObserver- The listener processing a request targeted at thisRestEndpoint.- Returns:
- The pre-configured
RestEndpointwhich acts as handle to unsubscribe theRestEndpointviaObservable.unsubscribeObserver(Object).
-
onPut
default RestEndpointBuilder onPut(java.lang.String aLocatorPattern, RestRequestObserver aRequestObserver)
Even more convenient: Everything done here can also be done usingonRequest(HttpMethod, String, RestRequestObserver): Registers aRestRequestObserverwith the given Locator-Pattern to incoming PUT methods. Attention: InvokeOpenable.open()to activate this endpoint!- Parameters:
aLocatorPattern- The local Locator-Pattern to which thisRestEndpointis bound.aRequestObserver- The listener processing a request targeted at thisRestEndpoint.- Returns:
- The pre-configured
RestEndpointwhich acts as handle to unsubscribe theRestEndpointviaObservable.unsubscribeObserver(Object).
-
onPost
default RestEndpointBuilder onPost(java.lang.String aLocatorPattern, RestRequestObserver aRequestObserver)
Even more convenient: Everything done here can also be done usingonRequest(HttpMethod, String, RestRequestObserver): Registers aRestRequestObserverwith the given Locator-Pattern to incoming POST methods. Attention: InvokeOpenable.open()to activate this endpoint!- Parameters:
aLocatorPattern- The local Locator-Pattern to which thisRestEndpointis bound.aRequestObserver- The listener processing a request targeted at thisRestEndpoint.- Returns:
- The pre-configured
RestEndpointwhich acts as handle to unsubscribe theRestEndpointviaObservable.unsubscribeObserver(Object).
-
onDelete
default RestEndpointBuilder onDelete(java.lang.String aLocatorPattern, RestRequestObserver aRequestObserver)
Even more convenient: Everything done here can also be done usingonRequest(HttpMethod, String, RestRequestObserver): Registers aRestRequestObserverwith the given Locator-Pattern to incoming DELETE methods. Attention: InvokeOpenable.open()to activate this endpoint!- Parameters:
aLocatorPattern- The local Locator-Pattern to which thisRestEndpointis bound.aRequestObserver- The listener processing a request targeted at thisRestEndpoint.- Returns:
- The pre-configured
RestEndpointwhich acts as handle to unsubscribe theRestEndpointviaObservable.unsubscribeObserver(Object).
-
-