37#include "BESXMLGetCommand.h"
38#include "BESDefinitionStorageList.h"
39#include "BESDefinitionStorage.h"
41#include "BESDataNames.h"
42#include "BESResponseNames.h"
43#include "BESDapNames.h"
45#include "BESXMLUtils.h"
47#include "BESSyntaxUserError.h"
74 map<string, string> props;
77 if (name != GET_RESPONSE) {
78 string err =
"The specified command " + name +
" is not a get command";
84 string type = props[
"type"];
86 string err = name +
" command: Must specify data product type";
91 string new_cmd = (string) GET_RESPONSE +
"." + type;
95 _sub_cmd = bldr(d_xmlcmd_dhi);
97 string err = (string)
"Failed to build command object for " + new_cmd;
132 _definition = props[
"definition"];
133 if (_definition.empty())
140 _space = props[
"space"];
142 if (!_space.empty())
d_cmd_log_info.append(
" in ").append(_space);
144 string returnAs = props[
"returnAs"];
145 if (returnAs.empty()) {
146 returnAs = DAP2_FORMAT;
149 d_xmlcmd_dhi.
data[RETURN_CMD] = returnAs;
151 d_xmlcmd_dhi.
data[STORE_RESULT] = props[STORE_RESULT];
152 d_xmlcmd_dhi.
data[ASYNC] = props[ASYNC];
156 d_xmlcmd_dhi.
action =
"get.";
159 BESDEBUG(
"besxml",
"Converted xml element name to command " << d_xmlcmd_dhi.
action << endl);
194 if (!_space.empty()) {
201 d = BESDefinitionStorageList::TheList()->
look_for(_definition);
205 string s = (string)
"Unable to find definition " + _definition;
209 BESDefine::containers_citer i = d->first_container();
210 BESDefine::containers_citer ie = d->end_container();
212 d_xmlcmd_dhi.containers.push_back(*i);
217 d_xmlcmd_dhi.
data[AGG_CMD] = d->get_agg_cmd();
218 d_xmlcmd_dhi.
data[AGG_HANDLER] = d->get_agg_handler();
229 strm << BESIndent::LMarg <<
"BESXMLGetCommand::dump - (" << (
void *)
this <<
")" << endl;
232 BESIndent::UnIndent();
Structure storing information used by the BES to handle the request.
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 BESDefinitionStorage * find_persistence(const std::string &persist_name)
find the persistence store with the given name
virtual BESDefine * look_for(const std::string &def_name)
look for the specified definition in the list of defintion stores.
provides persistent storage for a specific view of different containers including contraints and aggr...
virtual BESDefine * look_for(const std::string &def_name)=0
looks for a definition in this persistent store with the given name
exception thrown if internal error encountered
error thrown if there is a user syntax error in the request or any other user error
static std::string lowercase(const std::string &s)
Base class for the BES's commands.
virtual void prep_request()
Prepare any information needed to execute the request of this command.
virtual BESDataHandlerInterface & get_xmlcmd_dhi()
Return the current BESDataHandlerInterface.
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.
virtual void parse_request(xmlNode *node)=0
Parse the XML request document beginning at the given node.
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.
virtual void parse_request(xmlNode *node)
parse a get command.
virtual void prep_request()
Prepare any information needed to execute the request of this get command.
virtual void parse_basic_get(const std::string &type, std::map< std::string, std::string > &props)
Extract information from the 'props' map.
virtual void dump(std::ostream &strm) const
dumps information about this object
virtual BESDataHandlerInterface & get_xmlcmd_dhi()
returns the BESDataHandlerInterface of either a sub command, if one exists, or this command's
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