-
- All Superinterfaces:
org.refcodes.web.BaseLocatorAccessor
,org.refcodes.web.BaseLocatorAccessor.BaseLocatorBuilder<RestServer>
,org.refcodes.web.BaseLocatorAccessor.BaseLocatorMutator
,org.refcodes.web.BaseLocatorAccessor.BaseLocatorProperty
,HttpExceptionHandlerAccessor
,HttpExceptionHandlerAccessor.HttpExceptionHandlerBuilder<RestServer>
,HttpExceptionHandlerAccessor.HttpExceptionHandlerMutator
,HttpExceptionHandlerAccessor.HttpExceptionHandlerProperty
,HttpExceptionHandlingAccessor
,HttpExceptionHandlingAccessor.HttpExceptionHandlingBuilder<RestServer>
,HttpExceptionHandlingAccessor.HttpExceptionHandlingMutator
,HttpExceptionHandlingAccessor.HttpExceptionHandlingProperty
,org.refcodes.web.MediaTypeFactoryLookup
,org.refcodes.web.MediaTypeFactoryLookup.MutableMediaTypeFactoryLookup
,org.refcodes.observer.Observable<RestEndpoint>
,org.refcodes.observer.Observers<RestEndpoint,RestServer>
,org.refcodes.web.RealmAccessor
,org.refcodes.web.RealmAccessor.RealmBuilder<RestServer>
,org.refcodes.web.RealmAccessor.RealmMutator
,org.refcodes.web.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 aRestServer
to be used as loopback device e.g. for testing purposes such as testing yourRestRequestConsumer
implementations. Use theonHttpRequest(InetSocketAddress, InetSocketAddress, HttpMethod, Url, RequestHeaderFields, InputStream, HttpServerResponse)
method to simulate REST requests on theLoopbackRestServer
. An registeredRestEndpoint
instances being targeted at will be invoked accordingly.
-
-
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.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 void
onHttpRequest(InetSocketAddress aLocalAddress, InetSocketAddress aClientAddress, org.refcodes.web.HttpMethod aHttpMethod, org.refcodes.web.Url aUrl, org.refcodes.web.RequestHeaderFields aRequestHeaderFields, InputStream aHttpInputStream, org.refcodes.web.HttpServerResponse aHttpServerResponse)
Invoke this method to simulate a REST request to be handled by the according registeredRestEndpoint
instances:.void
onHttpRequest(InetSocketAddress aLocalAddress, InetSocketAddress aClientAddress, org.refcodes.web.HttpMethod aHttpMethod, org.refcodes.web.Url aUrl, org.refcodes.web.RequestHeaderFields aRequestHeaderFields, String aHttpBody, org.refcodes.web.HttpServerResponse aHttpServerResponse)
Invoke this method to simulate a REST request to be handled by the according registeredRestEndpoint
instances:default LoopbackRestServer
withBaseLocator(String aBaseLocator)
default LoopbackRestServer
withHttpExceptionHandler(HttpExceptionHandler aHttpErrorHandler)
Sets theHttpExceptionHandler
for theHttpExceptionHandler
property.default LoopbackRestServer
withHttpExceptionHandling(HttpExceptionHandling aHttpErrorHandling)
Sets theHttpExceptionHandling
for theHttpExceptionHandling
property.default LoopbackRestServer
withRealm(String aRealm)
-
Methods inherited from interface org.refcodes.web.BaseLocatorAccessor.BaseLocatorMutator
setBaseLocator
-
Methods inherited from interface org.refcodes.web.BaseLocatorAccessor.BaseLocatorProperty
letBaseLocator
-
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.HttpExceptionHandlerAccessor.HttpExceptionHandlerProperty
letHttpExceptionHandler
-
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.rest.HttpExceptionHandlingAccessor.HttpExceptionHandlingProperty
letHttpExceptionHandling
-
Methods inherited from interface org.refcodes.web.MediaTypeFactoryLookup
getFactoryMediaTypes, hasMediaTypeFactory, toMediaTypeFactory
-
Methods inherited from interface org.refcodes.web.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, onDelete, onGet, onGet, onPost, onPost, onPut, onPut, onRequest, onRequest, onRequest, onRequest, onRequest, withDisableObservers, withDisableRequestCorrelation, withDisableSessionCorrelation, withEnableObservers, withEnableRequestCorrelation, withEnableSessionCorrelation, withObserversActive, withRequestCorrelation, withSessionCorrelation
-
-
-
-
Method Detail
-
onHttpRequest
void onHttpRequest(InetSocketAddress aLocalAddress, InetSocketAddress aClientAddress, org.refcodes.web.HttpMethod aHttpMethod, org.refcodes.web.Url aUrl, org.refcodes.web.RequestHeaderFields aRequestHeaderFields, String aHttpBody, org.refcodes.web.HttpServerResponse aHttpServerResponse) throws org.refcodes.web.HttpStatusException
Invoke this method to simulate a REST request to be handled by the according registeredRestEndpoint
instances:- 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
- TheHttpServerResponse
to be filled with the complete result of processing the request.- Throws:
org.refcodes.web.HttpStatusException
- the http status exception
-
onHttpRequest
void onHttpRequest(InetSocketAddress aLocalAddress, InetSocketAddress aClientAddress, org.refcodes.web.HttpMethod aHttpMethod, org.refcodes.web.Url aUrl, org.refcodes.web.RequestHeaderFields aRequestHeaderFields, InputStream aHttpInputStream, org.refcodes.web.HttpServerResponse aHttpServerResponse) throws org.refcodes.web.HttpStatusException
Invoke this method to simulate a REST request to be handled by the according registeredRestEndpoint
instances:.- 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 HTTPInputStream
representing the body for the simulated REST request to be used.aHttpServerResponse
- TheHttpServerResponse
to be filled with the complete result of processing the request.- Throws:
org.refcodes.web.HttpStatusException
- the http status exception
-
withHttpExceptionHandler
default LoopbackRestServer withHttpExceptionHandler(HttpExceptionHandler aHttpErrorHandler)
Sets theHttpExceptionHandler
for theHttpExceptionHandler
property.- Specified by:
withHttpExceptionHandler
in interfaceHttpExceptionHandlerAccessor.HttpExceptionHandlerBuilder<RestServer>
- Parameters:
aHttpErrorHandler
- TheHttpExceptionHandler
to be stored by theHttpExceptionHandler
property.- Returns:
- The builder for applying multiple build operations.
-
withHttpExceptionHandling
default LoopbackRestServer withHttpExceptionHandling(HttpExceptionHandling aHttpErrorHandling)
Sets theHttpExceptionHandling
for theHttpExceptionHandling
property.- Specified by:
withHttpExceptionHandling
in interfaceHttpExceptionHandlingAccessor.HttpExceptionHandlingBuilder<RestServer>
- Parameters:
aHttpErrorHandling
- TheHttpExceptionHandling
to be stored by theHttpExceptionHandling
property.- Returns:
- The builder for applying multiple build operations.
-
withRealm
default LoopbackRestServer withRealm(String aRealm)
- Specified by:
withRealm
in interfaceorg.refcodes.web.RealmAccessor.RealmBuilder<RestServer>
- Specified by:
withRealm
in interfaceRestServer
-
withBaseLocator
default LoopbackRestServer withBaseLocator(String aBaseLocator)
- Specified by:
withBaseLocator
in interfaceorg.refcodes.web.BaseLocatorAccessor.BaseLocatorBuilder<RestServer>
- Specified by:
withBaseLocator
in interfaceRestServer
-
-