org.refcodes.net.BaseLocatorAccessor, org.refcodes.net.BaseLocatorAccessor.BaseLocatorBuilder<RestServer>, org.refcodes.net.BaseLocatorAccessor.BaseLocatorMutator, org.refcodes.net.BaseLocatorAccessor.BaseLocatorProperty, org.refcodes.net.MediaTypeFactoryLookup, org.refcodes.net.MediaTypeFactoryLookup.MutableMediaTypeFactoryLookup, org.refcodes.net.RealmAccessor, org.refcodes.net.RealmAccessor.RealmBuilder<RestServer>, org.refcodes.net.RealmAccessor.RealmMutator, org.refcodes.net.RealmAccessor.RealmProperty, org.refcodes.observer.Observable<RestServer>, org.refcodes.observer.Observers<RestEndpoint,RestServer>, HttpExceptionHandlerAccessor, HttpExceptionHandlerAccessor.HttpExceptionHandlerBuilder<RestServer>, HttpExceptionHandlerAccessor.HttpExceptionHandlerMutator, HttpExceptionHandlerAccessor.HttpExceptionHandlerProperty, HttpExceptionHandlingAccessor, HttpExceptionHandlingAccessor.HttpExceptionHandlingBuilder<RestServer>, HttpExceptionHandlingAccessor.HttpExceptionHandlingMutator, HttpExceptionHandlingAccessor.HttpExceptionHandlingProperty, LoopbackRestServer, RestServer, org.refcodes.runtime.RequestCorrelation<RestServer>, org.refcodes.runtime.SessionCorrelation<RestServer>LoopbackRestServerSingletonpublic class LoopbackRestServerImpl extends AbstractRestServer implements LoopbackRestServer
LoopbackRestServer for easy testing of your
requests being received by a RestServer (HttpRestServer) and
the according response lambda expressions.org.refcodes.net.BaseLocatorAccessor.BaseLocatorBuilder<B extends org.refcodes.net.BaseLocatorAccessor.BaseLocatorBuilder<B>>, org.refcodes.net.BaseLocatorAccessor.BaseLocatorMutator, org.refcodes.net.BaseLocatorAccessor.BaseLocatorPropertyorg.refcodes.mixin.Disposable.DisposedableHttpExceptionHandlerAccessor.HttpExceptionHandlerBuilder<B extends HttpExceptionHandlerAccessor.HttpExceptionHandlerBuilder<B>>, HttpExceptionHandlerAccessor.HttpExceptionHandlerMutator, HttpExceptionHandlerAccessor.HttpExceptionHandlerPropertyHttpExceptionHandlingAccessor.HttpExceptionHandlingBuilder<B extends HttpExceptionHandlingAccessor.HttpExceptionHandlingBuilder<B>>, HttpExceptionHandlingAccessor.HttpExceptionHandlingMutator, HttpExceptionHandlingAccessor.HttpExceptionHandlingProperty_hasRequestCorrelation, _hasSessionCorrelation, _httpExceptionHandler, _httpExceptionHandling| Constructor | Description |
|---|---|
LoopbackRestServerImpl() |
| 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) |
Extensions of this class disect an incoming request and pass it to this
method for doing the actual invocation of the 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: |
clear, doHandleEventListenerException, fireEvent, getThreadPriority, hasObserverSubscription, isEmpty, setThreadPriority, sizeaddMediaTypeFactory, dispose, doRequestCorrelation, doSessionCorrelation, fireEvent, getBaseLocator, getFactoryMediaTypes, getHttpExceptionHandler, getHttpExceptionHandling, getRealm, hasRequestCorrelation, hasSessionCorrelation, initMedaTypeFactories, isObserversActive, observers, setBaseLocator, setHttpExceptionHandler, setHttpExceptionHandling, setObserversActive, setRealm, setRequestCorrelation, setSessionCorrelation, subscribeObserver, toMediaTypeFactory, toNegotiatedContenType, toResponseBody, unsubscribeObserversetBaseLocatorgetHttpExceptionHandlerwithOnHttpExceptiononHttpException, setHttpExceptionHandlergetHttpExceptionHandlingsetHttpExceptionHandlingwithBaseLocator, withHttpExceptionHandler, withHttpExceptionHandling, withRealmgetFactoryMediaTypes, hasMediaTypeFactory, toMediaTypeFactoryaddMediaTypeFactoryclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithasObserverSubscription, subscribeObserver, unsubscribeObserverdisableObservers, enableObservers, isObserversActive, observers, setObserversActivedisableRequestCorrelation, enableRequestCorrelation, hasRequestCorrelation, setRequestCorrelationonDelete, onGet, onPost, onPut, onRequest, onRequest, onRequest, withDisableObservers, withDisableRequestCorrelation, withDisableSessionCorrelation, withEnableObservers, withEnableRequestCorrelation, withEnableSessionCorrelation, withObserversActive, withRequestCorrelation, withSessionCorrelationpublic 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) throws org.refcodes.net.HttpStatusException
RestEndpoint instances. An extension might call this method from
inside an event (request) handler.onHttpRequest in interface LoopbackRestServeronHttpRequest in class AbstractRestServeraLocalAddress - The host and port of your REST service.aClientAddress - The host and port for the caller.aHttpMethod - The HttpMethod of the request.aUrl - The Url from which to take the URL specific data.aRequestHeaderFields - The Header-Fields (HeaderFields)
belonging to the request.aHttpInputStream - The body passed by the request.aHttpServerResponse - A HttpServerResponse instance to be
used by the extension to produce an according HTTP-Response.org.refcodes.net.HttpStatusException - thrown in case of an RestEndpoint
responsible for the given request encountered a problem or none
RestEndpoint felt responsible to produce a
HttpServerResponse.public 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:onHttpRequest in interface LoopbackRestServeraLocalAddress - 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 exceptionCopyright © 2018. All rights reserved.