water.api
Class RequestServer

java.lang.Object
  extended by water.NanoHTTPD
      extended by water.api.RequestServer

public class RequestServer
extends NanoHTTPD

This is a simple web server.


Nested Class Summary
static class RequestServer.API_VERSION
           
 
Nested classes/interfaces inherited from class water.NanoHTTPD
NanoHTTPD.Response
 
Field Summary
protected static java.util.HashMap<java.lang.String,Request> _requests
           
 
Fields inherited from class water.NanoHTTPD
HTTP_BADREQUEST, HTTP_FORBIDDEN, HTTP_INTERNALERROR, HTTP_NOTFOUND, HTTP_NOTIMPLEMENTED, HTTP_NOTMODIFIED, HTTP_OK, HTTP_PARTIALCONTENT, HTTP_RANGE_NOT_SATISFIABLE, HTTP_REDIRECT, HTTP_TOOLONGREQUEST, HTTP_UNAUTHORIZED, MIME_DEFAULT_BINARY, MIME_HTML, MIME_JSON, MIME_PLAINTEXT, MIME_XML, myOut
 
Method Summary
static Request registerRequest(Request req)
          Registers the request with the request server.
static java.util.HashMap<java.lang.String,Request> requests()
           
 NanoHTTPD.Response serve(java.lang.String uri, java.lang.String method, java.util.Properties header, java.util.Properties parms)
          Override this to customize the server.
static void start()
           
static void unregisterRequest(Request req)
           
 
Methods inherited from class water.NanoHTTPD
main, serveFile, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_requests

protected static final java.util.HashMap<java.lang.String,Request> _requests
Method Detail

requests

public static java.util.HashMap<java.lang.String,Request> requests()

registerRequest

public static Request registerRequest(Request req)
Registers the request with the request server.


unregisterRequest

public static void unregisterRequest(Request req)

start

public static void start()

serve

public NanoHTTPD.Response serve(java.lang.String uri,
                                java.lang.String method,
                                java.util.Properties header,
                                java.util.Properties parms)
Description copied from class: NanoHTTPD
Override this to customize the server.

(By default, this delegates to serveFile() and allows directory listing.)

Overrides:
serve in class NanoHTTPD
Parameters:
uri - Percent-decoded URI without parameters, for example "/index.cgi"
method - "GET", "POST" etc.
header - Header entries, percent decoded
parms - Parsed, percent decoded parameters from URI and, in case of POST, data.
Returns:
HTTP response, see class Response for details