35 using std::ostringstream;
42 #include "DODSFilter.h"
44 #include "ResponseBuilder.h"
50 #include "mime_util.h"
75 string response_string = get_request_type();
78 send_internal(obj, dhi);
80 catch( InternalErr &e )
82 string err =
"libdap error transmitting " +
83 response_string +
": " +
84 e.get_error_message() ;
85 throw BESDapError( err,
true, e.get_error_code(), __FILE__, __LINE__ ) ;
89 string err =
"libdap error transmitting " +
90 response_string +
": " +
91 e.get_error_message() ;
92 throw BESDapError( err,
false, e.get_error_code(), __FILE__, __LINE__ );
98 catch(
const std::exception &e )
100 string msg(
"std::exception caught transmitting " +
101 response_string +
": " +
107 string s =
"unknown error caught transmitting " +
108 response_string +
": ";
115 bool get_print_mime()
const
118 string context =
"transmit_protocol" ;
121 bool print_mime = false ;
122 if( protocol ==
"HTTP" ) {
131 virtual string get_request_type()
const = 0;
134 virtual void send_internal(
139 class SendDAS :
public Sender
142 virtual string get_request_type()
const {
return "DAS"; }
143 virtual void send_internal(
153 bool print_mime = get_print_mime();
154 #ifdef USE_DODSFILTER
166 class SendDDS :
public Sender
169 virtual string get_request_type()
const {
return "DDS"; }
170 virtual void send_internal(
179 ConstraintEvaluator & ce = bdds->
get_ce();
181 bool print_mime = get_print_mime();
183 #ifdef USE_DODSFILTER
197 class SendDataDDS :
public Sender
200 virtual string get_request_type()
const {
return "DataDDS"; }
201 virtual void send_internal(
209 DataDDS *dds = bdds->
get_dds();
210 ConstraintEvaluator & ce = bdds->
get_ce();
212 bool print_mime = get_print_mime();
214 #ifdef USE_DODSFILTER
216 df.set_dataset_name(dds->filename());
221 rb.set_dataset_name(dds->filename());
228 class SendDDX :
public Sender
231 virtual string get_request_type()
const {
return "DDX"; }
232 virtual void send_internal(
241 ConstraintEvaluator & ce = bdds->
get_ce();
243 bool print_mime = get_print_mime();
245 #ifdef USE_DODSFILTER
259 class SendDataDDX :
public Sender
262 virtual string get_request_type()
const {
return "DataDDX"; }
263 virtual void send_internal(
271 DataDDS *dds = bdds->
get_dds();
272 ConstraintEvaluator & ce = bdds->
get_ce();
274 bool print_mime = get_print_mime();
276 #ifdef USE_DODSFILTER
278 df.set_dataset_name(dds->filename());
286 rb.set_dataset_name(dds->filename());
313 sender.send(obj, dhi);
321 sender.send(obj, dhi);
329 sender.send(obj, dhi);
337 sender.send(obj, dhi);
345 sender.send(obj, dhi);