25 #ifndef _response_builder_h
26 #define _response_builder_h
33 class ConstraintEvaluator;
76 bool store_dap2_result(ostream &out, libdap::DDS &dds, libdap::ConstraintEvaluator &eval);
92 virtual std::string
get_ce()
const;
93 virtual void set_ce(std::string _ce);
125 virtual void split_ce(libdap::ConstraintEvaluator &eval,
const std::string &expr =
"");
129 virtual void send_das(std::ostream &out, libdap::DAS &das,
bool with_mime_headers =
true)
const;
130 virtual void send_das(std::ostream &out, libdap::DDS &dds, libdap::ConstraintEvaluator &eval,
bool constrained =
131 false,
bool with_mime_headers =
true);
133 virtual void send_dds(std::ostream &out, libdap::DDS &dds, libdap::ConstraintEvaluator &eval,
bool constrained =
134 false,
bool with_mime_headers =
true);
137 bool ce_eval =
true);
138 virtual void send_dap2_data(std::ostream &data_stream, libdap::DDS &dds, libdap::ConstraintEvaluator &eval,
139 bool with_mime_headers =
true);
141 virtual void send_ddx(std::ostream &out, libdap::DDS &dds, libdap::ConstraintEvaluator &eval,
142 bool with_mime_headers =
true);
145 const std::string &boundary,
const std::string &start,
bool ce_eval =
true);
147 virtual void send_dmr(std::ostream &out, libdap::DMR &dmr,
bool with_mime_headers =
true);
149 virtual void send_dap4_data(std::ostream &out, libdap::DMR & dmr,
bool with_mime_headers =
true);
151 virtual void serialize_dap4_data(std::ostream &out, libdap::DMR &dmr,
bool with_mime_headers =
true);
155 #endif // _response_builder_h
virtual void send_dmr(std::ostream &out, libdap::DMR &dmr, bool with_mime_headers=true)
virtual std::string get_ce() const
Return the entire DAP2 constraint expression in a string.
virtual std::string get_btp_func_ce() const
virtual std::string get_dap4ce() const
Return the entire DAP4 constraint expression in a string.
std::string d_dap4function
DAP4 Constraint expression.
virtual void serialize_dap2_data_dds(std::ostream &out, libdap::DDS &dds, libdap::ConstraintEvaluator &eval, bool ce_eval=true)
Build/return the BLOB part of the DAP2 data response.
std::string d_async_accepted
Version std::string for the library's default protocol version.
std::string d_default_protocol
Response timeout after N seconds.
This class is used to cache DAP2 response objects.
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
BESDapResponseBuilder()
Make an empty instance.
virtual std::string get_dap4function() const
Return the entire DAP4 server side function expression in a string.
static class NCMLUtil overview
virtual void set_btp_func_ce(std::string _ce)
virtual BESDapResponseCache * responseCache()
Lazy getter for the ResponseCache.
void initialize()
Called when initializing a ResponseBuilder that's not going to be passed command line arguments...
int d_timeout
The BTP functions, extracted from the CE.
std::string d_dap4ce
DAP2 Constraint expression.
virtual void split_ce(libdap::ConstraintEvaluator &eval, const std::string &expr="")
Split the CE so that the server functions that compute new values are separated into their own string...
virtual std::string get_store_result() const
virtual void remove_timeout() const
std::string d_btp_func_ce
DAP4 Server Side Function expression.
virtual void set_async_accepted(std::string _aa)
void set_timeout(int timeout=0)
Set the server's timeout value.
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.
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)
virtual void serialize_dap2_data_ddx(std::ostream &out, libdap::DDS &dds, libdap::ConstraintEvaluator &eval, const std::string &boundary, const std::string &start, bool ce_eval=true)
Serialize a DAP3.2 DataDDX to the stream "out".
This class is used to build responses for/by the BES.
int get_timeout() const
Get the server's timeout value.
friend class ResponseBuilderTest
virtual std::string get_async_accepted() const
virtual ~BESDapResponseBuilder()
virtual void set_ce(std::string _ce)
Set the DAP2 constraint expression.
bool store_dap2_result(ostream &out, libdap::DDS &dds, libdap::ConstraintEvaluator &eval)
Should this result be returned using the asynchronous response mechanism? Look at the 'store_result' ...
std::string d_dap2ce
Name of the dataset/database.
virtual void establish_timeout(std::ostream &stream) const
Use values of this instance to establish a timeout alarm for the server.
virtual bool store_dap4_result(ostream &out, libdap::DMR &dmr)
Should this DAP4 result be stored and the client sent an Asynchronous response? This code looks at th...
virtual std::string get_dataset_name() const
The ``dataset name'' is the filename or other string that the filter program will use to access the d...
virtual void set_dap4ce(std::string _ce)
Set the DAP4 constraint expression.
virtual void set_store_result(std::string _sr)
virtual void serialize_dap4_data(std::ostream &out, libdap::DMR &dmr, bool with_mime_headers=true)
Serialize the DAP4 data response to the passed stream.
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.
void send_dap4_data_using_ce(std::ostream &out, libdap::DMR &dmr, bool with_mime_headersr)
std::string d_store_result
If set (i.e.
BESDapResponseCache * d_response_cache