|
| addClass (AbstractRestClass cls) |
| adds a REST class to the handler
|
|
| constructor (*HttpServer::AbstractAuthenticator auth) |
| create the object optionally with the given HttpServer::AbstractAuthenticator More...
|
|
hash | get (hash cx, *hash ah) |
| default get handler
|
|
hash | handleRequest (HttpListenerInterface listener, Socket s, hash cx, hash hdr, *data b) |
| called by the HTTP server to handle incoming HTTP requests More...
|
|
| logDebug (string fmt) |
| default implementation is empty; this method is called with debug log messages; reimplement in subclasses to provide for logging
|
|
| logError (string fmt) |
| default implementation is empty; this method is called with error log messages; reimplement in subclasses to provide for logging
|
|
| logInfo (string fmt) |
| default implementation is empty; this method is called with informational log messages; reimplement in subclasses to provide for logging
|
|
string | name () |
| returns the name of the root REST class
|
|
| removeRootPath (reference path) |
| default implementation is empty
|
|
| requestDeserializationError (hash hdr, hash cx, string body) |
| default implementation is empty
|
|
| responseSerializationError (hash cx, *hash aih, hash rv) |
| default implementation is empty
|
|
Public Member Functions inherited from RestHandler::AbstractRestClass |
private hash | dispatch (RestHandler rh, string mn, *hash ah, hash cx) |
| this method is called to dispatch requests on the given object
|
|
private hash | dispatchStream (HttpListenerInterface listener, RestHandler rh, Socket s, string mn, *hash ah, hash cx) |
| this method is called to dispatch streamed requests on the given object
|
|
hash | handleRequest (HttpListenerInterface listener, RestHandler rh, Socket s, *list cl, string mn, hash cx, *hash args) |
| this method is called by the RestHandler class to match the right object with incoming requests
|
|
*AbstractRestClass | subClass (string name, hash cx, *hash args) |
| this method will be called to find a sub-class (ie with GET /invoices/1 - if this class represents "invoices", then subClass("1") will be called to return invoice 1; return NOTHING if the object doesn't exist More...
|
|
private hash | unknownSubClassError (string n_name) |
| throws a "REST-CLASS-ERROR" exception when a request tries to access an unknown subclass
|
|
this is the main handler class to be registered with the HttpServer
The RestHandler class should be subclassed to customize its behavior.
To provide for logging; the following methods can be reimplemented in subclasses:
In order to match REST requests under a root path, reimplement the following method in a subclass: