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>
LoopbackRestServerImpl
, LoopbackRestServerSingleton
public interface LoopbackRestServer extends RestServer
RestServer
to be used as loopback device e.g. for testing
purposes such as testing your RestRequestObserver
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.org.refcodes.net.BaseLocatorAccessor.BaseLocatorBuilder<B extends org.refcodes.net.BaseLocatorAccessor.BaseLocatorBuilder<B>>, org.refcodes.net.BaseLocatorAccessor.BaseLocatorMutator, org.refcodes.net.BaseLocatorAccessor.BaseLocatorProperty
HttpExceptionHandlerAccessor.HttpExceptionHandlerBuilder<B extends HttpExceptionHandlerAccessor.HttpExceptionHandlerBuilder<B>>, HttpExceptionHandlerAccessor.HttpExceptionHandlerMutator, HttpExceptionHandlerAccessor.HttpExceptionHandlerProperty
HttpExceptionHandlingAccessor.HttpExceptionHandlingBuilder<B extends HttpExceptionHandlingAccessor.HttpExceptionHandlingBuilder<B>>, HttpExceptionHandlingAccessor.HttpExceptionHandlingMutator, HttpExceptionHandlingAccessor.HttpExceptionHandlingProperty
Modifier and Type | Method | Description |
---|---|---|
void |
onHttpRequest(InetSocketAddress aLocalAddress,
InetSocketAddress aClientAddress,
org.refcodes.net.HttpMethod aHttpMethod,
org.refcodes.net.Url aUrl,
org.refcodes.net.RequestHeaderFields aRequestHeaderFields,
InputStream aHttpInputStream,
org.refcodes.net.HttpServerResponse aHttpServerResponse) |
Invoke this method to simulate a REST request to be handled by the
according registered
RestEndpoint instances:. |
void |
onHttpRequest(InetSocketAddress aLocalAddress,
InetSocketAddress aClientAddress,
org.refcodes.net.HttpMethod aHttpMethod,
org.refcodes.net.Url aUrl,
org.refcodes.net.RequestHeaderFields aRequestHeaderFields,
String aHttpBody,
org.refcodes.net.HttpServerResponse aHttpServerResponse) |
Invoke this method to simulate a REST request to be handled by the
according registered
RestEndpoint instances: |
default LoopbackRestServer |
withBaseLocator(String aBaseLocator) |
|
default LoopbackRestServer |
withHttpExceptionHandler(HttpExceptionHandler aHttpErrorHandler) |
Sets the
HttpExceptionHandler for the
HttpExceptionHandler property. |
default LoopbackRestServer |
withHttpExceptionHandling(HttpExceptionHandling aHttpErrorHandling) |
Sets the
HttpExceptionHandling for the HttpExceptionHandling
property. |
default LoopbackRestServer |
withRealm(String aRealm) |
setBaseLocator
getHttpExceptionHandler
withOnHttpException
onHttpException, setHttpExceptionHandler
getHttpExceptionHandling
setHttpExceptionHandling
getFactoryMediaTypes, hasMediaTypeFactory, toMediaTypeFactory
addMediaTypeFactory
hasObserverSubscription, subscribeObserver, unsubscribeObserver
disableObservers, enableObservers, isObserversActive, observers, setObserversActive
disableRequestCorrelation, enableRequestCorrelation, hasRequestCorrelation, setRequestCorrelation
onDelete, onGet, onPost, onPut, onRequest, onRequest, onRequest, withDisableObservers, withDisableRequestCorrelation, withDisableSessionCorrelation, withEnableObservers, withEnableRequestCorrelation, withEnableSessionCorrelation, withObserversActive, withRequestCorrelation, withSessionCorrelation
void onHttpRequest(InetSocketAddress aLocalAddress, InetSocketAddress aClientAddress, org.refcodes.net.HttpMethod aHttpMethod, org.refcodes.net.Url aUrl, org.refcodes.net.RequestHeaderFields aRequestHeaderFields, String aHttpBody, org.refcodes.net.HttpServerResponse aHttpServerResponse) throws org.refcodes.net.HttpStatusException
RestEndpoint
instances: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
- The HttpServerResponse
to be filled
with the complete result of processing the request.org.refcodes.net.HttpStatusException
- the http status exceptionvoid onHttpRequest(InetSocketAddress aLocalAddress, InetSocketAddress aClientAddress, org.refcodes.net.HttpMethod aHttpMethod, org.refcodes.net.Url aUrl, org.refcodes.net.RequestHeaderFields aRequestHeaderFields, InputStream aHttpInputStream, org.refcodes.net.HttpServerResponse aHttpServerResponse) throws org.refcodes.net.HttpStatusException
RestEndpoint
instances:.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 HTTP InputStream
representing the
body for the simulated REST request to be used.aHttpServerResponse
- The HttpServerResponse
to be filled
with the complete result of processing the request.org.refcodes.net.HttpStatusException
- the http status exceptiondefault LoopbackRestServer withHttpExceptionHandler(HttpExceptionHandler aHttpErrorHandler)
HttpExceptionHandler
for the
HttpExceptionHandler
property.withHttpExceptionHandler
in interface HttpExceptionHandlerAccessor.HttpExceptionHandlerBuilder<RestServer>
aHttpErrorHandler
- The HttpExceptionHandler
to be
stored by the HttpExceptionHandler
property.default LoopbackRestServer withHttpExceptionHandling(HttpExceptionHandling aHttpErrorHandling)
HttpExceptionHandling
for the HttpExceptionHandling
property.withHttpExceptionHandling
in interface HttpExceptionHandlingAccessor.HttpExceptionHandlingBuilder<RestServer>
aHttpErrorHandling
- The HttpExceptionHandling
to be stored
by the HttpExceptionHandling
property.default LoopbackRestServer withRealm(String aRealm)
withRealm
in interface org.refcodes.net.RealmAccessor.RealmBuilder<RestServer>
withRealm
in interface RestServer
default LoopbackRestServer withBaseLocator(String aBaseLocator)
withBaseLocator
in interface org.refcodes.net.BaseLocatorAccessor.BaseLocatorBuilder<RestServer>
withBaseLocator
in interface RestServer
Copyright © 2018. All rights reserved.