35 #include <ConstraintEvaluator.h>
73 string response_string = get_request_type();
75 send_internal(obj, dhi);
77 catch (InternalErr &e) {
78 string err =
"libdap error transmitting " + response_string +
": " + e.get_error_message();
79 throw BESDapError(err,
true, e.get_error_code(), __FILE__, __LINE__);
82 string err =
"libdap error transmitting " + response_string +
": " + e.get_error_message();
83 throw BESDapError(err,
false, e.get_error_code(), __FILE__, __LINE__);
88 catch (
const std::exception &e) {
89 string msg =
"std::exception caught transmitting " + response_string +
": " + e.what() +
" (caught in BESDapTransmit).";
93 string s =
"unknown error caught transmitting " + response_string +
": ";
100 bool get_print_mime()
const
104 bool print_mime =
false;
105 if (found && protocol ==
"HTTP") {
114 virtual string get_request_type()
const = 0;
120 class SendDAS:
public Sender {
122 virtual string get_request_type()
const
135 bool print_mime = get_print_mime();
145 class SendDDS:
public Sender {
147 virtual string get_request_type()
const
159 ConstraintEvaluator & ce = bdds->
get_ce();
162 bool print_mime = get_print_mime();
172 class SendDataDDS:
public Sender {
174 virtual string get_request_type()
const
185 DataDDS *dds = bdds->
get_dds();
186 ConstraintEvaluator & ce = bdds->
get_ce();
189 bool print_mime = get_print_mime();
203 class SendDDX:
public Sender {
205 virtual string get_request_type()
const
217 ConstraintEvaluator & ce = bdds->
get_ce();
220 bool print_mime = get_print_mime();
229 class SendDMR:
public Sender {
231 virtual string get_request_type()
const
238 BESDEBUG(
"dap",
"Entering SendDMR::send_internal ..." << endl);
261 class SendDap4Data:
public Sender {
263 virtual string get_request_type()
const
322 sender.send(obj, dhi);
328 sender.send(obj, dhi);
334 sender.send(obj, dhi);
340 sender.send(obj, dhi);
346 sender.send(obj, dhi);
352 sender.send(obj, dhi);
virtual void send_dmr(std::ostream &out, libdap::DMR &dmr, bool with_mime_headers=true)
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)
static void send_basic_dmr(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 void send_dap2_data(std::ostream &data_stream, libdap::DDS &dds, libdap::ConstraintEvaluator &eval, bool with_mime_headers=true)
Send the data in the DDS object back to the client program.
virtual void send_das(std::ostream &out, libdap::DAS &das, bool with_mime_headers=true) const
virtual string get_context(const string &name, bool &found)
retrieve the value of the specified context from the BES
Abstract exception class for the BES with basic string message.
Represents an OPeNDAP DMR DAP4 data object within the BES.
error object created from libdap error objects and can handle those errors
Represents an OPeNDAP DataDDS DAP2 data object within the BES.
virtual void set_async_accepted(std::string _aa)
string get_real_name() const
retrieve the real name for this container, such as a file name.
virtual void set_dataset_name(const std::string _dataset)
Set the dataset name, which is a string used to access the dataset on the machine running the server...
virtual void set_dap4function(std::string _func)
Set the DAP4 Server Side Fucntion expression.
static BESContextManager * TheManager()
virtual void send_ddx(std::ostream &out, libdap::DDS &dds, libdap::ConstraintEvaluator &eval, bool with_mime_headers=true)
Send the DDX response.
virtual void send_dap4_data(std::ostream &out, libdap::DMR &dmr, bool with_mime_headers=true)
ConstraintEvaluator & get_ce()
Structure storing information used by the BES to handle the request.
static void send_basic_dap4data(BESResponseObject *obj, BESDataHandlerInterface &dhi)
map< string, string > data
the map of string data that will be required for the current request.
virtual ~BESDapTransmit()
This class is used to build responses for/by the BES.
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
virtual void set_ce(std::string _ce)
Set the DAP2 constraint expression.
virtual bool remove_method(string method_name)
Abstract base class representing a specific set of information in response to a request to the BES...
virtual void set_dap4ce(std::string _ce)
Set the DAP4 constraint expression.
static void send_basic_das(BESResponseObject *obj, BESDataHandlerInterface &dhi)
BESContainer * container
pointer to current container in this interface
virtual void set_store_result(std::string _sr)
virtual void send_dds(std::ostream &out, libdap::DDS &dds, libdap::ConstraintEvaluator &eval, bool constrained=false, bool with_mime_headers=true)
This function formats and prints an ASCII representation of a DDS on stdout.