bes
Updated for version 3.19.1
|
Entry point into BES, building responses to given requests. More...
#include <BESInterface.h>
Public Member Functions | |
virtual void | dump (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 | |
BESInterface (ostream *strm) | |
virtual void | build_data_request_plan ()=0 |
virtual void | clean ()=0 |
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 ()=0 |
virtual void | finish () |
virtual void | log_status ()=0 |
virtual void | transmit_data ()=0 |
Protected Attributes | |
BESDataHandlerInterface * | d_dhi_ptr |
Allocated by the child class. More... | |
BESTransmitter * | d_transmitter |
The Transmitter to use for the result. More... | |
Entry point into BES, building responses to given requests.
BESInterface is an abstract class providing the entry point into the retrieval of information using the BES framework. There are eight steps to retrieving a response to a given request:
The way in which the response is generated is as follows. A BESResponseHandler is found that knows how to build the requested response object. The built-in response handlers are for the response objects das, dds, ddx, data, help, version. These response handlers are added to a response handler list during initialization. Additional response handlers can be added to this list. For example, in Cedar, response handlers are registered to build flat, tab, info, and stream responses.
To build the response objects a user can make many requests. For example, a das object can be built using as many different files as is requested, say for file1,file2,file3,file4. And each of these files could be of a different data type. For example, file1 and file3 could be cedar files, file2 could be cdf file and file4 could be a netcdf file.
The structure that holds all of the requested information is the BESDataHandlerInterface. It holds on to a list of containers, each of which has the data type (cedar, cdf, nph, etc...) and the file to be read. The BESDataHandlerInterface is built in the build request method.
The response handlers know how to build the specified response object, such as DAS, DDS, help, status, version, etc...
For each container in the BESDataHandlerInterface find the request handler (BESRequestHandler) for the containers data type. Each request handler registers functions that know how to fill in a certain type of response (DAS, DDS, etc...). Find that function and invoke it. So, for example, there is a CedarRequestHandler class that registers functions that knows how to fill in the different response objects from cedar files.
Once the response object is filled it is transmitted using a specified BESTransmitter.
The status is then logged (default is to not log any status. It is up to derived classes of BESInterface to implement the log_status method.)
The request and status are then reported. The default action is to pass off the reporting to BESReporterList::TheList(), which has a list of registered reporters and passes off the information to each of those reporters. For example, if the Cedar project wants to report on any cedar access then it can register a reporter with BESReporterList::TheList().
Definition at line 115 of file BESInterface.h.
|
virtual |
dumps information about this object
Displays the pointer value of this instance along with information about BESDataHandlerInterface, the BESTransmitter being used, and the number of initialization and termination callbacks.
strm | C++ i/o stream to dump the information to |
Implements BESObj.
Reimplemented in BESXMLInterface.
Definition at line 501 of file BESInterface.cc.
|
protectedvirtual |
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.
|
protectedvirtual |
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.
e | BESError to be managed |
Definition at line 488 of file BESInterface.cc.
|
virtual |
The entry point for command execution; called by BESServerHandler::execute()
Execute the request by:
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.
from | A 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) |
Definition at line 285 of file BESInterface.cc.
|
protected |
Allocated by the child class.
Definition at line 121 of file BESInterface.h.
|
protected |
The Transmitter to use for the result.
Definition at line 122 of file BESInterface.h.