Sirikata
Public Member Functions | Private Member Functions | Private Attributes
Sirikata::Command::HttpCommander Class Reference

#include <HttpCommander.hpp>

Inheritance diagram for Sirikata::Command::HttpCommander:
Collaboration diagram for Sirikata::Command::HttpCommander:

List of all members.

Public Member Functions

 HttpCommander (Context *ctx, const String &host, uint16 port)
virtual ~HttpCommander ()
virtual void onHttpRequest (HttpServer *server, HttpRequestID id, String &path, String &query, String &fragment, Headers &headers, String &body)
 Invoked when a complete HttpRequest is ready for processing.
virtual void result (CommandID id, const Result &result)
 Return a result from a CommandHandler.

Private Member Functions

void sendResponse (HttpRequestID id, HttpStatus status, const Result &result)

Private Attributes

ContextmContext
HttpServer mServer

Constructor & Destructor Documentation

Sirikata::Command::HttpCommander::HttpCommander ( Context ctx,
const String host,
uint16  port 
)
Sirikata::Command::HttpCommander::~HttpCommander ( ) [virtual]

Member Function Documentation

void Sirikata::Command::HttpCommander::onHttpRequest ( HttpServer server,
HttpRequestID  id,
String path,
String query,
String fragment,
Headers headers,
String body 
) [virtual]

Invoked when a complete HttpRequest is ready for processing.

Parameters:
serverthe HttpServer this request originated from
idthe unique ID for this request. Should be included when triggering the response
pathpath part of the requested URL
query(encoded) query string part of the requested URL
fragmentfragment part of the requested URL
headersmap of headers included with the request
bodythe body of the request
Note:
Parameters are passed as mutable references -- you are permitted to modify them. They will remain valid until you call HttpServer::response().

Implements Sirikata::Command::HttpRequestListener.

References Sirikata::Command::CommandSetName(), Sirikata::Logging::detailed, Sirikata::Command::EmptyResult(), Sirikata::Command::Commander::getHandler(), HC_LOG, result(), and sendResponse().

void Sirikata::Command::HttpCommander::result ( CommandID  id,
const Result result 
) [virtual]

Return a result from a CommandHandler.

This will trigger the process of returning the result to the requestor.

Implements Sirikata::Command::Commander.

References sendResponse().

Referenced by onHttpRequest().

void Sirikata::Command::HttpCommander::sendResponse ( HttpRequestID  id,
HttpStatus  status,
const Result result 
) [private]

Member Data Documentation

Referenced by HttpCommander(), and ~HttpCommander().


The documentation for this class was generated from the following files: