29#include "NCMLCacheAggXMLCommand.h"
31#include "BESXMLUtils.h"
33#include "BESSyntaxUserError.h"
37#include "NCMLResponseNames.h"
43NCMLCacheAggXMLCommand::NCMLCacheAggXMLCommand(
const BESDataHandlerInterface& baseDHI) :
44 BESXMLCommand(baseDHI)
49NCMLCacheAggXMLCommand::~NCMLCacheAggXMLCommand()
63 THROW_NCML_PARSE_ERROR(-1,
"Got unexpected command name=" + cmdName);
66 if (!contentValue.empty()) {
67 THROW_NCML_PARSE_ERROR(-1, cmdName +
": should not have xml content!");
75 THROW_NCML_PARSE_ERROR(-1,
76 cmdName +
": we did find the required aggregation location specified in the attribute="
81 string childContentValue;
85 THROW_NCML_PARSE_ERROR(-1, cmdName +
": should not have child elements!");
88 if (!childAttrs.empty()) {
89 THROW_NCML_PARSE_ERROR(-1, cmdName +
": should not have attributes!");
110void NCMLCacheAggXMLCommand::dump(
ostream& strm)
const
112 strm << BESIndent::LMarg <<
"NCMLCacheAggXMLCommand::dump - (" << (
void *)
this <<
")" << endl;
115 BESIndent::UnIndent();
122 return new NCMLCacheAggXMLCommand(baseDHI);
127NCMLCacheAggResponseHandler::NCMLCacheAggResponseHandler(
const string &name) :
130 BESDEBUG(
"ncml",
"NCMLCacheAggResponseHandler::NCMLCacheAggResponseHandler() called..." << endl);
134NCMLCacheAggResponseHandler::~NCMLCacheAggResponseHandler()
145 BESDEBUG(
"ncml",
"We got a cacheAgg request for the aggregation location = " << loc << endl);
156void NCMLCacheAggResponseHandler::dump(
ostream & )
const
164NCMLCacheAggResponseHandler::makeInstance(
const string &name)
166 return new NCMLCacheAggResponseHandler(name);
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.
handler object that knows how to create a specific response object
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 execute(BESDataHandlerInterface &dhi)
knows how to build a requested response object
virtual void transmit(BESTransmitter *pTransmitter, BESDataHandlerInterface &dhi)
transmit the response object built by the execute command using the specified transmitter object
virtual void prep_request()
Prepare any information needed to execute the request of this command.
virtual void parse_request(xmlNode *pNode)
Parse the XML request document beginning at the given node.
virtual bool has_response()
Does this command return a response to the client?
NcML Parser for adding/modifying/removing metadata (attributes) to existing local datasets using NcML...
static const std::string CACHE_AGG_RESPONSE
static const std::string CACHE_AGG_LOCATION_XML_ATTR
static const std::string NCML_NAME
static const std::string CACHE_AGG_LOCATION_DATA_KEY