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>
TheRestServer
acts as the target for clients issuing REST requests.RestEndpointBuilder
instances, most easily being created with theonRequest(HttpMethod, String, RestRequestObserver)
method (or the like), are registered as listeners to theRestServer
(HttpRestServer
). TheRestServer
(HttpRestServer
) firesRestRequestEvent
events to theRestRequestObserver
s of anRestEndpoint
dedicated 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 RestEndpointBuilder
onDelete(java.lang.String aLocatorPattern, RestRequestObserver aRequestObserver)
Even more convenient: Everything done here can also be done usingonRequest(HttpMethod, String, RestRequestObserver)
: Registers aRestRequestObserver
with the given Locator-Pattern to incoming DELETE methods.default RestEndpointBuilder
onGet(java.lang.String aLocatorPattern, RestRequestObserver aRequestObserver)
Even more convenient: Everything done here can also be done usingonRequest(HttpMethod, String, RestRequestObserver)
: Registers aRestRequestObserver
with the given Locator-Pattern to incoming GET methods.default RestEndpointBuilder
onPost(java.lang.String aLocatorPattern, RestRequestObserver aRequestObserver)
Even more convenient: Everything done here can also be done usingonRequest(HttpMethod, String, RestRequestObserver)
: Registers aRestRequestObserver
with the given Locator-Pattern to incoming POST methods.default RestEndpointBuilder
onPut(java.lang.String aLocatorPattern, RestRequestObserver aRequestObserver)
Even more convenient: Everything done here can also be done usingonRequest(HttpMethod, String, RestRequestObserver)
: Registers aRestRequestObserver
with the given Locator-Pattern to incoming PUT methods.default RestEndpointBuilder
onRequest(java.lang.String aLocatorPattern, RestRequestObserver aRequestObserver)
Registers a pre-configuredRestEndpoint
, triggerd by any HTTP method, and returns its instance.default RestEndpointBuilder
onRequest(org.refcodes.net.HttpMethod aHttpMethod, java.lang.String aLocatorPattern, RestRequestObserver aRequestObserver)
Registers a pre-configuredRestEndpoint
with the least required attributes and returns its instance.default boolean
onRequest(RestEndpoint aRestEndpoint)
For the sake of unified naming, this method just delegates toObservable.subscribeObserver(Object)
.default RestServer
withBaseLocator(java.lang.String aBaseLocator)
default RestServer
withDisableObservers()
default RestServer
withDisableRequestCorrelation()
default RestServer
withDisableSessionCorrelation()
default RestServer
withEnableObservers()
default RestServer
withEnableRequestCorrelation()
default RestServer
withEnableSessionCorrelation()
default RestServer
withObserversActive(boolean isActive)
default RestServer
withRealm(java.lang.String aRealm)
default RestServer
withRequestCorrelation(boolean hasRequestCorrelation)
default RestServer
withSessionCorrelation(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:
withObserversActive
in interfaceorg.refcodes.observer.Observers<RestEndpoint,RestServer>
-
withEnableObservers
default RestServer withEnableObservers()
- Specified by:
withEnableObservers
in interfaceorg.refcodes.observer.Observers<RestEndpoint,RestServer>
-
withDisableObservers
default RestServer withDisableObservers()
- Specified by:
withDisableObservers
in interfaceorg.refcodes.observer.Observers<RestEndpoint,RestServer>
-
withSessionCorrelation
default RestServer withSessionCorrelation(boolean hasSessionCorrelation)
- Specified by:
withSessionCorrelation
in interfaceorg.refcodes.runtime.SessionCorrelation<RestServer>
-
withEnableSessionCorrelation
default RestServer withEnableSessionCorrelation()
- Specified by:
withEnableSessionCorrelation
in interfaceorg.refcodes.runtime.SessionCorrelation<RestServer>
-
withDisableSessionCorrelation
default RestServer withDisableSessionCorrelation()
- Specified by:
withDisableSessionCorrelation
in interfaceorg.refcodes.runtime.SessionCorrelation<RestServer>
-
withRequestCorrelation
default RestServer withRequestCorrelation(boolean hasRequestCorrelation)
- Specified by:
withRequestCorrelation
in interfaceorg.refcodes.runtime.RequestCorrelation<RestServer>
-
withEnableRequestCorrelation
default RestServer withEnableRequestCorrelation()
- Specified by:
withEnableRequestCorrelation
in interfaceorg.refcodes.runtime.RequestCorrelation<RestServer>
-
withDisableRequestCorrelation
default RestServer withDisableRequestCorrelation()
- Specified by:
withDisableRequestCorrelation
in 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:
withBaseLocator
in interfaceorg.refcodes.net.BaseLocatorAccessor.BaseLocatorBuilder<RestServer>
-
withRealm
default RestServer withRealm(java.lang.String aRealm)
- Specified by:
withRealm
in 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 thisRestEndpoint
is bound.aRequestObserver
- The listener processing a request targeted at thisRestEndpoint
.- Returns:
- The pre-configured
RestEndpoint
which acts as handle to unsubscribe theRestEndpoint
viaObservable.unsubscribeObserver(Object)
.
-
onRequest
default RestEndpointBuilder onRequest(org.refcodes.net.HttpMethod aHttpMethod, java.lang.String aLocatorPattern, RestRequestObserver aRequestObserver)
Registers a pre-configuredRestEndpoint
with 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 thisRestEndpoint
is bound. A value ofnull
means that any HTTP-Method may trigger thisRestEndpoint
.aLocatorPattern
- The local Locator-Pattern to which thisRestEndpoint
is bound. A value ofnull
means that any locator may trigger thisRestEndpoint
.aRequestObserver
- The listener processing a request targeted at thisRestEndpoint
.- Returns:
- The pre-configured
RestEndpoint
which acts as handle to unsubscribe theRestEndpoint
viaObservable.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 aRestRequestObserver
with the given Locator-Pattern to incoming GET methods. Attention: InvokeOpenable.open()
to activate this endpoint!- Parameters:
aLocatorPattern
- The local Locator-Pattern to which thisRestEndpoint
is bound.aRequestObserver
- The listener processing a request targeted at thisRestEndpoint
.- Returns:
- The pre-configured
RestEndpoint
which acts as handle to unsubscribe theRestEndpoint
viaObservable.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 aRestRequestObserver
with the given Locator-Pattern to incoming PUT methods. Attention: InvokeOpenable.open()
to activate this endpoint!- Parameters:
aLocatorPattern
- The local Locator-Pattern to which thisRestEndpoint
is bound.aRequestObserver
- The listener processing a request targeted at thisRestEndpoint
.- Returns:
- The pre-configured
RestEndpoint
which acts as handle to unsubscribe theRestEndpoint
viaObservable.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 aRestRequestObserver
with the given Locator-Pattern to incoming POST methods. Attention: InvokeOpenable.open()
to activate this endpoint!- Parameters:
aLocatorPattern
- The local Locator-Pattern to which thisRestEndpoint
is bound.aRequestObserver
- The listener processing a request targeted at thisRestEndpoint
.- Returns:
- The pre-configured
RestEndpoint
which acts as handle to unsubscribe theRestEndpoint
viaObservable.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 aRestRequestObserver
with the given Locator-Pattern to incoming DELETE methods. Attention: InvokeOpenable.open()
to activate this endpoint!- Parameters:
aLocatorPattern
- The local Locator-Pattern to which thisRestEndpoint
is bound.aRequestObserver
- The listener processing a request targeted at thisRestEndpoint
.- Returns:
- The pre-configured
RestEndpoint
which acts as handle to unsubscribe theRestEndpoint
viaObservable.unsubscribeObserver(Object)
.
-
-