35#include "BESXMLUtils.h"
37#include "BESSyntaxUserError.h"
40#include "SampleSayXMLCommand.h"
41#include "SampleResponseNames.h"
63 map<string, string> props;
65 if (name != SAY_RESPONSE) {
66 string err =
"The specified command " + name +
" is not a say command";
71 string err = name +
" command: should not have xml element values";
77 map<string, string> child_props;
80 string err = name +
" command: should not have child elements";
84 d_xmlcmd_dhi.data[SAY_WHAT] = props[
"what"];
85 if (d_xmlcmd_dhi.data[SAY_WHAT].empty()) {
86 string err = name +
" command: Must specify to whom to say";
90 d_xmlcmd_dhi.data[SAY_TO] = props[
"to"];
91 if (d_xmlcmd_dhi.data[SAY_WHAT].empty()) {
92 string err = name +
" command: Must specify what to say";
96 d_xmlcmd_dhi.action = SAY_RESPONSE;
115 strm << BESIndent::LMarg <<
"SampleSayXMLCommand::dump - (" << (
void *)
this <<
")" << endl;
118 BESIndent::UnIndent();
Structure storing information used by the BES to handle the request.
error thrown if there is a user syntax error in the request or any other user error
Base class for the BES's commands.
virtual void dump(std::ostream &strm) const
dumps information about this object
virtual void set_response()
The request has been parsed, use the command action name to set the response handler.
static void GetNodeInfo(xmlNode *node, std::string &name, std::string &value, std::map< std::string, std::string > &props)
get the name, value if any, and any properties for the specified node
static xmlNode * GetFirstChild(xmlNode *node, std::string &child_name, std::string &child_value, std::map< std::string, std::string > &child_props)
get the first element child node for the given node
virtual void prep_request()
Prepare any information needed to execute the request of this command.
virtual void dump(std::ostream &strm) const
dumps information about this object
virtual void parse_request(xmlNode *node)
parse a show command. No properties or children elements