33 #include "BESRequestHandlerList.h" 34 #include "BESRequestHandler.h" 35 #include "BESInternalError.h" 36 #include "BESDataNames.h" 52 _handler_list[handler_name] = handler_object;
74 BESRequestHandlerList::Handler_iter i;
75 i = _handler_list.find(handler_name);
76 if (i != _handler_list.end()) {
78 _handler_list.erase(i);
92 BESRequestHandlerList::Handler_citer i;
93 i = _handler_list.find(handler_name);
94 if (i != _handler_list.end()) {
109 return _handler_list.begin();
119 return _handler_list.end();
132 bool first_name =
true;
133 BESRequestHandlerList::Handler_citer i = _handler_list.begin();
134 for (; i != _handler_list.end(); i++) {
135 if (!first_name) ret +=
", ";
190 for (; i != ie; i++) {
266 string c_list = dhi.
data[REAL_NAME_LIST];
267 if (!c_list.empty()) c_list +=
", ";
269 dhi.
data[REAL_NAME_LIST] = c_list;
276 +
"\" does not handle the response type \"" + dhi.
action +
"\"";
296 strm << BESIndent::LMarg <<
"BESRequestHandlerList::dump - (" << (
void *)
this <<
")" << endl;
298 if (_handler_list.size()) {
299 strm << BESIndent::LMarg <<
"registered handlers:" << endl;
301 BESRequestHandlerList::Handler_citer i = _handler_list.begin();
302 BESRequestHandlerList::Handler_citer ie = _handler_list.end();
303 for (; i != ie; i++) {
307 BESIndent::UnIndent();
310 strm << BESIndent::LMarg <<
"registered handlers: none" << endl;
312 BESIndent::UnIndent();
316 BESRequestHandlerList::TheList()
318 if (_instance == 0) {
virtual Handler_citer get_first_handler()
return an iterator pointing to the first request handler in the list
exception thrown if inernal error encountered
virtual bool add_handler(const string &handler_name, BESRequestHandler *handler)
add a request handler to the list of registered handlers for this server
void next_container()
set the container pointer to the next * container in the list, null if at the end or no containers in...
maintains the list of registered request handlers for this server
string get_container_type() const
retrieve the type of data this container holds, such as cedar or netcdf.
virtual void dump(ostream &strm) const
dumps information about this object
virtual string access()=0
returns the true name of this container
virtual BESRequestHandler * find_handler(const string &handler_name)
find and return the specified request handler
virtual void execute_each(BESDataHandlerInterface &dhi)
for each container in the given data handler interface, execute the given request ...
virtual void execute_all(BESDataHandlerInterface &dhi)
for all of the registered request handlers, execute the given request
string get_real_name() const
retrieve the real name for this container, such as a file name.
virtual void execute_once(BESDataHandlerInterface &dhi)
Execute a single method that will fill in the response object rather than iterating over the list of ...
virtual string get_handler_names()
Returns a comma separated string of request handlers registered with the server.
Represents a specific data type request handler.
Structure storing information used by the BES to handle the request.
map< string, string > data
the map of string data that will be required for the current request.
virtual Handler_citer get_last_handler()
return a constant iterator pointing to the end of the list
virtual void execute_current(BESDataHandlerInterface &dhi)
Execute a single method for the current container that will fill in the response object rather than i...
void first_container()
set the container pointer to the first container in the containers list
virtual void dump(ostream &strm) const
dumps information about this object
virtual p_request_handler find_handler(const string &handler_name)
find the method that can handle the specified response object type
string action
the response object requested, e.g. das, dds
BESContainer * container
pointer to current container in this interface
virtual BESRequestHandler * remove_handler(const string &handler_name)
remove and return the specified request handler