35#include "BESXMLSetContainerCommand.h"
36#include "BESContainerStorageList.h"
37#include "BESCatalog.h"
39#include "BESXMLUtils.h"
42#include "BESResponseNames.h"
43#include "BESDataNames.h"
45#include "BESSyntaxUserError.h"
46#include "BESInternalError.h"
75 map<string, string> props;
77 if (action != SETCONTAINER_STR) {
78 throw BESInternalError(
string(
"The specified command ").append(action).append(
" is not a set container command."), __FILE__, __LINE__);
82 throw BESSyntaxUserError(action +
" command: container real name missing", __FILE__, __LINE__);
85 if (props[
"name"].empty())
86 throw BESSyntaxUserError(action +
" command: name property missing", __FILE__, __LINE__);
88 d_xmlcmd_dhi.data[SYMBOLIC_NAME] = props[
"name"];
96 BESCatalog *cat = BESUtil::separateCatalogFromPath(value);
98 if (!props[
"space"].empty())
99 VERBOSE(
"SetContainer called with 'space=\"" + props[
"space"] +
"\" but the pathname uses \"" + cat->
get_catalog_name() +
"\"");
103 if (!props[
"space"].empty()) {
104 d_xmlcmd_dhi.data[STORE_NAME] = props[
"space"];
107 d_xmlcmd_dhi.data[STORE_NAME] = CATALOG ;
111 d_xmlcmd_dhi.data[CONTAINER_TYPE] = props[
"type"];
114 d_xmlcmd_dhi.data[REAL_NAME] = value;
116 d_xmlcmd_dhi.action = SETCONTAINER;
118 d_cmd_log_info = (string)
"set container in " + props[
"space"] +
" values " + props[
"name"] +
"," + value;
119 if (!props[
"type"].empty()) {
137 strm << BESIndent::LMarg <<
"BESXMLSetContainerCommand::dump - (" << (
void *)
this <<
")" << endl;
140 BESIndent::UnIndent();
Catalogs provide a hierarchical organization for data.
virtual std::string get_catalog_name() const
Get the name for this catalog.
Structure storing information used by the BES to handle the request.
exception thrown if internal error encountered
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.
std::string d_cmd_log_info
Used only for the log.
Parse the setContainer element in a request document.
virtual void parse_request(xmlNode *node)
parse a set container command.
virtual void dump(std::ostream &strm) const
dumps information about this object
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