35 #include <ConstraintEvaluator.h>
70 string response_string = get_request_type();
72 send_internal(obj, dhi);
74 catch (InternalErr &e) {
75 string err =
"libdap error transmitting " + response_string +
": " + e.get_error_message();
76 throw BESDapError(err,
true, e.get_error_code(), __FILE__, __LINE__);
79 string err =
"libdap error transmitting " + response_string +
": " + e.get_error_message();
80 throw BESDapError(err,
false, e.get_error_code(), __FILE__, __LINE__);
85 catch (
const std::exception &e) {
87 "std::exception caught transmitting " + response_string +
": " + e.what()
88 +
" (caught in BESDapTransmit).");
92 string s =
"unknown error caught transmitting " + response_string +
": ";
99 bool get_print_mime()
const
103 bool print_mime =
false;
104 if (found && protocol ==
"HTTP") {
113 virtual string get_request_type()
const = 0;
119 class SendDAS:
public Sender {
121 virtual string get_request_type()
const
134 bool print_mime = get_print_mime();
144 class SendDDS:
public Sender {
146 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();
199 class SendDDX:
public Sender {
201 virtual string get_request_type()
const
213 ConstraintEvaluator & ce = bdds->
get_ce();
216 bool print_mime = get_print_mime();
225 class SendDMR:
public Sender {
227 virtual string get_request_type()
const
233 BESDMRResponse *bdmr =
dynamic_cast<BESDMRResponse *
>(obj);
238 DMR *dmr = bdmr->get_dmr();
239 ConstraintEvaluator & ce = bdmr->get_ce();
242 bool print_mime = get_print_mime();
253 class SendDap4Data:
public Sender {
255 virtual string get_request_type()
const
264 BESDMRResponse *bdmr =
dynamic_cast<BESDMRResponse *
>(obj);
268 DMR *dmr = bdmr->get_dmr();
269 ConstraintEvaluator & ce = bdmr->get_ce();
272 bool print_mime = get_print_mime();
293 add_method(DMR_SERVICE, BESDapTransmit::send_basic_dmr);
294 add_method(DAP4DATA_SERVICE, BESDapTransmit::send_basic_dap4data);
313 sender.send(obj, dhi);
319 sender.send(obj, dhi);
325 sender.send(obj, dhi);
331 sender.send(obj, dhi);
337 sender.send(obj, dhi);
343 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 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
virtual void send_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.
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.
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...
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.
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.
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 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...
static void send_basic_das(BESResponseObject *obj, BESDataHandlerInterface &dhi)
BESContainer * container
pointer to current container in this interface
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.