- 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
Extends a
RestServer
to be used as loopback device e.g. for testing
purposes such as testing your RestRequestConsumer
implementations.
Use the
onHttpRequest(InetSocketAddress, InetSocketAddress, HttpMethod, Url, RequestHeaderFields, InputStream, HttpServerResponse)
method to simulate REST requests on the LoopbackRestServer
. An
registered RestEndpoint
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
Nested classes/interfaces inherited from interface org.refcodes.web.MediaTypeFactoryLookup
org.refcodes.web.MediaTypeFactoryLookup.MutableMediaTypeFactoryLookup
Nested 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 TypeMethodDescriptionvoid
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
Methods inherited from interface org.refcodes.web.BaseLocatorAccessor
getBaseLocator
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.web.RealmAccessor
getRealm
Methods inherited from interface org.refcodes.web.RealmAccessor.RealmMutator
setRealm
Methods inherited from interface org.refcodes.web.RealmAccessor.RealmProperty
letRealm
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
Methods inherited from interface org.refcodes.runtime.SessionCorrelation
disableSessionCorrelation, enableSessionCorrelation, hasSessionCorrelation, setSessionCorrelation
-
Method Details
-
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
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
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
- Specified by:
withRealm
in interfaceorg.refcodes.web.RealmAccessor.RealmBuilder<RestServer>
- Specified by:
withRealm
in interfaceRestServer
-
withBaseLocator
- Specified by:
withBaseLocator
in interfaceorg.refcodes.web.BaseLocatorAccessor.BaseLocatorBuilder<RestServer>
- Specified by:
withBaseLocator
in interfaceRestServer
-