35 using std::ostringstream;
38 #include "DODSFilter.h" 43 #include "mime_util.h" 67 string response_string = get_request_type();
70 send_internal(obj, dhi);
72 catch( InternalErr &e )
74 string err =
"libdap error transmitting " +
75 response_string +
": " +
76 e.get_error_message() ;
77 throw BESDapError( err,
true, e.get_error_code(), __FILE__, __LINE__ ) ;
81 string err =
"libdap error transmitting " +
82 response_string +
": " +
83 e.get_error_message() ;
84 throw BESDapError( err,
false, e.get_error_code(), __FILE__, __LINE__ );
90 catch(
const std::exception &e )
92 string msg(
"std::exception caught transmitting " +
93 response_string +
": " +
99 string s =
"unknown error caught transmitting " +
100 response_string +
": ";
107 bool get_print_mime()
const 110 string context =
"transmit_protocol" ;
113 bool print_mime = false ;
114 if( protocol ==
"HTTP" ) {
123 virtual string get_request_type()
const = 0;
126 virtual void send_internal(
131 class SendDAS :
public Sender
134 virtual string get_request_type()
const {
return "DAS"; }
135 virtual void send_internal(
145 bool print_mime = get_print_mime();
153 class SendDDS :
public Sender
156 virtual string get_request_type()
const {
return "DDS"; }
157 virtual void send_internal(
166 ConstraintEvaluator & ce = bdds->
get_ce();
168 bool print_mime = get_print_mime();
177 class SendDataDDS :
public Sender
180 virtual string get_request_type()
const {
return "DataDDS"; }
181 virtual void send_internal(
189 DataDDS *dds = bdds->
get_dds();
190 ConstraintEvaluator & ce = bdds->
get_ce();
192 bool print_mime = get_print_mime();
195 df.set_dataset_name(dds->filename());
201 class SendDDX :
public Sender
204 virtual string get_request_type()
const {
return "DDX"; }
205 virtual void send_internal(
214 ConstraintEvaluator & ce = bdds->
get_ce();
216 bool print_mime = get_print_mime();
225 class SendDataDDX :
public Sender
228 virtual string get_request_type()
const {
return "DataDDX"; }
229 virtual void send_internal(
237 DataDDS *dds = bdds->
get_dds();
238 ConstraintEvaluator & ce = bdds->
get_ce();
240 bool print_mime = get_print_mime();
243 df.set_dataset_name(dds->filename());
270 sender.send(obj, dhi);
278 sender.send(obj, dhi);
286 sender.send(obj, dhi);
294 sender.send(obj, dhi);
302 sender.send(obj, dhi);
exception thrown if an internal error is found and is fatal to the BES
static void send_basic_data(BESResponseObject *obj, BESDataHandlerInterface &dhi)
exception thrown if inernal error encountered
static void send_basic_dds(BESResponseObject *obj, BESDataHandlerInterface &dhi)
ConstraintEvaluator & get_ce()
ostream & get_output_stream()
Represents an OPeNDAP DDS DAP2 data object within the BES.
static void send_basic_ddx(BESResponseObject *obj, BESDataHandlerInterface &dhi)
virtual bool add_method(string method_name, p_transmitter trans_method)
virtual string get_context(const string &name, bool &found)
retrieve the value of the specified context from the BES
static void send_basic_dataddx(BESResponseObject *obj, BESDataHandlerInterface &dhi)
Abstract exception class for the BES with basic string message.
error object created from libdap error objects and can handle those errors
Represents an OPeNDAP DataDDS DAP2 data object within the BES.
static BESContextManager * TheManager()
ConstraintEvaluator & get_ce()
Structure storing information used by the BES to handle the request.
map< string, string > data
the map of string data that will be required for the current request.
string get_real_name() const
retreive the real name for this container, such as a file name.
Represents an OPeNDAP DAS DAP2 data object within the BES.
void first_container()
set the container pointer to the first container in the containers list
#define BESDEBUG(x, y)
macro used to send debug information to the debug stream
Abstract base class representing a specific set of information in response to a request to the BES...
static void send_basic_das(BESResponseObject *obj, BESDataHandlerInterface &dhi)
BESContainer * container
pointer to current container in this interface