37#include "BESXMLCommand.h"
38#include "BESResponseHandlerList.h"
39#include "BESSyntaxUserError.h"
40#include "BESDataNames.h"
48map<string, p_xmlcmd_builder> BESXMLCommand::factory;
67 d_xmlcmd_dhi.response_handler = BESResponseHandlerList::TheList()->
find_handler(d_xmlcmd_dhi.
action);
68 if (!d_xmlcmd_dhi.response_handler) {
70 +
"' does not have a registered response handler", __FILE__, __LINE__);
75 VERBOSE(d_xmlcmd_dhi.
data[REQUEST_FROM] <<
" [" << d_xmlcmd_dhi.
data[LOG_INFO] <<
"] parsed" << endl);
90 BESXMLCommand::factory[cmd_str] = cmd;
100 BESXMLCommand::cmd_iter iter = BESXMLCommand::factory.find(cmd_str);
101 if (iter != BESXMLCommand::factory.end()) {
102 BESXMLCommand::factory.erase(iter);
112 return BESXMLCommand::factory[cmd_str];
123 strm << BESIndent::LMarg <<
"BESXMLCommand::dump - (" << (
void *)
this <<
")" << endl;
125 BESIndent::UnIndent();
Structure storing information used by the BES to handle the request.
void make_copy(const BESDataHandlerInterface ©_from)
deprecated
std::map< std::string, std::string > data
the map of string data that will be required for the current request.
std::string action
the response object requested, e.g. das, dds
virtual BESResponseHandler * find_handler(const std::string &handler)
returns the response handler with the given name from the list
error thrown if there is a user syntax error in the request or any other user error
static void del_command(const std::string &cmd_str)
Deletes the command called cmd_str from the list of possible commands.
BESXMLCommand(const BESDataHandlerInterface &base_dhi)
Creates a BESXMLCommand document given a base data handler interface object.
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 add_command(const std::string &cmd_str, p_xmlcmd_builder cmd)
Add a command to the possible commands allowed by this BES.
std::string d_cmd_log_info
Used only for the log.
static p_xmlcmd_builder find_command(const std::string &cmd_str)
Find the BESXMLCommand creation function with the given name.