35 #include "BESRequestHandlerList.h" 36 #include "BESRequestHandler.h" 37 #include "BESInternalError.h" 53 _handler_list[handler_name] = handler_object;
75 BESRequestHandlerList::Handler_iter i;
76 i = _handler_list.find(handler_name);
77 if (i != _handler_list.end()) {
79 _handler_list.erase(i);
93 BESRequestHandlerList::Handler_citer i;
94 i = _handler_list.find(handler_name);
95 if (i != _handler_list.end()) {
110 return _handler_list.begin();
120 return _handler_list.end();
133 bool first_name =
true;
134 BESRequestHandlerList::Handler_citer i = _handler_list.begin();
135 for (; i != _handler_list.end(); i++) {
136 if (!first_name) ret +=
", ";
194 for (; i != ie; i++) {
268 if (!request_handler_method) {
270 +
"' does not handle the response type '" + dhi.
action +
"'", __FILE__, __LINE__);
273 request_handler_method(dhi);
286 strm << BESIndent::LMarg <<
"BESRequestHandlerList::dump - (" << (
void *)
this <<
")" << endl;
288 if (_handler_list.size()) {
289 strm << BESIndent::LMarg <<
"registered handlers:" << endl;
291 BESRequestHandlerList::Handler_citer i = _handler_list.begin();
292 BESRequestHandlerList::Handler_citer ie = _handler_list.end();
293 for (; i != ie; i++) {
297 BESIndent::UnIndent();
300 strm << BESIndent::LMarg <<
"registered handlers: none" << endl;
302 BESIndent::UnIndent();
306 BESRequestHandlerList::TheList()
308 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 void dump(std::ostream &strm) const
dumps information about this object
void next_container()
set the container pointer to the next * container in the list, null if at the end or no containers in...
virtual BESRequestHandler * find_handler(const std::string &handler_name)
find and return the specified request handler
virtual bool add_handler(const std::string &handler_name, BESRequestHandler *handler)
add a request handler to the list of registered handlers for this server
The list of registered request handlers for this server; a singleton.
virtual string access()=0
returns the true name of this container
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
virtual std::string get_handler_names()
Returns a comma separated string of request handlers registered with the server.
Represents a specific data type request handler.
virtual void dump(ostream &strm) const
dumps information about this object
Structure storing information used by the BES to handle the 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...
string get_container_type() const
retrieve the type of data this container holds, such as cedar or netcdf.
void first_container()
set the container pointer to the first container in the containers list
virtual BESRequestHandler * remove_handler(const std::string &handler_name)
remove and return the specified request handler
string action
the response object requested, e.g. das, dds
BESContainer * container
pointer to current container in this interface
virtual p_request_handler_method find_method(const string &name)
find the method that can handle the specified response object type