BESResponseHandlerList Class Reference

List of all registered response handlers for this server. More...

#include <BESResponseHandlerList.h>

Inheritance diagram for BESResponseHandlerList:

Inheritance graph
[legend]
Collaboration diagram for BESResponseHandlerList:

Collaboration graph
[legend]
List of all members.

Public Types

typedef map< string, p_response_handler
>::const_iterator 
Handler_citer
typedef map< string, p_response_handler
>::iterator 
Handler_iter

Public Member Functions

virtual ~BESResponseHandlerList (void)
virtual bool add_handler (string handler_name, p_response_handler handler_method)
 add a response handler to the list
virtual bool remove_handler (string handler_name)
 removes a response handler from the list
virtual BESResponseHandlerfind_handler (string handler_name)
 returns the response handler with the given name from the list
virtual string get_handler_names ()
 returns the comma separated list of all response handlers currently registered with this server.
virtual void dump (ostream &strm) const
 dumps information about this object

Static Public Member Functions

static BESResponseHandlerListTheList ()

Protected Member Functions

 BESResponseHandlerList (void)

Detailed Description

List of all registered response handlers for this server.

A BESResponseHandlerList allows the developer to add or remove named response handlers from the list of handlers available for this server. For example, when the request 'get das for d1;' a response handler named "das" is looked up in the response handler list. Another example, 'show help;' would look up a response handler named "show".

What is actually added to the list are functions that instantiate the named response handler, not the response handler themselves.

See also:
BESResponseHandler

BESResponseObject

Definition at line 62 of file BESResponseHandlerList.h.


Member Typedef Documentation

typedef map< string, p_response_handler >::const_iterator BESResponseHandlerList::Handler_citer

Definition at line 72 of file BESResponseHandlerList.h.

typedef map< string, p_response_handler >::iterator BESResponseHandlerList::Handler_iter

Definition at line 73 of file BESResponseHandlerList.h.


Constructor & Destructor Documentation

BESResponseHandlerList::BESResponseHandlerList ( void   )  [inline, protected]

Definition at line 68 of file BESResponseHandlerList.h.

virtual BESResponseHandlerList::~BESResponseHandlerList ( void   )  [inline, virtual]

Definition at line 70 of file BESResponseHandlerList.h.


Member Function Documentation

bool BESResponseHandlerList::add_handler ( string  handler_name,
p_response_handler  handler_method 
) [virtual]

add a response handler to the list

This method actually adds to the list a method that knows how to build a response handler. For each request that comes in, the response name (such as das or help or define) is looked up in this list and the method is used to build a new response handler.

Parameters:
handler_name name of the handler to add to the list
handler_method method that knows how to build the named response handler
Returns:
true if successfully added, false if it already exists
See also:
BESResponseHandler

BESResponseObject

Definition at line 52 of file BESResponseHandlerList.cc.

Referenced by TestModule::initialize(), BESDefaultModule::initialize(), BESDapModule::initialize(), and resplistT::run().

bool BESResponseHandlerList::remove_handler ( string  handler_name  )  [virtual]

removes a response handler from the list

The method that knows how to build the specified response handler is removed from the list.

Parameters:
handler_name name of the handler build method to remove from the list
Returns:
true if successfully removed, false if it doesn't exist in the list
See also:
BESResponseHandler

Definition at line 75 of file BESResponseHandlerList.cc.

Referenced by resplistT::run(), TestModule::terminate(), BESDefaultModule::terminate(), and BESDapModule::terminate().

BESResponseHandler * BESResponseHandlerList::find_handler ( string  handler_name  )  [virtual]

returns the response handler with the given name from the list

This method looks up the build method with the given name in the list. If it is found then the build method is invoked with the given handler name and the response handler built with the build method is returned. If the handler build method does not exist in the list then NULL is returned.

Parameters:
handler_name name of the handler to build and return
Returns:
a BESResponseHandler using the specified build method, or NULL if it doesn't exist in the list.
See also:
BESResponseHandler

Definition at line 100 of file BESResponseHandlerList.cc.

Referenced by BESCgiInterface::build_data_request_plan(), TestCommand::parse_request(), BESShowCommand::parse_request(), BESSetContextCommand::parse_request(), BESSetContainerCommand::parse_request(), BESGetCommand::parse_request(), BESDelDefsCommand::parse_request(), BESDelDefCommand::parse_request(), BESDelContainersCommand::parse_request(), BESDelContainerCommand::parse_request(), BESDefineCommand::parse_request(), BESCatalogCommand::parse_request(), and resplistT::run().

string BESResponseHandlerList::get_handler_names (  )  [virtual]

returns the comma separated list of all response handlers currently registered with this server.

Builds a comma separated list of response handlers registered with this server and returns it to the caller.

Returns:
comma separated list of response handler names

Definition at line 123 of file BESResponseHandlerList.cc.

void BESResponseHandlerList::dump ( ostream &  strm  )  const [virtual]

dumps information about this object

Displays the pointer value of this instance along with the names of the registered response handlers.

Parameters:
strm C++ i/o stream to dump the information to

Implements BESObj.

Definition at line 146 of file BESResponseHandlerList.cc.

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

Here is the call graph for this function:

BESResponseHandlerList * BESResponseHandlerList::TheList (  )  [static]

Definition at line 171 of file BESResponseHandlerList.cc.

Referenced by BESCgiInterface::build_data_request_plan(), TestModule::initialize(), BESDefaultModule::initialize(), BESDapModule::initialize(), TestCommand::parse_request(), BESShowCommand::parse_request(), BESSetContextCommand::parse_request(), BESSetContainerCommand::parse_request(), BESGetCommand::parse_request(), BESDelDefsCommand::parse_request(), BESDelDefCommand::parse_request(), BESDelContainersCommand::parse_request(), BESDelContainerCommand::parse_request(), BESDefineCommand::parse_request(), BESCatalogCommand::parse_request(), resplistT::run(), TestModule::terminate(), BESDefaultModule::terminate(), and BESDapModule::terminate().


The documentation for this class was generated from the following files:
Generated on Wed Aug 29 03:03:17 2007 for OPeNDAP Back End Server (BES) by  doxygen 1.5.2