OPeNDAP Hyrax Back End Server (BES)  Updated for version 3.8.3
BESBasicInterface Class Reference

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

#include <BESBasicInterface.h>

Inheritance diagram for BESBasicInterface:
Inheritance graph
Collaboration diagram for BESBasicInterface:
Collaboration 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)
 
virtual ~BESBasicInterface ()
 

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. More...
 

Protected Attributes

BESDataHandlerInterface_dhi
 
BESTransmitter_transmitter
 

Detailed Description

Entry point into BES using string command requests.

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 ( ostream *  strm)

Instantiate a BESBasicInterface object given an output stream for the response object.

Parameters
strmThe output stream used for the output of the response object
See also
BESInterface

Definition at line 57 of file BESBasicInterface.cc.

BESBasicInterface::~BESBasicInterface ( )
virtual

Definition at line 62 of file BESBasicInterface.cc.

Member Function Documentation

void BESInterface::add_end_callback ( p_bes_end  end)
staticinherited

Definition at line 467 of file BESInterface.cc.

void BESInterface::add_init_callback ( p_bes_init  init)
staticinherited

Definition at line 281 of file BESInterface.cc.

void BESBasicInterface::build_data_request_plan ( )
protectedvirtual

Build the data request plan using the BESCmdParser.

See also
BESCmdParser

Implements BESInterface.

Reimplemented in BESXMLInterface.

Definition at line 128 of file BESBasicInterface.cc.

References BESInterface::_dhi, BESInterface::_transmitter, BESDEBUG, BESDataHandlerInterface::data, BESReturnManager::find_transmitter(), RETURN_CMD, and BESReturnManager::TheManager().

Referenced by BESXMLInterface::build_data_request_plan().

Here is the call graph for this function:

void BESBasicInterface::clean ( )
protectedvirtual

Clean up after the request is completed.

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 270 of file BESBasicInterface.cc.

References BESInterface::_dhi, BESInterface::clean(), BESDataHandlerInterface::data, DATA_REQUEST, REQUEST_FROM, SERVER_PID, and BESLog::TheLog().

Referenced by BESXMLInterface::clean().

Here is the call graph for this function:

void BESBasicInterface::dump ( 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.

Reimplemented in BESXMLInterface.

Definition at line 289 of file BESBasicInterface.cc.

References BESInterface::dump(), BESIndent::Indent(), BESIndent::LMarg(), and BESIndent::UnIndent().

Referenced by BESXMLInterface::dump().

Here is the call graph for this function:

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

References BESInterface::_dhi, BESDEBUG, BESDataHandlerInterface::container, BESDataHandlerInterface::data, DATA_REQUEST, BESDataHandlerInterface::first_container(), BESDataHandlerInterface::next_container(), and BESContainer::release().

Referenced by BESInterface::finish().

Here is the call graph for this function:

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

References BESInterface::_dhi, BESExceptionManager::handle_exception(), and BESExceptionManager::TheEHM().

Referenced by BESInterface::execute_request(), BESInterface::finish(), and BESInterface::finish_with_error().

Here is the call graph for this function:

void BESBasicInterface::execute_data_request_plan ( )
protectedvirtual

Execute the data request plan.

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 161 of file BESBasicInterface.cc.

References BESInterface::_dhi, BESDataHandlerInterface::data, DATA_REQUEST, BESInterface::execute_data_request_plan(), REQUEST_FROM, SERVER_PID, and BESLog::TheLog().

Referenced by BESXMLInterface::execute_data_request_plan().

Here is the call graph for this function:

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

Override execute_request in order to register memory pool.

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 75 of file BESBasicInterface.cc.

References BESInterface::execute_request().

Referenced by BESXMLInterface::execute_request().

Here is the call graph for this function:

int BESInterface::finish_with_error ( int  status)
virtualinherited

Definition at line 267 of file BESInterface.cc.

References BESInterface::_dhi, BESDataHandlerInterface::error_info, BESInterface::exception_manager(), and BESInterface::finish().

Here is the call graph for this function:

void BESBasicInterface::initialize ( )
protectedvirtual

Initialize the BES.

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 90 of file BESBasicInterface.cc.

References BESInterface::_transmitter, BASIC_TRANSMITTER, BESDEBUG, BESReturnManager::find_transmitter(), BESInterface::initialize(), and BESReturnManager::TheManager().

Referenced by BESXMLInterface::initialize().

Here is the call graph for this function:

void BESBasicInterface::invoke_aggregation ( )
protectedvirtual

Invoke the aggregation server, if there is one.

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 181 of file BESBasicInterface.cc.

References BESInterface::_dhi, AGG_CMD, AGG_HANDLER, BESDataHandlerInterface::data, DATA_REQUEST, BESAggFactory::find_handler(), BESInterface::invoke_aggregation(), BESLog::is_verbose(), REQUEST_FROM, SERVER_PID, BESAggFactory::TheFactory(), and BESLog::TheLog().

Referenced by BESXMLInterface::invoke_aggregation().

Here is the call graph for this function:

void BESBasicInterface::log_status ( )
protectedvirtual

Log the status of the request to the BESLog file.

See also
BESLog

Reimplemented from BESInterface.

Reimplemented in BESXMLInterface.

Definition at line 247 of file BESBasicInterface.cc.

References BESInterface::_dhi, BESDataHandlerInterface::data, DATA_REQUEST, BESDataHandlerInterface::error_info, REQUEST_FROM, SERVER_PID, and BESLog::TheLog().

Referenced by BESXMLInterface::log_status().

Here is the call graph for this function:

void BESInterface::report_request ( )
protectedvirtualinherited

Report the request and status of the request to BESReporterList::TheList()

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

References BESInterface::_dhi, BESDEBUG, BESDataHandlerInterface::data, DATA_REQUEST, BESReporterList::report(), and BESReporterList::TheList().

Referenced by BESInterface::finish(), and BESXMLInterface::report_request().

Here is the call graph for this function:

void BESBasicInterface::transmit_data ( )
protectedvirtual

Transmit the response object.

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 230 of file BESBasicInterface.cc.

References BESInterface::_dhi, BESDataHandlerInterface::data, DATA_REQUEST, REQUEST_FROM, SERVER_PID, BESLog::TheLog(), and BESInterface::transmit_data().

Referenced by BESXMLInterface::transmit_data().

Here is the call graph for this function:

void BESBasicInterface::validate_data_request ( )
protectedvirtual

Validate the incoming request information.

Reimplemented from BESInterface.

Reimplemented in BESXMLInterface.

Definition at line 118 of file BESBasicInterface.cc.

References BESInterface::validate_data_request().

Referenced by BESXMLInterface::validate_data_request().

Here is the call graph for this function:

Member Data Documentation

BESTransmitter* BESInterface::_transmitter
protectedinherited

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