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, String, String, RequestHeaderFields, InputStream)
method to simulate REST requests on the LoopbackRestServer
. An
registered Endpoint
instances being targeted at will be invoked
accordingly.org.refcodes.net.MediaTypeFactoryLookup.MutableMediaTypeFactoryLookup
org.refcodes.net.RealmAccessor.RealmBuilder<B extends org.refcodes.net.RealmAccessor.RealmBuilder<B>>, org.refcodes.net.RealmAccessor.RealmMutator, org.refcodes.net.RealmAccessor.RealmProperty
org.refcodes.net.BaseLocatorAccessor.BaseLocatorBuilder<B extends org.refcodes.net.BaseLocatorAccessor.BaseLocatorBuilder<B>>, org.refcodes.net.BaseLocatorAccessor.BaseLocatorMutator, org.refcodes.net.BaseLocatorAccessor.BaseLocatorProperty
Modifier and Type | Method and Description |
---|---|
org.refcodes.net.HttpServerResponse |
onHttpRequest(InetSocketAddress aLocalAddress,
InetSocketAddress aClientAddress,
org.refcodes.net.HttpMethod aHttpMethod,
String aLocator,
String aQueryString,
org.refcodes.net.RequestHeaderFields aRequestHeaderFields,
InputStream aHttpInputStream)
Invoke this method to simulate a REST request to be handled by the
according registered
Endpoint instances:. |
org.refcodes.net.HttpServerResponse |
onHttpRequest(InetSocketAddress aLocalAddress,
InetSocketAddress aClientAddress,
org.refcodes.net.HttpMethod aHttpMethod,
String aLocator,
String aQueryString,
org.refcodes.net.RequestHeaderFields aRequestHeaderFields,
String aHttpBody)
Invoke this method to simulate a REST request to be handled by the
according registered
Endpoint instances:. |
default LoopbackRestServer |
withBaseLocator(String aBaseLocator)
With base locator.
|
default LoopbackRestServer |
withRealm(String aRealm)
With realm.
|
onDelete, onGet, onPost, onPut, onRequest, onRequest, onRequest, withDisableRequestCorrelation, withDisableSessionCorrelation, withEnableRequestCorrelation, withEnableSessionCorrelation, withRequestCorrelation, withSessionCorrelation
hasObserverSubscription, subscribeObserver, unsubscribeObserver
addMediaTypeFactory
getFactoryMediaTypes, hasMediaTypeFactory, toMediaTypeFactory
setBaseLocator
org.refcodes.net.HttpServerResponse onHttpRequest(InetSocketAddress aLocalAddress, InetSocketAddress aClientAddress, org.refcodes.net.HttpMethod aHttpMethod, String aLocator, String aQueryString, org.refcodes.net.RequestHeaderFields aRequestHeaderFields, String aHttpBody) throws org.refcodes.net.HttpStatusException
Endpoint
instances:.aLocalAddress
- the a local addressaClientAddress
- the a client addressaHttpMethod
- The method for the simulated REST request to be usedaLocator
- The locator for the simulated REST request to be used
without the query string portion.aQueryString
- 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.HttpServerResponse
containing the complete result of
processing the request.org.refcodes.net.HttpStatusException
- the http status exceptionorg.refcodes.net.HttpServerResponse onHttpRequest(InetSocketAddress aLocalAddress, InetSocketAddress aClientAddress, org.refcodes.net.HttpMethod aHttpMethod, String aLocator, String aQueryString, org.refcodes.net.RequestHeaderFields aRequestHeaderFields, InputStream aHttpInputStream) throws org.refcodes.net.HttpStatusException
Endpoint
instances:.aLocalAddress
- the a local addressaClientAddress
- the a client addressaHttpMethod
- The method for the simulated REST request to be usedaLocator
- The locator for the simulated REST request to be used
without the query string portion.aQueryString
- 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.HttpServerResponse
containing the complete result of
processing the request.org.refcodes.net.HttpStatusException
- the http status exceptiondefault LoopbackRestServer withRealm(String aRealm)
withRealm
in interface org.refcodes.net.RealmAccessor.RealmBuilder<RestServer>
withRealm
in interface RestServer
aRealm
- the a realmdefault LoopbackRestServer withBaseLocator(String aBaseLocator)
withBaseLocator
in interface org.refcodes.net.BaseLocatorAccessor.BaseLocatorBuilder<RestServer>
withBaseLocator
in interface RestServer
aBaseLocator
- the a base locatorCopyright © 2017. All rights reserved.