38 #include "BESDataHandlerInterface.h"
39 #include "BESResponseObject.h"
40 #include "BESInternalError.h"
41 #include "BESContextManager.h"
43 #include "TheBESKeys.h"
48 #include "BESTransmitter.h"
54 bool BESTransmitter::add_method(
string method_name, p_transmitter trans_method)
56 BESTransmitter::_method_citer i;
57 i = _method_list.find(method_name);
58 if (i == _method_list.end()) {
59 _method_list[method_name] = trans_method;
65 bool BESTransmitter::remove_method(
string method_name)
67 BESTransmitter::_method_iter i;
68 i = _method_list.find(method_name);
69 if (i != _method_list.end()) {
70 _method_list.erase(i);
76 p_transmitter BESTransmitter::find_method(
string method_name)
78 BESTransmitter::_method_citer i;
79 i = _method_list.find(method_name);
80 if (i != _method_list.end()) {
81 p_transmitter p = (*i).second;
89 p_transmitter p = find_method(method_name);
94 throw BESInternalError(
string(
"Unable to transmit response, no transmitter for ") + method_name, __FILE__,
102 string context =
"transmit_protocol";
103 string protocol = BESContextManager::TheManager()->
get_context(context, found);
104 if (protocol ==
"HTTP") {
109 info.
print(dhi.get_output_stream());
115 string context =
"transmit_protocol";
116 string protocol = BESContextManager::TheManager()->
get_context(context, found);
117 if (protocol ==
"HTTP") {
122 info.
print(dhi.get_output_stream());
134 strm << BESIndent::LMarg <<
"BESTransmitter::dump - (" << (
void *)
this <<
")" << endl;
136 if (_method_list.size()) {
137 strm << BESIndent::LMarg <<
"registered methods:" << endl;
139 _method_citer i = _method_list.begin();
140 _method_citer ie = _method_list.end();
141 for (; i != ie; i++) {
142 strm << BESIndent::LMarg << (*i).first <<
": " << (
void *) (*i).second << endl;
144 BESIndent::UnIndent();
147 strm << BESIndent::LMarg <<
"registered methods: none" << endl;
149 BESIndent::UnIndent();