33#include "BESConfigResponseHandler.h"
34#include "TheBESKeys.h"
35#include "BESInfoList.h"
37#include "BESResponseNames.h"
41BESConfigResponseHandler::BESConfigResponseHandler(
const string &name )
46BESConfigResponseHandler::~BESConfigResponseHandler( )
69 BESInfo *info = BESInfoList::TheList()->build_info() ;
70 d_response_object = info ;
72 dhi.action_name = CONFIG_RESPONSE_STR ;
76 map<string,string, std::less<>> props ;
79 for( ; ki != ke; ki++ )
82 props[
"name"] = (*ki).first ;
83 info->begin_tag(
"key", &props ) ;
84 auto v = (*ki).second.begin() ;
85 auto ve = (*ki).second.end() ;
88 info->add_tag(
"value", (*v) ) ;
90 info->end_tag(
"key" ) ;
92 info->end_response() ;
111 if( d_response_object )
116 info->
transmit( transmitter, dhi ) ;
129 strm << BESIndent::LMarg <<
"BESConfigResponseHandler::dump - ("
130 << (
void *)
this <<
")" << endl ;
131 BESIndent::Indent() ;
133 BESIndent::UnIndent() ;
137BESConfigResponseHandler::ConfigResponseBuilder(
const string &name )
response handler that returns the list of keys defined in the BES initialization file.
virtual void execute(BESDataHandlerInterface &dhi)
executes the command 'show keys;' by returning the list of all key/value pairs defined in the BES ini...
virtual void transmit(BESTransmitter *transmitter, BESDataHandlerInterface &dhi)
transmit the response object built by the execute command using the specified transmitter object
virtual void dump(std::ostream &strm) const
dumps information about this object
Structure storing information used by the BES to handle the request.
informational response object
virtual void transmit(BESTransmitter *transmitter, BESDataHandlerInterface &dhi)=0
transmit the informational object
virtual void begin_response(const std::string &response_name, BESDataHandlerInterface &dhi)
begin the informational response
exception thrown if internal error encountered
handler object that knows how to create a specific response object
void dump(std::ostream &strm) const override
dumps information about this object
static TheBESKeys * TheKeys()
Access to the singleton.