bes  Updated for version 3.17.4
BESBasicInterface Class Reference

Entry point into BES using string command requests. More...

#include <BESBasicInterface.h>

Inheritance diagram for BESBasicInterface:
Inheritance graph

Public Member Functions

 BESBasicInterface (ostream *strm)
 Instantiate a BESBasicInterface object given an output stream for the response object. More...
 
virtual void dump (ostream &strm) const
 dumps information about this object More...
 
virtual int execute_request (const string &from)
 Override execute_request in order to register memory pool. More...
 
virtual int finish_with_error (int status)
 

Static Public Member Functions

static void add_end_callback (p_bes_end end)
 
static void add_init_callback (p_bes_init init)
 

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 int finish (int status)
 
virtual void initialize ()
 Initialize the BES. More...
 
virtual void invoke_aggregation ()
 Invoke the aggregation server, if there is one. More...
 
virtual void log_status ()
 Log the status of the request to the BESLog file. More...
 
virtual void report_request ()
 Report the request and status of the request to BESReporterList::TheList() More...
 
virtual void transmit_data ()
 Transmit the response object. More...
 
virtual void validate_data_request ()
 Validate the incoming request information.
 

Protected Attributes

BESDataHandlerInterface_dhi
 
BESTransmitter_transmitter
 

Detailed Description

The format of the request looks something like:

set container in catalog values c,nc/mplot.nc;
define d as c;
get das for d;

In this example a DAS object response is being requested. The DAS object is to be built from the definition 'd', where d is defined using the data container c. The data container c is created using the real file nc/mplot.nc

BESBasicInterface uses BESParser to parse through the request string, building up a plan to be used during the execute method. Most implementations simply log information to the BESLog file before calling the parent class method.

See also
BESInterface
BESParser

Definition at line 68 of file BESBasicInterface.h.

Constructor & Destructor Documentation

◆ BESBasicInterface()

BESBasicInterface::BESBasicInterface ( ostream *  strm)
Parameters
strmThe output stream used for the output of the response object
See also
BESInterface

Definition at line 57 of file BESBasicInterface.cc.

Member Function Documentation

◆ build_data_request_plan()

void BESBasicInterface::build_data_request_plan ( )
protectedvirtual
See also
BESCmdParser

Implements BESInterface.

Reimplemented in BESXMLInterface.

Definition at line 123 of file BESBasicInterface.cc.

References BESDataHandlerInterface::data.

◆ clean()

void BESBasicInterface::clean ( )
protectedvirtual

Calls the parent method clean and then logs to the BESLog file saying that we are done and exiting the process. The exit actually takes place in the module code.

See also
BESLog

Reimplemented from BESInterface.

Reimplemented in BESXMLInterface.

Definition at line 235 of file BESBasicInterface.cc.

References BESInterface::clean(), and BESDataHandlerInterface::data.

◆ dump()

void BESBasicInterface::dump ( ostream &  strm) const
virtual

Displays the pointer value of this instance

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

Reimplemented from BESInterface.

Reimplemented in BESXMLInterface.

Definition at line 250 of file BESBasicInterface.cc.

References BESInterface::dump().

◆ end_request()

void BESInterface::end_request ( )
protectedvirtualinherited

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 706 of file BESInterface.cc.

References BESDataHandlerInterface::container, BESDataHandlerInterface::data, BESDataHandlerInterface::first_container(), and BESDataHandlerInterface::next_container().

◆ exception_manager()

int BESInterface::exception_manager ( BESError e)
protectedvirtualinherited

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 746 of file BESInterface.cc.

References BESExceptionManager::handle_exception().

◆ execute_data_request_plan()

void BESBasicInterface::execute_data_request_plan ( )
protectedvirtual

Simply calls the parent method. Prior to calling the parent method logs a message to the dods log file.

See also
BESLog

Reimplemented from BESInterface.

Reimplemented in BESXMLInterface.

Definition at line 155 of file BESBasicInterface.cc.

References BESDataHandlerInterface::data, and BESInterface::execute_data_request_plan().

◆ execute_request()

int BESBasicInterface::execute_request ( const string &  from)
virtual

Once the memory pool is initialized hand over control to parent class to execute the request. Once completed, unregister the memory pool.

This needs to be done here instead of the initialization method because???

Reimplemented from BESInterface.

Reimplemented in BESXMLInterface.

Definition at line 74 of file BESBasicInterface.cc.

◆ initialize()

void BESBasicInterface::initialize ( )
protectedvirtual

Determines what transmitter this BES will be using to transmit response objects and then calls the parent initialization method in order to initialize all global variables.

See also
BESTransmitter
BESDataHandlerInterface

Reimplemented from BESInterface.

Reimplemented in BESXMLInterface.

Definition at line 88 of file BESBasicInterface.cc.

References BESInterface::initialize().

◆ invoke_aggregation()

void BESBasicInterface::invoke_aggregation ( )
protectedvirtual

Simply calls the parent method. Prior to calling the parent method logs a message to the dods log file.

See also
BESLog

Reimplemented from BESInterface.

Reimplemented in BESXMLInterface.

Definition at line 171 of file BESBasicInterface.cc.

References BESDataHandlerInterface::data, BESAggFactory::find_handler(), BESInterface::invoke_aggregation(), and BESLog::is_verbose().

◆ log_status()

void BESBasicInterface::log_status ( )
protectedvirtual
See also
BESLog

Reimplemented from BESInterface.

Reimplemented in BESXMLInterface.

Definition at line 217 of file BESBasicInterface.cc.

References BESDataHandlerInterface::data, and BESDataHandlerInterface::error_info.

◆ report_request()

void BESInterface::report_request ( )
protectedvirtualinherited

If interested in reporting the request and status of the request then one must register a BESReporter with BESReporterList::TheList().

If no BESReporter objects are registered then nothing happens.

See also
BESReporterList
BESReporter

Reimplemented in BESXMLInterface.

Definition at line 687 of file BESInterface.cc.

References BESDataHandlerInterface::data.

◆ transmit_data()

void BESBasicInterface::transmit_data ( )
protectedvirtual

Simply calls the parent method. Prior to calling the parent method logs a message to the dods log file.

See also
BESLog

Reimplemented from BESInterface.

Reimplemented in BESXMLInterface.

Definition at line 204 of file BESBasicInterface.cc.

References BESDataHandlerInterface::data, and BESInterface::transmit_data().


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