Package org.refcodes.rest
Interface LoopbackRestServer
-
- 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<RestServer>,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>,RestServer,org.refcodes.runtime.SessionCorrelation<RestServer>
- All Known Implementing Classes:
LoopbackRestServerImpl,LoopbackRestServerSingleton
public interface LoopbackRestServer extends RestServer
Extends aRestServerto be used as loopback device e.g. for testing purposes such as testing yourRestRequestObserverimplementations. Use theonHttpRequest(InetSocketAddress, InetSocketAddress, HttpMethod, Url, RequestHeaderFields, InputStream, HttpServerResponse)method to simulate REST requests on theLoopbackRestServer. An registeredRestEndpointinstances being targeted at will be invoked accordingly.
-
-
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 Abstract Methods Default Methods Modifier and Type Method Description voidonHttpRequest(java.net.InetSocketAddress aLocalAddress, java.net.InetSocketAddress aClientAddress, org.refcodes.net.HttpMethod aHttpMethod, org.refcodes.net.Url aUrl, org.refcodes.net.RequestHeaderFields aRequestHeaderFields, java.io.InputStream aHttpInputStream, org.refcodes.net.HttpServerResponse aHttpServerResponse)Invoke this method to simulate a REST request to be handled by the according registeredRestEndpointinstances:.voidonHttpRequest(java.net.InetSocketAddress aLocalAddress, java.net.InetSocketAddress aClientAddress, org.refcodes.net.HttpMethod aHttpMethod, org.refcodes.net.Url aUrl, org.refcodes.net.RequestHeaderFields aRequestHeaderFields, java.lang.String aHttpBody, org.refcodes.net.HttpServerResponse aHttpServerResponse)Invoke this method to simulate a REST request to be handled by the according registeredRestEndpointinstances:default LoopbackRestServerwithBaseLocator(java.lang.String aBaseLocator)default LoopbackRestServerwithHttpExceptionHandler(HttpExceptionHandler aHttpErrorHandler)Sets theHttpExceptionHandlerfor theHttpExceptionHandlerproperty.default LoopbackRestServerwithHttpExceptionHandling(HttpExceptionHandling aHttpErrorHandling)Sets theHttpExceptionHandlingfor theHttpExceptionHandlingproperty.default LoopbackRestServerwithRealm(java.lang.String aRealm)-
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
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.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
-
Methods inherited from interface org.refcodes.runtime.RequestCorrelation
disableRequestCorrelation, enableRequestCorrelation, hasRequestCorrelation, setRequestCorrelation
-
Methods inherited from interface org.refcodes.rest.RestServer
onDelete, onGet, onPost, onPut, onRequest, onRequest, onRequest, withDisableObservers, withDisableRequestCorrelation, withDisableSessionCorrelation, withEnableObservers, withEnableRequestCorrelation, withEnableSessionCorrelation, withObserversActive, withRequestCorrelation, withSessionCorrelation
-
-
-
-
Method Detail
-
onHttpRequest
void onHttpRequest(java.net.InetSocketAddress aLocalAddress, java.net.InetSocketAddress aClientAddress, org.refcodes.net.HttpMethod aHttpMethod, org.refcodes.net.Url aUrl, org.refcodes.net.RequestHeaderFields aRequestHeaderFields, java.lang.String aHttpBody, org.refcodes.net.HttpServerResponse aHttpServerResponse) throws org.refcodes.net.HttpStatusExceptionInvoke this method to simulate a REST request to be handled by the according registeredRestEndpointinstances:- Parameters:
aLocalAddress- the local addressaClientAddress- the client addressaHttpMethod- The method for the simulated REST request to be usedaUrl- The query string part of the request.aRequestHeaderFields- The simulated REST request's Header-Fields to be usedaHttpBody- The raw body for the simulated REST request to be used.aHttpServerResponse- TheHttpServerResponseto be filled with the complete result of processing the request.- Throws:
org.refcodes.net.HttpStatusException- the http status exception
-
onHttpRequest
void onHttpRequest(java.net.InetSocketAddress aLocalAddress, java.net.InetSocketAddress aClientAddress, org.refcodes.net.HttpMethod aHttpMethod, org.refcodes.net.Url aUrl, org.refcodes.net.RequestHeaderFields aRequestHeaderFields, java.io.InputStream aHttpInputStream, org.refcodes.net.HttpServerResponse aHttpServerResponse) throws org.refcodes.net.HttpStatusExceptionInvoke this method to simulate a REST request to be handled by the according registeredRestEndpointinstances:.- Parameters:
aLocalAddress- the local addressaClientAddress- the client addressaHttpMethod- The method for the simulated REST request to be usedaUrl- The query string part of the request.aRequestHeaderFields- The simulated REST request's Header-Fields to be usedaHttpInputStream- The HTTPInputStreamrepresenting the body for the simulated REST request to be used.aHttpServerResponse- TheHttpServerResponseto be filled with the complete result of processing the request.- Throws:
org.refcodes.net.HttpStatusException- the http status exception
-
withHttpExceptionHandler
default LoopbackRestServer withHttpExceptionHandler(HttpExceptionHandler aHttpErrorHandler)
Sets theHttpExceptionHandlerfor theHttpExceptionHandlerproperty.- Specified by:
withHttpExceptionHandlerin interfaceHttpExceptionHandlerAccessor.HttpExceptionHandlerBuilder<RestServer>- Parameters:
aHttpErrorHandler- TheHttpExceptionHandlerto be stored by theHttpExceptionHandlerproperty.- Returns:
- The builder for applying multiple build operations.
-
withHttpExceptionHandling
default LoopbackRestServer withHttpExceptionHandling(HttpExceptionHandling aHttpErrorHandling)
Sets theHttpExceptionHandlingfor theHttpExceptionHandlingproperty.- Specified by:
withHttpExceptionHandlingin interfaceHttpExceptionHandlingAccessor.HttpExceptionHandlingBuilder<RestServer>- Parameters:
aHttpErrorHandling- TheHttpExceptionHandlingto be stored by theHttpExceptionHandlingproperty.- Returns:
- The builder for applying multiple build operations.
-
withRealm
default LoopbackRestServer withRealm(java.lang.String aRealm)
- Specified by:
withRealmin interfaceorg.refcodes.net.RealmAccessor.RealmBuilder<RestServer>- Specified by:
withRealmin interfaceRestServer
-
withBaseLocator
default LoopbackRestServer withBaseLocator(java.lang.String aBaseLocator)
- Specified by:
withBaseLocatorin interfaceorg.refcodes.net.BaseLocatorAccessor.BaseLocatorBuilder<RestServer>- Specified by:
withBaseLocatorin interfaceRestServer
-
-