bes  Updated for version 3.19.1
BESXMLInterface Class Reference

Entry point into BES using xml document requests. More...

#include <BESXMLInterface.h>

Inheritance diagram for BESXMLInterface:
Inheritance graph

Public Member Functions

 BESXMLInterface (const std::string &cmd, std::ostream *strm)
 
virtual void dump (std::ostream &strm) const
 dumps information about this object More...
 
virtual int execute_request (const string &from)
 The entry point for command execution; called by BESServerHandler::execute() More...
 
virtual int finish_with_error (int status)
 

Protected Member Functions

virtual void build_data_request_plan ()
 Build the data request plan using the BESCmdParser. More...
 
virtual void clean ()
 Clean up after the request is completed. More...
 
virtual void end_request ()
 End the BES request. More...
 
virtual int exception_manager (BESError &e)
 Manage any exceptions thrown during the whole process. More...
 
virtual void execute_data_request_plan ()
 Execute the data request plan. More...
 
virtual void finish ()
 
virtual void log_status ()
 Log the status of the request to the BESLog file. More...
 
virtual void transmit_data ()
 Transmit the response object. More...
 

Protected Attributes

BESDataHandlerInterfaced_dhi_ptr
 Allocated by the child class. More...
 
BESTransmitterd_transmitter
 The Transmitter to use for the result. More...
 

Detailed Description

Entry point into BES using xml document requests.

See also
BESInterface

Definition at line 47 of file BESXMLInterface.h.

Member Function Documentation

◆ build_data_request_plan()

void BESXMLInterface::build_data_request_plan ( )
protectedvirtual

Build the data request plan using the BESCmdParser.

Implements BESInterface.

Definition at line 71 of file BESXMLInterface.cc.

◆ clean()

void BESXMLInterface::clean ( )
protectedvirtual

Clean up after the request is completed.

Implements BESInterface.

Definition at line 342 of file BESXMLInterface.cc.

◆ dump()

void BESXMLInterface::dump ( std::ostream &  strm) const
virtual

dumps information about this object

Displays the pointer value of this instance

Parameters
strmC++ i/o stream to dump the information to

Reimplemented from BESInterface.

Definition at line 369 of file BESXMLInterface.cc.

◆ end_request()

void BESInterface::end_request ( )
protectedvirtualinherited

End the BES request.

This method allows developers to add callbacks at the end of a request, to do any cleanup or do any extra work at the end of a request

Definition at line 465 of file BESInterface.cc.

◆ exception_manager()

int BESInterface::exception_manager ( BESError e)
protectedvirtualinherited

Manage any exceptions thrown during the whole process.

Specific responses are generated given a specific Exception caught. If additional exceptions are thrown within derived systems then implement those in the derived exception_manager methods. This is a catch-all manager and should be called once derived methods have caught their exceptions.

Parameters
eBESError to be managed
Returns
status after exception is handled
See also
BESError

Definition at line 488 of file BESInterface.cc.

◆ execute_data_request_plan()

void BESXMLInterface::execute_data_request_plan ( )
protectedvirtual

Execute the data request plan.

Implements BESInterface.

Definition at line 216 of file BESXMLInterface.cc.

◆ execute_request()

int BESInterface::execute_request ( const string &  from)
virtualinherited

The entry point for command execution; called by BESServerHandler::execute()

Execute the request by:

  1. initializing BES
  2. build the request plan (i.e., filling in the BESDataHandlerInterface)
  3. execute the request plan using the BESDataHandlerInterface
  4. transmit the resulting response object
  5. log the status of the execution
  6. end the request, which allows developers to add callbacks to notify them of the end of the request

If an exception is thrown in any of these steps the exception is handed over to the exception manager in order to generate the proper response. Control is returned back to the calling method if an exception is thrown and it is the responsibility of the calling method to call finish_with_error in order to transmit the error message back to the client.

Parameters
fromA string that tells where this request came from. Literally, the IP and port number or the string 'standalone'. See void BESServerHandler::execute(Connection *c) or void StandAloneClient::executeCommand(const string & cmd, int repeat)
Returns
status of the execution of the request, 0 if okay, !0 otherwise
See also
initialize()
build_data_request_plan()
execute_data_request_plan()
finish()
finish_with_error()
transmit_data()
log_status()
end_request()
exception_manager()

Definition at line 285 of file BESInterface.cc.

◆ log_status()

void BESXMLInterface::log_status ( )
protectedvirtual

Log the status of the request to the BESLog file.

This will only log information in the verbose mode.

See also
BESLog

Implements BESInterface.

Definition at line 322 of file BESXMLInterface.cc.

◆ transmit_data()

void BESXMLInterface::transmit_data ( )
protectedvirtual

Transmit the response object.

Todo:
Remove?

Only transmit if there is an error or if there is a ResponseHandler. For any XML document with one or more commands, there should only be one ResponseHandler.

Implements BESInterface.

Definition at line 287 of file BESXMLInterface.cc.

Member Data Documentation

◆ d_dhi_ptr

BESDataHandlerInterface* BESInterface::d_dhi_ptr
protectedinherited

Allocated by the child class.

Definition at line 121 of file BESInterface.h.

◆ d_transmitter

BESTransmitter* BESInterface::d_transmitter
protectedinherited

The Transmitter to use for the result.

Definition at line 122 of file BESInterface.h.


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