33 #include <BESRequestHandlerList.h> 35 #include <BESResponseHandlerList.h> 36 #include <BESResponseNames.h> 37 #include <BESContainerStorageList.h> 38 #include <TheBESKeys.h> 39 #include <BESSyntaxUserError.h> 41 #include "GatewayModule.h" 42 #include "GatewayRequestHandler.h" 43 #include "GatewayResponseNames.h" 44 #include "GatewayContainerStorage.h" 45 #include "GatewayUtils.h" 46 #include "GatewayPathInfoResponseHandler.h" 47 #include "GatewayPathInfoCommand.h" 50 using namespace gateway;
52 void GatewayModule::initialize(
const string &modname)
54 BESDEBUG(modname,
"Initializing Gateway Module " << modname << endl);
56 BESDEBUG(modname,
" adding " << modname <<
" request handler" << endl);
59 BESDEBUG(modname,
" adding " << modname <<
" container storage" << endl);
62 BESDEBUG(modname,
" initialize the gateway utilities and params" << endl);
63 GatewayUtils::Initialize();
65 BESDEBUG(modname,
" adding Gateway debug context" << endl);
68 BESDEBUG( modname,
" adding " << SHOW_GATEWAY_PATH_INFO_RESPONSE_STR <<
" command" << endl ) ;
71 BESDEBUG(modname,
" adding " << SHOW_GATEWAY_PATH_INFO_RESPONSE <<
" response handler" << endl ) ;
72 BESResponseHandlerList::TheList()->
add_handler( SHOW_GATEWAY_PATH_INFO_RESPONSE, GatewayPathInfoResponseHandler::GatewayPathInfoResponseBuilder ) ;
74 BESDEBUG(modname,
"Done Initializing Gateway Module " << modname << endl);
77 void GatewayModule::terminate(
const string &modname)
79 BESDEBUG(modname,
"Cleaning Gateway module " << modname << endl);
81 BESResponseHandlerList::TheList()->
remove_handler( SHOW_GATEWAY_PATH_INFO_RESPONSE) ;
85 BESDEBUG(modname,
" removing " << modname <<
" request handler" << endl);
93 BESDEBUG(modname,
"Done Cleaning Gateway module " << modname << endl);
96 void GatewayModule::dump(ostream &strm)
const 98 strm << BESIndent::LMarg <<
"GatewayModule::dump - (" << (
void *)
this <<
")" << endl;
static void Register(const std::string &flagName)
register the specified debug flag
implementation of BESContainerStorageVolatile that represents a list of remote requests
virtual bool deref_persistence(const std::string &persist_name)
dereference a persistent store in the list.
virtual bool add_handler(const std::string &handler_name, BESRequestHandler *handler)
add a request handler to the list of registered handlers for this server
virtual bool add_persistence(BESContainerStorage *p)
Add a persistent store to the list.
virtual bool add_handler(const string &handler, p_response_handler handler_method)
add a response handler to the list
Represents a specific data type request handler.
static void del_command(const std::string &cmd_str)
Deletes the command called cmd_str from the list of possible commands.
static void add_command(const std::string &cmd_str, p_xmlcmd_builder cmd)
Add a command to the possible commands allowed by this BES.
virtual bool remove_handler(const string &handler)
removes a response handler from the list
virtual BESRequestHandler * remove_handler(const std::string &handler_name)
remove and return the specified request handler