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);
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.
string get_real_name() const
retrieve the real name for this container, such as a file name.
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.
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