OPeNDAP Hyrax Back End Server (BES)  Updated for version 3.8.3
ShowPathInfoCommand.cc
Go to the documentation of this file.
1 
2 
3 #include "ShowPathInfoCommand.h"
4 #include "W10NNames.h"
5 #include "BESDataNames.h"
6 #include "BESDebug.h"
7 #include "BESUtil.h"
8 #include "BESXMLUtils.h"
9 #include "BESSyntaxUserError.h"
10 
11 
12 
14  : BESXMLCommand( base_dhi )
15 {
16 }
17 
24 void
26 {
27  string name ;
28  string value ;
29  map<string, string> props ;
30  BESXMLUtils::GetNodeInfo( node, name, value, props ) ;
31  if( name != SHOW_PATH_INFO_RESPONSE_STR )
32  {
33  string err = "The specified command " + name
34  + " is not a show w10n command" ;
35  throw BESSyntaxUserError( err, __FILE__, __LINE__ ) ;
36  }
37 
38  // the the action is to show the w10n info response
41  _str_cmd = "show pathInfo" ;
42 
43  // node is an optional property, so could be empty string
44  _dhi.data[CONTAINER] = props["node"] ;
45  if( !_dhi.data[CONTAINER].empty() )
46  {
47  _str_cmd += " for " + _dhi.data[CONTAINER] ;
48  }
49  _str_cmd += ";" ;
50 
51  BESDEBUG(W10N_DEBUG_KEY, "Built BES Command: '" << _str_cmd << "'"<< endl ) ;
52 
53  // now that we've set the action, go get the response handler for the
54  // action by calling set_response() in our parent class
56 }
57 
64 void
65 ShowPathInfoCommand::dump( ostream &strm ) const
66 {
67  strm << BESIndent::LMarg << "ShowPathInfoCommand::dump - ("
68  << (void *)this << ")" << endl ;
70  BESXMLCommand::dump( strm ) ;
72 }
73 
76 {
77  return new ShowPathInfoCommand( base_dhi ) ;
78 }
79 
static BESXMLCommand * CommandBuilder(const BESDataHandlerInterface &base_dhi)
virtual void dump(ostream &strm) const
dumps information about this object
static void GetNodeInfo(xmlNode *node, string &name, string &value, map< string, string > &props)
get the name, value if any, and any properties for the specified node
Definition: BESXMLUtils.cc:105
ShowPathInfoCommand(const BESDataHandlerInterface &base_dhi)
BESDataHandlerInterface _dhi
Definition: BESXMLCommand.h:57
static void Indent()
Definition: BESIndent.cc:38
error thrown if there is a user syntax error in the request or any other user error ...
virtual void parse_request(xmlNode *node)
parse a show command.
virtual void set_response()
The request has been parsed, use the command action name to set the response handler.
static ostream & LMarg(ostream &strm)
Definition: BESIndent.cc:73
#define CONTAINER
Definition: BESDataNames.h:71
#define W10N_DEBUG_KEY
Definition: W10NNames.h:4
#define SHOW_PATH_INFO_RESPONSE
Definition: W10NNames.h:12
#define SHOW_PATH_INFO_RESPONSE_STR
Definition: W10NNames.h:13
Structure storing information used by the BES to handle the request.
map< string, string > data
the map of string data that will be required for the current request.
#define BESDEBUG(x, y)
macro used to send debug information to the debug stream
Definition: BESDebug.h:64
static void UnIndent()
Definition: BESIndent.cc:44
string action
the response object requested, e.g.
virtual void dump(ostream &strm) const
dumps information about this object