25 #ifndef _response_builder_h
26 #define _response_builder_h
33 class ConstraintEvaluator;
72 virtual std::string
get_ce()
const;
73 virtual void set_ce(std::string _ce);
92 virtual void split_ce(libdap::ConstraintEvaluator &eval,
const std::string &expr =
"");
96 virtual void send_das(std::ostream &out, libdap::DAS &das,
bool with_mime_headers =
true)
const;
97 virtual void send_das(std::ostream &out, libdap::DDS &dds, libdap::ConstraintEvaluator &eval,
bool constrained =
98 false,
bool with_mime_headers =
true);
100 virtual void send_dds(std::ostream &out, libdap::DDS &dds, libdap::ConstraintEvaluator &eval,
bool constrained =
101 false,
bool with_mime_headers =
true);
103 virtual void dataset_constraint(std::ostream &out, libdap::DDS &dds, libdap::ConstraintEvaluator &eval,
104 bool ce_eval =
true);
105 virtual void send_data(std::ostream &data_stream, libdap::DDS &dds, libdap::ConstraintEvaluator &eval,
106 bool with_mime_headers =
true);
108 virtual void send_ddx(std::ostream &out, libdap::DDS &dds, libdap::ConstraintEvaluator &eval,
109 bool with_mime_headers =
true);
111 virtual void dataset_constraint_ddx(std::ostream &out, libdap::DDS & dds, libdap::ConstraintEvaluator & eval,
112 const std::string &boundary,
const std::string &start,
bool ce_eval =
true);
114 virtual void send_dmr(std::ostream &out, libdap::DMR &dmr, libdap::ConstraintEvaluator &eval,
bool constrained =
115 false,
bool with_mime_headers =
true);
117 virtual void send_dap4_data(std::ostream &data_stream, libdap::DMR & dmr, libdap::ConstraintEvaluator & eval,
118 bool with_mime_headers);
122 virtual void send_data_ddx(std::ostream &data_stream, libdap::DDS &dds, libdap::ConstraintEvaluator &eval,
123 const std::string &start,
const std::string &boundary,
bool with_mime_headers =
true);
126 #endif // _response_builder_h
virtual void dataset_constraint(std::ostream &out, libdap::DDS &dds, libdap::ConstraintEvaluator &eval, bool ce_eval=true)
Build/return the BLOB part of the DAP2 data response.
virtual std::string get_ce() const
Return the entire constraint expression in a string.
virtual std::string get_btp_func_ce() const
std::string d_ce
Name of the dataset/database.
std::string d_default_protocol
Response timeout after N seconds.
This class is used to cache DAP2 response objects.
virtual void send_das(std::ostream &out, libdap::DAS &das, bool with_mime_headers=true) const
BESDapResponseBuilder()
Make an empty instance.
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.
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.
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...
std::string d_btp_func_ce
Constraint expression.
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 send_ddx(std::ostream &out, libdap::DDS &dds, libdap::ConstraintEvaluator &eval, bool with_mime_headers=true)
Send the DDX response.
virtual void send_data_ddx(std::ostream &data_stream, libdap::DDS &dds, libdap::ConstraintEvaluator &eval, const std::string &start, const std::string &boundary, bool with_mime_headers=true)
Send the data in the DDS object back to the client program.
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 void dataset_constraint_ddx(std::ostream &out, libdap::DDS &dds, libdap::ConstraintEvaluator &eval, const std::string &boundary, const std::string &start, bool ce_eval=true)
Build/return the DDX and the BLOB part of the DAP3.x data response.
virtual ~BESDapResponseBuilder()
virtual void set_ce(std::string _ce)
Set the constraint expression.
virtual void establish_timeout(std::ostream &stream) const
Use values of this instance to establish a timeout alarm for the server.
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 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.
BESDapResponseCache * d_response_cache
Version std::string for the library's default protocol version.