38 #include "BESDataHandlerInterface.h" 39 #include "BESResponseObject.h" 40 #include "BESInternalError.h" 41 #include "BESContextManager.h" 43 #include "TheBESKeys.h" 48 #include "BESTransmitter.h" 50 bool BESTransmitter::add_method(
string method_name, p_transmitter trans_method)
52 BESTransmitter::_method_citer i;
53 i = _method_list.find(method_name);
54 if (i == _method_list.end()) {
55 _method_list[method_name] = trans_method;
61 bool BESTransmitter::remove_method(
string method_name)
63 BESTransmitter::_method_iter i;
64 i = _method_list.find(method_name);
65 if (i != _method_list.end()) {
66 _method_list.erase(i);
72 p_transmitter BESTransmitter::find_method(
string method_name)
74 BESTransmitter::_method_citer i;
75 i = _method_list.find(method_name);
76 if (i != _method_list.end()) {
77 p_transmitter p = (*i).second;
85 p_transmitter p = find_method(method_name);
90 throw BESInternalError(
string(
"Unable to transmit response, no transmitter for ") + method_name, __FILE__,
98 string context =
"transmit_protocol";
99 string protocol = BESContextManager::TheManager()->
get_context(context, found);
100 if (protocol ==
"HTTP") {
105 info.
print(dhi.get_output_stream());
111 string context =
"transmit_protocol";
112 string protocol = BESContextManager::TheManager()->
get_context(context, found);
113 if (protocol ==
"HTTP") {
118 info.
print(dhi.get_output_stream());
130 strm << BESIndent::LMarg <<
"BESTransmitter::dump - (" << (
void *)
this <<
")" << endl;
132 if (_method_list.size()) {
133 strm << BESIndent::LMarg <<
"registered methods:" << endl;
135 _method_citer i = _method_list.begin();
136 _method_citer ie = _method_list.end();
137 for (; i != ie; i++) {
138 strm << BESIndent::LMarg << (*i).first <<
": " << (
void *) (*i).second << endl;
140 BESIndent::UnIndent();
143 strm << BESIndent::LMarg <<
"registered methods: none" << endl;
145 BESIndent::UnIndent();
exception thrown if inernal error encountered
virtual void dump(std::ostream &strm) const
dumps information about this object
virtual string get_context(const string &name, bool &found)
retrieve the value of the specified context from the BES
virtual bool is_buffered()
return whether the information is to be buffered or not.
informational response object
static void set_mime_html(ostream &strm)
Generate an HTTP 1.0 response header for a html document.
static void set_mime_text(ostream &strm)
Generate an HTTP 1.0 response header for a text document.
Structure storing information used by the BES to handle the request.
virtual void print(ostream &strm)
print the information from this informational object to the specified stream
Abstract base class representing a specific set of information in response to a request to the BES...