bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
BESXMLCommand Class Referenceabstract

Base class for the BES's commands. More...

#include <BESXMLCommand.h>

Inheritance diagram for BESXMLCommand:
Inheritance graph
Collaboration diagram for BESXMLCommand:
Collaboration graph

Public Member Functions

virtual void dump (std::ostream &strm) const
 dumps information about this object
 
virtual BESDataHandlerInterfaceget_xmlcmd_dhi ()
 Return the current BESDataHandlerInterface.
 
virtual bool has_response ()=0
 Does this command return a response to the client?
 
virtual void parse_request (xmlNode *node)=0
 Parse the XML request document beginning at the given node.
 
virtual void prep_request ()
 Prepare any information needed to execute the request of this command.
 

Static Public Member Functions

static void add_command (const std::string &cmd_str, p_xmlcmd_builder cmd)
 Add a command to the possible commands allowed by this BES.
 
static void del_command (const std::string &cmd_str)
 Deletes the command called cmd_str from the list of possible commands.
 
static p_xmlcmd_builder find_command (const std::string &cmd_str)
 Find the BESXMLCommand creation function with the given name.
 

Protected Member Functions

 BESXMLCommand (const BESDataHandlerInterface &base_dhi)
 Creates a BESXMLCommand document given a base data handler interface object.
 
virtual void set_response ()
 The request has been parsed, use the command action name to set the response handler.
 

Protected Attributes

std::string d_cmd_log_info
 Used only for the log.
 
BESDataHandlerInterface d_xmlcmd_dhi
 

Detailed Description

Base class for the BES's commands.

Maintains a factory for used to build all of the BES's commands. This class also holds instances of the DataHandlerInterface used by a particular instance of a command and the information about this command that should be written to the BES log.

@ The set_response() is used to form a linkage between the code

Definition at line 64 of file BESXMLCommand.h.

Constructor & Destructor Documentation

◆ BESXMLCommand()

BESXMLCommand::BESXMLCommand ( const BESDataHandlerInterface & base_dhi)
protected

Creates a BESXMLCommand document given a base data handler interface object.

Since there can be multiple commands within a single BES request document, there can be multiple data handler interface objects created. Use the one passed as the base interface handler object

Definition at line 57 of file BESXMLCommand.cc.

◆ ~BESXMLCommand()

virtual BESXMLCommand::~BESXMLCommand ( )
inlinevirtual

Definition at line 80 of file BESXMLCommand.h.

Member Function Documentation

◆ add_command()

void BESXMLCommand::add_command ( const std::string & cmd_str,
p_xmlcmd_builder cmd )
static

Add a command to the possible commands allowed by this BES.

This adds a function to parse a specific BES command within the BES request document using the given name. If a command element is found with the name cmd_str, then the XMLCommand object is created using the passed cmd object.

Parameters
cmd_strThe name of the command
cmdThe function to call to create the BESXMLCommand object

Definition at line 88 of file BESXMLCommand.cc.

◆ del_command()

void BESXMLCommand::del_command ( const std::string & cmd_str)
static

Deletes the command called cmd_str from the list of possible commands.

Parameters
cmd_strThe name of the command to remove from the list

Definition at line 98 of file BESXMLCommand.cc.

◆ dump()

◆ find_command()

p_xmlcmd_builder BESXMLCommand::find_command ( const std::string & cmd_str)
static

Find the BESXMLCommand creation function with the given name.

Parameters
cmd_strThe name of the command creation function to find

Definition at line 110 of file BESXMLCommand.cc.

◆ get_xmlcmd_dhi()

virtual BESDataHandlerInterface & BESXMLCommand::get_xmlcmd_dhi ( )
inlinevirtual

Return the current BESDataHandlerInterface.

Since there can be multiple commands within a single request document, different interface objects can be created. This returns the current interface object

Returns
The current BESDataHandlerInterface object

Reimplemented in BESXMLGetCommand.

Definition at line 121 of file BESXMLCommand.h.

◆ has_response()

virtual bool BESXMLCommand::has_response ( )
pure virtual

Does this command return a response to the client?

Every command has an associated ResponseHandler, but not all ResponseHandlers return information to the BES's client. In fact, for any group of commands sent to the BES, only one can return information (except for errors, which stop command processing). If this command does not normally return a response (text or binary data), the value of this method should be false.

Returns
true if it returns a response, false otherwise

Implemented in bes::ShowNodeCommand, bes::XMLSetContextsCommand, BESXMLCatalogCommand, BESXMLDefineCommand, BESXMLDeleteContainerCommand, BESXMLDeleteContainersCommand, BESXMLDeleteDefinitionCommand, BESXMLDeleteDefinitionsCommand, BESXMLGetCommand, BESXMLSetContainerCommand, BESXMLSetContextCommand, BESXMLShowCommand, BESXMLShowErrorCommand, GatewayPathInfoCommand, ncml_module::NCMLCacheAggXMLCommand, SampleSayXMLCommand, ShowBesKeyCommand, ShowPathInfoCommand, SiteMapCommand, and W10nShowPathInfoCommand.

◆ parse_request()

◆ prep_request()

virtual void BESXMLCommand::prep_request ( )
inlinevirtual

Prepare any information needed to execute the request of this command.

Reimplemented in BESXMLDefineCommand, BESXMLGetCommand, BESXMLGetDataDDXCommand, ncml_module::NCMLCacheAggXMLCommand, and SampleSayXMLCommand.

Definition at line 108 of file BESXMLCommand.h.

◆ set_response()

void BESXMLCommand::set_response ( )
protectedvirtual

The request has been parsed, use the command action name to set the response handler.

Definition at line 65 of file BESXMLCommand.cc.

Member Data Documentation

◆ d_cmd_log_info

std::string BESXMLCommand::d_cmd_log_info
protected

Used only for the log.

Definition at line 75 of file BESXMLCommand.h.

◆ d_xmlcmd_dhi

BESDataHandlerInterface BESXMLCommand::d_xmlcmd_dhi
protected

Definition at line 71 of file BESXMLCommand.h.


The documentation for this class was generated from the following files: