bes  Updated for version 3.17.4
BESResponseHandler Class Referenceabstract

handler object that knows how to create a specific response object More...

#include <BESResponseHandler.h>

Inheritance diagram for BESResponseHandler:
Inheritance graph

Public Member Functions

virtual void dump (ostream &strm) const
 dumps information about this object More...
 
virtual void execute (BESDataHandlerInterface &dhi)=0
 knows how to build a requested response object More...
 
virtual string get_name () const
 return the name of this response object More...
 
virtual BESResponseObjectget_response_object ()
 return the current response object More...
 
virtual BESResponseObjectset_response_object (BESResponseObject *o)
 replaces the current response object with the specified one, returning the current response object More...
 
virtual void transmit (BESTransmitter *transmitter, BESDataHandlerInterface &dhi)=0
 transmit the response object built by the execute command using the specified transmitter object More...
 

Protected Member Functions

 BESResponseHandler (const string &name)
 

Protected Attributes

BESResponseObject_response
 
string _response_name
 

Detailed Description

A response handler is something that knows how to create a response object, such as a DAS, DDS, DDX, informational response object. It knows how to construct the requested response object but does not necessarily fill in the response object. It does know, however, how to have other objects fill in the response object. For example, a BESDASResponseHandler knows that it needs to go to each of the request handlers (data handlers) for each of the containers requested so that those request handlers can fill in the response object. Another example is the BESHelpResponseHandler, which knows to construct an informational response object and then pass that informational response object to each registered request handler (data handler) so that each of the request handlers has an opportunity to add any help information it needs to add.

Response handlers such as the BESStatusResponseHandler (and others) are able to create the informational response object and fill it in without handing off the response object to any other object. But usually, the response handler passes the response object to another object to have it fill in the response object.

A response handler object also knows how to transmit the response object using a BESTransmitter object.

This is an abstract base class for response handlers. Derived classes implement the methods execute and transmit.

See also
BESResponseObject
BESContainer
BESRequestHandler
BESResponseHandlerList
BESTransmitter

Definition at line 81 of file BESResponseHandler.h.

Member Function Documentation

◆ dump()

◆ execute()

virtual void BESResponseHandler::execute ( BESDataHandlerInterface dhi)
pure virtual

Derived instances of this abstract base class know how to create a specific response object and what objects (including itself) to pass that response object to for it to be filled in.

Parameters
dhistructure that holds request and response information
Exceptions
BESHandlerExceptionif there is a problem building the response object
BESResponseExceptionupon fatal error building the response object
See also
BESDataHandlerInterface
BESResponseObject

Implemented in BESDefineResponseHandler, BESSetContainerResponseHandler, BESDDXResponseHandler, BESDelDefResponseHandler, BESDelDefsResponseHandler, BESSetContextResponseHandler, BESDataDDXResponseHandler, BESCatalogResponseHandler, BESDelContainersResponseHandler, BESHelpResponseHandler, BESShowContainersResponseHandler, BESDelContainerResponseHandler, BESShowContextResponseHandler, BESDASResponseHandler, BESDataResponseHandler, BESShowErrorResponseHandler, BESVersionResponseHandler, BESDDSResponseHandler, BESDMRResponseHandler, BESConfigResponseHandler, BESShowDefsResponseHandler, BESStatusResponseHandler, BESProcIdResponseHandler, BESServicesResponseHandler, BESStreamResponseHandler, SampleSayResponseHandler, and BESDap4ResponseHandler.

◆ get_name()

virtual string BESResponseHandler::get_name ( ) const
inlinevirtual

This name is used to determine which response handler can handle a requested response, such as das, dds, ddx, tab, info, version, help, etc...

Returns
response name

Definition at line 156 of file BESResponseHandler.h.

References dump().

◆ get_response_object()

BESResponseObject * BESResponseHandler::get_response_object ( )
virtual

Returns the current response object, null if one has not yet been created. The response handler maintains ownership of the response object.

Returns
current response object
See also
BESResponseObject

Definition at line 53 of file BESResponseHandler.cc.

◆ set_response_object()

BESResponseObject * BESResponseHandler::set_response_object ( BESResponseObject o)
virtual

This method is used to replace the response object with a new one, for example if during aggregation a new response object is built from the current response object.

The caller of set_response_object now owns the returned response object. The new response object is now owned by the response object.

Parameters
onew response object used to replace the current one
Returns
the response object being replaced
See also
BESResponseObject

Definition at line 59 of file BESResponseHandler.cc.

◆ transmit()


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