37 using std::stringstream;
39 #include "BESBasicInterface.h" 40 #include "BESInterface.h" 43 #include "BESReturnManager.h" 44 #include "BESSyntaxUserError.h" 45 #include "BESInternalError.h" 46 #include "BESAggFactory.h" 47 #include "BESAggregationServer.h" 48 #include "BESTransmitterNames.h" 49 #include "BESDataNames.h" 62 BESBasicInterface::~BESBasicInterface()
76 return BESInterface::execute_request(from);
100 BESDEBUG(
"bes",
"Finding " << BASIC_TRANSMITTER <<
" transmitter ... " << endl);
102 _transmitter = BESReturnManager::TheManager()->find_transmitter( BASIC_TRANSMITTER);
104 string s = (string)
"Unable to find transmitter " + BASIC_TRANSMITTER;
107 BESDEBUG(
"bes",
"OK" << endl);
125 BESDEBUG(
"bes",
"Entering: " << __PRETTY_FUNCTION__ << endl);
136 if (_dhi->
data[RETURN_CMD] !=
"") {
137 BESDEBUG(
"bes",
"Finding transmitter: " << _dhi->
data[RETURN_CMD] <<
" ... " << endl);
139 _transmitter = BESReturnManager::TheManager()->find_transmitter(_dhi->
data[RETURN_CMD]);
141 string s = (string)
"Unable to find transmitter " + _dhi->
data[RETURN_CMD];
144 BESDEBUG(
"bes",
"OK" << endl);
157 if (BESLog::TheLog()->is_verbose()) {
158 *(BESLog::TheLog()) << _dhi->
data[SERVER_PID] <<
" from " << _dhi->
data[REQUEST_FROM] <<
" [" 159 << _dhi->
data[DATA_REQUEST] <<
"] executing" << endl;
173 if (_dhi->
data[AGG_CMD] ==
"") {
174 if (BESLog::TheLog()->is_verbose()) {
175 *(BESLog::TheLog()) << _dhi->
data[SERVER_PID] <<
" from " << _dhi->
data[REQUEST_FROM] <<
" [" 176 << _dhi->
data[DATA_REQUEST] <<
"]" <<
" not aggregating, command empty" << endl;
182 if (BESLog::TheLog()->is_verbose()) {
183 *(BESLog::TheLog()) << _dhi->
data[SERVER_PID] <<
" from " << _dhi->
data[REQUEST_FROM] <<
" [" 184 << _dhi->
data[DATA_REQUEST] <<
"]" <<
" not aggregating, no handler" << endl;
189 *(BESLog::TheLog()) << _dhi->
data[SERVER_PID] <<
" from " << _dhi->
data[REQUEST_FROM] <<
" [" 190 << _dhi->
data[DATA_REQUEST] <<
"] aggregating" << endl;
206 if (BESLog::TheLog()->is_verbose()) {
207 *(BESLog::TheLog()) << _dhi->
data[SERVER_PID] <<
" from " << _dhi->
data[REQUEST_FROM] <<
" [" 208 << _dhi->
data[DATA_REQUEST] <<
"] transmitting" << endl;
219 string result =
"completed";
221 if (BESLog::TheLog()->is_verbose()) {
222 *(BESLog::TheLog()) << _dhi->
data[SERVER_PID] <<
" from " << _dhi->
data[REQUEST_FROM] <<
" [" 223 << _dhi->
data[DATA_REQUEST] <<
"] " << result << endl;
238 if (BESLog::TheLog()->is_verbose()) {
239 *(BESLog::TheLog()) << _dhi->
data[SERVER_PID] <<
" from " << _dhi->
data[REQUEST_FROM] <<
" [" 240 << _dhi->
data[DATA_REQUEST] <<
"] cleaning" << endl;
252 strm << BESIndent::LMarg <<
"BESBasicInterface::dump - (" << (
void *)
this <<
")" << endl;
255 BESIndent::UnIndent();
virtual void dump(ostream &strm) const
dumps information about this object
exception thrown if inernal error encountered
virtual void initialize()
Initialize the BES object.
bool is_verbose()
Returns true if verbose logging is requested.
virtual void transmit_data()
Transmit the resulting response object.
virtual void transmit_data()
Transmit the response object.
virtual void build_data_request_plan()
Build the data request plan using the BESCmdParser.
error thrown if there is a user syntax error in the request or any other user error ...
BESBasicInterface(ostream *strm)
Instantiate a BESBasicInterface object given an output stream for the response object.
virtual void log_status()
Log the status of the request to the BESLog file.
Entry point into BES, building responses to given requests.
virtual void invoke_aggregation()
Invoke the aggregation server, if there is one.
virtual void validate_data_request()
Validate the incoming request information.
virtual void clean()
Clean up after the request.
virtual void invoke_aggregation()
Aggregate the resulting response object.
map< string, string > data
the map of string data that will be required for the current request.
virtual BESAggregationServer * find_handler(const string &handler_name)
returns the aggregation handler with the given name in the list
virtual void validate_data_request()
Validate the incoming request information.
BESInfo * error_info
error information object
virtual void execute_data_request_plan()
Execute the data request plan.
Abstraction representing mechanism for aggregating data.
virtual void execute_data_request_plan()
Execute the data request plan.
virtual void initialize()
Initialize the BES.
virtual void clean()
Clean up after the request is completed.
virtual int execute_request(const string &from)
Override execute_request in order to register memory pool.
virtual void dump(ostream &strm) const
dumps information about this object