Sirikata
|
The Command namespace contains classes for handling external command requests, allowing external tools to interact with a live Sirikata process. More...
Classes | |
class | Commander |
Commanders accept external commands (e.g. More... | |
class | DuplicateHandlerException |
class | CommanderFactory |
class | HttpCommander |
class | HttpRequest |
struct | CaseInsensitiveStringLess |
class | HttpRequestListener |
class | HttpServer |
Typedefs | |
typedef String | CommandKey |
A CommandKey is a name for a command. | |
typedef uint32 | CommandID |
Unique ID for a command request. | |
typedef json_spirit::Value | Command |
Commands take the form of JSON trees. | |
typedef json_spirit::Value::String | String |
typedef json_spirit::Array | Array |
typedef json_spirit::Object | Object |
typedef json_spirit::Value | Result |
Results are returned by executing a command. | |
typedef std::tr1::function < void(const Command &, Commander *, CommandID) | CommandHandler ) |
CommandHandlers actually process Commands and return a Result to be forwarded to the requestor. | |
typedef std::map< std::string, std::string > | StringDictionary |
typedef std::map< std::string, std::string, CaseInsensitiveStringLess > | CaseInsensitiveStringDictionary |
typedef CaseInsensitiveStringDictionary | Headers |
typedef StringDictionary | QueryParameters |
typedef uint16 | HttpStatus |
typedef uint32 | HttpRequestID |
typedef std::tr1::shared_ptr < Network::TCPListener > | TCPListenerPtr |
typedef std::tr1::shared_ptr < Network::TCPSocket > | TCPSocketPtr |
typedef std::tr1::shared_ptr < HttpRequest > | HttpRequestPtr |
Functions | |
bool SIRIKATA_FUNCTION_EXPORT | CommandIsValid (const Command &cmd) |
void SIRIKATA_FUNCTION_EXPORT | CommandSetName (Command &cmd, const String &name) |
Result | EmptyResult () |
The Command namespace contains classes for handling external command requests, allowing external tools to interact with a live Sirikata process.
typedef json_spirit::Array Sirikata::Command::Array |
typedef std::map<std::string, std::string, CaseInsensitiveStringLess> Sirikata::Command::CaseInsensitiveStringDictionary |
typedef json_spirit::Value Sirikata::Command::Command |
Commands take the form of JSON trees.
These are pretty generic tree-structured values, making commands pretty flexible. While any command should be an object, we use Values so that we get all the convenience wrappers for objects like path-based get and put.
typedef std::tr1::function<void(const Command&, Commander*, CommandID) Sirikata::Command::CommandHandler) |
CommandHandlers actually process Commands and return a Result to be forwarded to the requestor.
Instead of using a return value, the CommandHandler should invoke Commander::result() using the Commander and CommandID passed to it. This allows CommandHandlers to operate asynchronously (e.g. just to get on the right thread/strand or because a command requires asynchronous steps).
typedef uint32 Sirikata::Command::CommandID |
Unique ID for a command request.
These are passed to the CommandHandler so it can later return the result.
typedef String Sirikata::Command::CommandKey |
A CommandKey is a name for a command.
Commands always have a top-level 'command' entry which will be set to this value when you construct one. You should use a hierarchy when naming commands to avoid conflicts, e.g. rather than 'stats', use 'space.forwarder.stats'.
typedef uint32 Sirikata::Command::HttpRequestID |
typedef std::tr1::shared_ptr<HttpRequest> Sirikata::Command::HttpRequestPtr |
typedef uint16 Sirikata::Command::HttpStatus |
typedef json_spirit::Object Sirikata::Command::Object |
typedef json_spirit::Value Sirikata::Command::Result |
Results are returned by executing a command.
These are also generic tree-structured values, allowing complex data to be returned without Commandables needing to worry about encoding.
typedef json_spirit::Value::String Sirikata::Command::String |
typedef std::map<std::string, std::string> Sirikata::Command::StringDictionary |
typedef std::tr1::shared_ptr<Network::TCPListener> Sirikata::Command::TCPListenerPtr |
typedef std::tr1::shared_ptr<Network::TCPSocket> Sirikata::Command::TCPSocketPtr |
bool Sirikata::Command::CommandIsValid | ( | const Command & | cmd | ) |
void Sirikata::Command::CommandSetName | ( | Command & | cmd, |
const String & | name | ||
) |
Referenced by Sirikata::Command::HttpCommander::onHttpRequest().
Result Sirikata::Command::EmptyResult | ( | ) | [inline] |
Referenced by Sirikata::ObjectHost::commandCreateObject(), Sirikata::ObjectHost::commandDestroyObject(), Sirikata::PintoManager::commandForceRebuild(), Sirikata::ManualPintoManager::commandForceRebuild(), Sirikata::LibproxProximity::commandForceRebuild(), Sirikata::LibproxManualProximity::commandForceRebuild(), Sirikata::OH::Simple::SimpleObjectQueryProcessor::commandForceRebuild(), Sirikata::OH::Manual::ObjectQueryHandler::commandForceRebuild(), Sirikata::Graphics::PriorityDownloadPlanner::commandGetData(), Sirikata::Graphics::PriorityDownloadPlanner::commandGetStats(), Sirikata::Command::Commander::commandListCommands(), Sirikata::PintoManager::commandListHandlers(), Sirikata::ManualPintoManager::commandListHandlers(), Sirikata::LibproxProximity::commandListHandlers(), Sirikata::LibproxManualProximity::commandListHandlers(), Sirikata::OH::Simple::SimpleObjectQueryProcessor::commandListHandlers(), Sirikata::OH::Manual::ManualObjectQueryProcessor::commandListHandlers(), Sirikata::PintoManager::commandListNodes(), Sirikata::ManualPintoManager::commandListNodes(), Sirikata::LibproxProximity::commandListNodes(), Sirikata::LibproxManualProximity::commandListNodes(), Sirikata::OH::Simple::SimpleObjectQueryProcessor::commandListNodes(), Sirikata::OH::Manual::ObjectQueryHandler::commandListNodes(), Sirikata::ObjectHost::commandListObjects(), Sirikata::PintoManager::commandListQueriers(), Sirikata::ManualPintoManager::commandListQueriers(), Sirikata::LibproxProximity::commandListQueriers(), Sirikata::LibproxManualProximity::commandListQueriers(), Sirikata::OH::Simple::SimpleObjectQueryProcessor::commandListQueriers(), Sirikata::OH::Manual::ObjectQueryHandler::commandListQueriers(), Sirikata::OH::Manual::ManualObjectQueryProcessor::commandListQueriers(), Sirikata::Transfer::TransferMediator::commandListRequests(), Sirikata::StandardLocationService::commandObjectProperties(), Sirikata::BulletPhysicsService::commandObjectProperties(), Sirikata::Server::commandObjectsCount(), Sirikata::Server::commandObjectsDisconnect(), Sirikata::Server::commandObjectsList(), Sirikata::HostedObject::commandPresences(), Sirikata::PintoManager::commandProperties(), Sirikata::ManualPintoManager::commandProperties(), Sirikata::StandardLocationService::commandProperties(), Sirikata::LibproxProximity::commandProperties(), Sirikata::LibproxManualProximity::commandProperties(), Sirikata::BulletPhysicsService::commandProperties(), Sirikata::OH::Simple::SimpleObjectQueryProcessor::commandProperties(), Sirikata::OH::Manual::ManualObjectQueryProcessor::commandProperties(), Sirikata::Network::IOService::commandReportAllStats(), Sirikata::Network::IOService::commandReportStats(), Sirikata::PintoManager::commandStats(), Sirikata::ManualPintoManager::commandStats(), Sirikata::AggregateManager::commandStats(), Sirikata::LibproxProximityBase::commandStats(), Sirikata::OH::Simple::SimpleObjectQueryProcessor::commandStats(), Sirikata::OH::Manual::ManualObjectQueryProcessor::commandStats(), Sirikata::ObjectHost::getCommandObject(), Sirikata::OH::Manual::ManualObjectQueryProcessor::lookupCommandHandler(), and Sirikata::Command::HttpCommander::onHttpRequest().