Interface LoopbackRestServer

    • Method Detail

      • onHttpRequest

        void onHttpRequest​(java.net.InetSocketAddress aLocalAddress,
                           java.net.InetSocketAddress aClientAddress,
                           org.refcodes.net.HttpMethod aHttpMethod,
                           org.refcodes.net.Url aUrl,
                           org.refcodes.net.RequestHeaderFields aRequestHeaderFields,
                           java.lang.String aHttpBody,
                           org.refcodes.net.HttpServerResponse aHttpServerResponse)
                    throws org.refcodes.net.HttpStatusException
        Invoke this method to simulate a REST request to be handled by the according registered RestEndpoint instances:
        Parameters:
        aLocalAddress - the local address
        aClientAddress - the client address
        aHttpMethod - The method for the simulated REST request to be used
        aUrl - The query string part of the request.
        aRequestHeaderFields - The simulated REST request's Header-Fields to be used
        aHttpBody - 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.
        Throws:
        org.refcodes.net.HttpStatusException - the http status exception
      • onHttpRequest

        void onHttpRequest​(java.net.InetSocketAddress aLocalAddress,
                           java.net.InetSocketAddress aClientAddress,
                           org.refcodes.net.HttpMethod aHttpMethod,
                           org.refcodes.net.Url aUrl,
                           org.refcodes.net.RequestHeaderFields aRequestHeaderFields,
                           java.io.InputStream aHttpInputStream,
                           org.refcodes.net.HttpServerResponse aHttpServerResponse)
                    throws org.refcodes.net.HttpStatusException
        Invoke this method to simulate a REST request to be handled by the according registered RestEndpoint instances:.
        Parameters:
        aLocalAddress - the local address
        aClientAddress - the client address
        aHttpMethod - The method for the simulated REST request to be used
        aUrl - The query string part of the request.
        aRequestHeaderFields - The simulated REST request's Header-Fields to be used
        aHttpInputStream - 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.
        Throws:
        org.refcodes.net.HttpStatusException - the http status exception
      • withBaseLocator

        default LoopbackRestServer withBaseLocator​(java.lang.String aBaseLocator)
        Specified by:
        withBaseLocator in interface org.refcodes.net.BaseLocatorAccessor.BaseLocatorBuilder<RestServer>
        Specified by:
        withBaseLocator in interface RestServer