36#include "BESRequestHandler.h"
37#include "BESNotFoundError.h"
61 _handler_list[handler_name] = handler_method;
76 BESRequestHandler::Handler_iter i;
77 i = _handler_list.find(handler_name);
78 if (i != _handler_list.end()) {
79 _handler_list.erase(i);
97 BESRequestHandler::Handler_citer i;
98 i = _handler_list.find(handler_name);
99 if (i != _handler_list.end()) {
115 bool first_name =
true;
116 BESRequestHandler::Handler_citer i = _handler_list.begin();
117 for (; i != _handler_list.end(); i++) {
118 if (!first_name) ret +=
", ";
141 if (stat(name.c_str(), &statbuf) == -1){
146 return statbuf.st_mtime;
154 throw BESNotFoundError(
"Cannot find the add_attributes() in the specific handler.", __FILE__, __LINE__);
166 strm << BESIndent::LMarg <<
"BESRequestHandler::dump - (" << (
void *)
this <<
")" << endl;
168 strm << BESIndent::LMarg <<
"name: " << _name << endl;
169 if (_handler_list.size()) {
170 strm << BESIndent::LMarg <<
"registered handler functions:" << endl;
172 BESRequestHandler::Handler_citer i = _handler_list.begin();
173 BESRequestHandler::Handler_citer ie = _handler_list.end();
174 for (; i != ie; i++) {
175 strm << BESIndent::LMarg << (*i).first << endl;
177 BESIndent::UnIndent();
180 strm << BESIndent::LMarg <<
"registered handler functions: none" << endl;
182 BESIndent::UnIndent();
Structure storing information used by the BES to handle the request.
error thrown if the resource requested cannot be found
virtual std::string get_method_names()
return a comma separated list of response object types handled by this request handler
virtual time_t get_lmt(const std::string &name)
Get the Last modified time for.
virtual p_request_handler_method find_method(const std::string &name)
find the method that can handle the specified response object type
virtual bool add_method(const std::string &name, p_request_handler_method method)
add a handler method to the request handler that knows how to fill in a specific response object
virtual bool remove_method(const std::string &name)
remove the specified handler method from this request handler
virtual void dump(std::ostream &strm) const
dumps information about this object