31 #ifdef HAVE_UUID_UUID_H 32 #include <uuid/uuid.h> 33 #elif defined(HAVE_UUID_H) 36 #error "Could not find UUID library header" 57 #define CLEAR_LOCAL_DATA 58 #undef FUNCTION_CACHING 59 #undef USE_LOCAL_TIMEOUT_SCHEME 63 #include <Structure.h> 64 #include <ConstraintEvaluator.h> 65 #include <DDXParserSAX2.h> 66 #include <Ancillary.h> 67 #include <XDRStreamMarshaller.h> 68 #include <XDRFileUnMarshaller.h> 72 #include <XMLWriter.h> 73 #include <D4AsyncUtil.h> 74 #include <D4StreamMarshaller.h> 75 #include <chunked_ostream.h> 76 #include <chunked_istream.h> 77 #include <D4ConstraintEvaluator.h> 78 #include <D4FunctionEvaluator.h> 79 #include <D4BaseTypeFactory.h> 81 #include <ServerFunctionsList.h> 83 #include <mime_util.h> 86 #if USE_LOCAL_TIMEOUT_SCHEME 88 #include <SignalHandler.h> 89 #include <EventHandler.h> 90 #include <AlarmHandler.h> 94 #include "TheBESKeys.h" 95 #include "BESDapResponseBuilder.h" 96 #include "BESContextManager.h" 97 #include "BESDapResponseCache.h" 98 #include "BESStoredDapResultCache.h" 100 #include "BESDebug.h" 101 #include "BESStopWatch.h" 106 const string CRLF =
"\r\n";
107 const string BES_KEY_TIMEOUT_CANCEL =
"BES.CancelTimeoutOnSend";
116 string cancel_timeout_on_send =
"";
118 if (found && !cancel_timeout_on_send.empty()) {
120 downcase(cancel_timeout_on_send);
121 if (cancel_timeout_on_send ==
"yes" || cancel_timeout_on_send ==
"true")
122 d_cancel_timeout_on_send =
true;
126 BESDapResponseBuilder::~BESDapResponseBuilder()
128 #if USE_LOCAL_TIMEOUT_SCHEME 132 delete dynamic_cast<AlarmHandler*
>(SignalHandler::instance()->remove_handler(SIGALRM));
159 d_dap2ce = www2id(_ce,
"%",
"%20");
182 d_dap4ce = www2id(_ce,
"%",
"%20");
190 return d_dap4function;
206 d_dap4function = www2id(_func,
"%",
"%20");
209 std::string BESDapResponseBuilder::get_store_result()
const 211 return d_store_result;
214 void BESDapResponseBuilder::set_store_result(std::string _sr)
216 d_store_result = _sr;
217 BESDEBUG(
"dap",
"BESDapResponseBuilder::set_store_result() - store_result: " << _sr << endl);
220 std::string BESDapResponseBuilder::get_async_accepted()
const 222 return d_async_accepted;
225 void BESDapResponseBuilder::set_async_accepted(std::string _aa)
227 d_async_accepted = _aa;
228 BESDEBUG(
"dap",
"BESDapResponseBuilder::set_async_accepted() - async_accepted: " << _aa << endl);
256 d_dataset = www2id(ds,
"%",
"%20");
284 #if USE_LOCAL_TIMEOUT_SCHEME 299 #if USE_LOCAL_TIMEOUT_SCHEME 322 if (d_cancel_timeout_on_send)
336 #if USE_LOCAL_TIMEOUT_SCHEME 338 SignalHandler *sh = SignalHandler::instance();
339 EventHandler *old_eh = sh->register_handler(SIGALRM,
new AlarmHandler());
353 #if USE_LOCAL_TIMEOUT_SCHEME 356 SignalHandler *sh = SignalHandler::instance();
357 EventHandler *old_eh = sh->register_handler(SIGALRM,
new AlarmHandler());
370 #if USE_LOCAL_TIMEOUT_SCHEME 375 static string::size_type find_closing_paren(
const string &ce, string::size_type pos)
382 pos = ce.find_first_of(
"()", pos + 1);
383 if (pos == string::npos)
384 throw Error(malformed_expr,
"Expected to find a matching closing parenthesis in " + ce);
404 BESDEBUG(
"dap",
"BESDapResponseBuilder::split_ce() - source expression: " << expr << endl);
412 BESDEBUG(
"dap",
"BESDapResponseBuilder::split_ce() - ce: " << ce << endl);
414 string btp_function_ce =
"";
415 string::size_type pos = 0;
419 string::size_type first_paren = ce.find(
"(", pos);
420 string::size_type closing_paren = string::npos;
421 if (first_paren != string::npos) closing_paren = find_closing_paren(ce, first_paren);
423 while (first_paren != string::npos && closing_paren != string::npos) {
425 string name = ce.substr(pos, first_paren - pos);
429 if (eval.find_function(name, &f)) {
431 if (!btp_function_ce.empty()) btp_function_ce +=
",";
432 btp_function_ce += ce.substr(pos, closing_paren + 1 - pos);
433 ce.erase(pos, closing_paren + 1 - pos);
434 if (ce[pos] ==
',') ce.erase(pos, 1);
437 pos = closing_paren + 1;
439 if (pos < ce.length() && ce.at(pos) ==
',') ++pos;
442 first_paren = ce.find(
"(", pos);
443 closing_paren = ce.find(
")", pos);
447 d_btp_func_ce = btp_function_ce;
449 BESDEBUG(
"dap",
"BESDapResponseBuilder::split_ce() - Modified constraint: " << d_dap2ce << endl);
450 BESDEBUG(
"dap",
"BESDapResponseBuilder::split_ce() - BTP Function part: " << btp_function_ce << endl);
451 BESDEBUG(
"dap",
"BESDapResponseBuilder::split_ce() - END" << endl);
468 void BESDapResponseBuilder::send_das(ostream &out, DAS &das,
bool with_mime_headers)
const 470 if (with_mime_headers) set_mime_text(out, dods_das, x_plain, last_modified_time(d_dataset),
"2.0");
494 void BESDapResponseBuilder::send_das(ostream &out, DDS &dds, ConstraintEvaluator &eval,
bool constrained,
495 bool with_mime_headers)
497 #if USE_LOCAL_TIMEOUT_SCHEME 499 establish_timeout(out);
500 dds.set_timeout(d_timeout);
503 if (with_mime_headers) set_mime_text(out, dods_das, x_plain, last_modified_time(d_dataset),
"2.0");
505 conditional_timeout_cancel();
518 if (!d_btp_func_ce.empty()) {
520 string cache_token =
"";
521 ConstraintEvaluator func_eval;
525 fdds = responseCache->cache_dataset(dds, d_btp_func_ce,
this, &func_eval, cache_token);
528 func_eval.parse_constraint(d_btp_func_ce, dds);
529 fdds = func_eval.eval_function_clauses(dds);
532 if (with_mime_headers)
533 set_mime_text(out, dods_das, x_plain, last_modified_time(d_dataset), dds.get_dap_version());
535 conditional_timeout_cancel();
538 fdds->print_das(out);
546 eval.parse_constraint(d_dap2ce, dds);
548 if (with_mime_headers)
549 set_mime_text(out, dods_das, x_plain, last_modified_time(d_dataset), dds.get_dap_version());
551 conditional_timeout_cancel();
564 static bool ends_with (
const string &full_string,
const string &ending) {
565 if (full_string.length() >= ending.length()) {
566 return (0 == full_string.compare (full_string.length() - ending.length(), ending.length(), ending));
600 static DDS *promote_function_output_structure(DDS *fdds)
604 bool found_promotable_member =
false;
605 for (DDS::Vars_citer di = fdds->var_begin(), de = fdds->var_end(); di != de && !found_promotable_member; ++di) {
606 Structure *collection =
dynamic_cast<Structure *
>(*di);
607 if (collection && ends_with(collection->name(),
"_unwrap")) {
608 found_promotable_member =
true;
613 if (found_promotable_member) {
622 DDS *temp_dds =
new DDS(fdds->get_factory(), fdds->get_dataset_name(), fdds->get_dap_version());
624 for (DDS::Vars_citer di = fdds->var_begin(), de = fdds->var_end(); di != de; ++di) {
625 Structure *collection =
dynamic_cast<Structure *
>(*di);
626 if (collection && ends_with(collection->name(),
"_unwrap")) {
628 Structure::Vars_iter vi;
629 for (vi =collection->var_begin(); vi != collection->var_end(); ++vi) {
630 temp_dds->add_var(*vi);
634 temp_dds->add_var(*di);
666 bool with_mime_headers)
669 if (with_mime_headers)
670 set_mime_text(out, dods_dds, x_plain, last_modified_time(d_dataset), dds.get_dap_version());
672 conditional_timeout_cancel();
680 #if USE_LOCAL_TIMEOUT_SCHEME 682 establish_timeout(out);
683 dds.set_timeout(d_timeout);
692 if (!d_btp_func_ce.empty()) {
693 string cache_token =
"";
695 ConstraintEvaluator func_eval;
700 fdds = responseCache->cache_dataset(dds, d_btp_func_ce,
this, &func_eval, cache_token);
703 func_eval.parse_constraint(d_btp_func_ce, dds);
704 fdds = func_eval.eval_function_clauses(dds);
712 fdds->mark_all(
false);
714 eval.parse_constraint(d_dap2ce, *fdds);
716 if (with_mime_headers)
717 set_mime_text(out, dods_dds, x_plain, last_modified_time(d_dataset), dds.get_dap_version());
719 fdds = promote_function_output_structure(fdds);
721 conditional_timeout_cancel();
724 fdds->print_constrained(out);
732 eval.parse_constraint(d_dap2ce, dds);
734 if (with_mime_headers)
735 set_mime_text(out, dods_dds, x_plain, last_modified_time(d_dataset), dds.get_dap_version());
737 conditional_timeout_cancel();
740 dds.print_constrained(out);
762 if (get_store_result().empty())
return false;
764 string serviceUrl = get_store_result();
775 string *stylesheet_ref = 0, ss_ref_value;
777 if (found && ss_ref_value.length() > 0) {
778 stylesheet_ref = &ss_ref_value;
782 if (resultCache == NULL) {
789 string msg =
"The Stored Result request cannot be serviced. ";
790 msg +=
"Unable to acquire StoredResultCache instance. ";
791 msg +=
"This is most likely because the StoredResultCache is not (correctly) configured.";
793 BESDEBUG(
"dap",
"[WARNING] " << msg << endl);
795 d4au.writeD4AsyncResponseRejected(xmlWrtr, UNAVAILABLE, msg, stylesheet_ref);
796 out << xmlWrtr.get_doc();
799 BESDEBUG(
"dap",
"BESDapResponseBuilder::store_dap2_result() - Sent AsyncRequestRejected" << endl);
801 else if (get_async_accepted().length() != 0) {
806 BESDEBUG(
"dap",
"BESDapResponseBuilder::store_dap2_result() - serviceUrl="<< serviceUrl << endl);
809 string storedResultId =
"";
813 "BESDapResponseBuilder::store_dap2_result() - storedResultId='"<< storedResultId <<
"'" << endl);
816 BESDEBUG(
"dap",
"BESDapResponseBuilder::store_dap2_result() - targetURL='"<< targetURL <<
"'" << endl);
819 d4au.writeD4AsyncAccepted(xmlWrtr, 0, 0, targetURL, stylesheet_ref);
820 out << xmlWrtr.get_doc();
823 BESDEBUG(
"dap",
"BESDapResponseBuilder::store_dap2_result() - sent DAP4 AsyncAccepted response" << endl);
830 d4au.writeD4AsyncRequired(xmlWrtr, 0, 0, stylesheet_ref);
831 out << xmlWrtr.get_doc();
834 BESDEBUG(
"dap",
"BESDapResponseBuilder::store_dap2_result() - sent DAP4 AsyncRequired response" << endl);
847 if (BESISDEBUG(TIMING_LOG)) sw.
start(
"BESDapResponseBuilder::serialize_dap2_data_dds",
"");
849 BESDEBUG(
"dap",
"BESDapResponseBuilder::serialize_dap2_data_dds() - BEGIN" << endl);
851 dds.print_constrained(out);
855 XDRStreamMarshaller m(out);
859 conditional_timeout_cancel();
863 for (DDS::Vars_iter i = dds.var_begin(); i != dds.var_end(); i++) {
864 if ((*i)->send_p()) {
865 (*i)->serialize(eval, dds, m, ce_eval);
866 #ifdef CLEAR_LOCAL_DATA 867 (*i)->clear_local_data();
872 BESDEBUG(
"dap",
"BESDapResponseBuilder::serialize_dap2_data_dds() - END" << endl);
884 const string &boundary,
const string &start,
bool ce_eval)
886 BESDEBUG(
"dap", __PRETTY_FUNCTION__ <<
" BEGIN" << endl);
889 libdap::set_mime_ddx_boundary(out, boundary, start, dods_ddx, x_plain);
895 uuid_unparse(uu, &uuid[0]);
897 if (getdomainname(domain, 255) != 0 || strlen(domain) == 0) strncpy(domain,
"opendap.org", 255);
899 string cid = string(&uuid[0]) +
"@" + string(&domain[0]);
903 dds.print_xml_writer(out,
true, cid);
906 set_mime_data_boundary(out, boundary, cid, dods_data_ddx , x_plain);
908 XDRStreamMarshaller m(out);
910 conditional_timeout_cancel();
914 for (DDS::Vars_iter i = dds.var_begin(); i != dds.var_end(); i++) {
915 if ((*i)->send_p()) {
916 (*i)->serialize(eval, dds, m, ce_eval);
917 #ifdef CLEAR_LOCAL_DATA 918 (*i)->clear_local_data();
923 BESDEBUG(
"dap", __PRETTY_FUNCTION__ <<
" END" << endl);
943 bool with_mime_headers)
945 BESDEBUG(
"dap",
"BESDapResponseBuilder::send_dap2_data() - BEGIN"<< endl);
947 #if USE_LOCAL_TIMEOUT_SCHEME 949 establish_timeout(data_stream);
950 dds.set_timeout(d_timeout);
959 if (!get_btp_func_ce().empty()) {
961 "BESDapResponseBuilder::send_dap2_data() - Found function(s) in CE: " << get_btp_func_ce() << endl);
963 string cache_token =
"";
968 ConstraintEvaluator func_eval;
977 "BESDapResponseBuilder::send_dap2_data() - Using the cache for the server function CE" << endl);
978 fdds = responseCache->cache_dataset(dds, get_btp_func_ce(),
this, &func_eval, cache_token);
981 BESDEBUG(
"dap",
"BESDapResponseBuilder::send_dap2_data() - Cache not found; (re)calculating" << endl);
982 func_eval.parse_constraint(get_btp_func_ce(), dds);
983 fdds = func_eval.eval_function_clauses(dds);
991 fdds->mark_all(
false);
993 fdds = promote_function_output_structure(fdds);
995 eval.parse_constraint(get_ce(), *fdds);
997 fdds->tag_nested_sequences();
999 if (fdds->get_response_limit() != 0 && fdds->get_request_size(
true) > fdds->get_response_limit()) {
1000 string msg =
"The Request for " + long_to_string(dds.get_request_size(
true) / 1024)
1001 +
"KB is too large; requests for this user are limited to " 1002 + long_to_string(dds.get_response_limit() / 1024) +
"KB.";
1006 if (with_mime_headers)
1007 set_mime_binary(data_stream, dods_data, x_plain, last_modified_time(d_dataset), dds.get_dap_version());
1009 #if FUNCTION_CACHING 1011 if (!store_dap2_result(data_stream, dds, eval)) {
1012 serialize_dap2_data_dds(data_stream, *fdds, eval,
true );
1018 serialize_dap2_data_dds(data_stream, *fdds, eval,
true );
1024 BESDEBUG(
"dap",
"BESDapResponseBuilder::send_dap2_data() - Simple constraint" << endl);
1026 eval.parse_constraint(get_ce(), dds);
1028 dds.tag_nested_sequences();
1030 if (dds.get_response_limit() != 0 && dds.get_request_size(
true) > dds.get_response_limit()) {
1031 string msg =
"The Request for " + long_to_string(dds.get_request_size(
true) / 1024)
1032 +
"KB is too large; requests for this user are limited to " 1033 + long_to_string(dds.get_response_limit() / 1024) +
"KB.";
1037 if (with_mime_headers)
1038 set_mime_binary(data_stream, dods_data, x_plain, last_modified_time(d_dataset), dds.get_dap_version());
1041 if (!store_dap2_result(data_stream, dds, eval)) {
1042 serialize_dap2_data_dds(data_stream, dds, eval);
1046 data_stream << flush;
1048 BESDEBUG(
"dap",
"BESDapResponseBuilder::send_dap2_data() - END"<< endl);
1068 if (d_dap2ce.empty()) {
1069 if (with_mime_headers)
1070 set_mime_text(out, dods_ddx, x_plain, last_modified_time(d_dataset), dds.get_dap_version());
1072 dds.print_xml_writer(out,
false ,
"");
1078 #if USE_LOCAL_TIMEOUT_SCHEME 1080 establish_timeout(out);
1081 dds.set_timeout(d_timeout);
1090 if (!d_btp_func_ce.empty()) {
1091 string cache_token =
"";
1093 ConstraintEvaluator func_eval;
1096 #if FUNCTION_CACHING 1100 if (responseCache) {
1101 fdds = responseCache->cache_dataset(dds, d_btp_func_ce,
this, &func_eval, cache_token);
1104 func_eval.parse_constraint(d_btp_func_ce, dds);
1105 fdds = func_eval.eval_function_clauses(dds);
1113 fdds->mark_all(
false);
1115 fdds = promote_function_output_structure(fdds);
1117 eval.parse_constraint(d_dap2ce, *fdds);
1119 if (with_mime_headers)
1120 set_mime_text(out, dods_ddx, x_plain, last_modified_time(d_dataset), dds.get_dap_version());
1122 conditional_timeout_cancel();
1125 fdds->print_xml_writer(out,
true,
"");
1127 #if FUNCTION_CACHING 1135 eval.parse_constraint(d_dap2ce, dds);
1137 if (with_mime_headers)
1138 set_mime_text(out, dods_ddx, x_plain, last_modified_time(d_dataset), dds.get_dap_version());
1140 conditional_timeout_cancel();
1144 dds.print_xml_writer(out,
true,
"");
1150 void BESDapResponseBuilder::send_dmr(ostream &out, DMR &dmr,
bool with_mime_headers)
1155 if (!d_dap4ce.empty()) {
1157 BESDEBUG(
"dap",
"BESDapResponseBuilder::send_dmr() - Parsing DAP4 constraint: '"<< d_dap4ce <<
"'"<< endl);
1159 D4ConstraintEvaluator parser(&dmr);
1160 bool parse_ok = parser.parse(d_dap4ce);
1161 if (!parse_ok)
throw Error(malformed_expr,
"Constraint Expression (" + d_dap4ce +
") failed to parse.");
1167 dmr.root()->set_send_p(
true);
1170 if (with_mime_headers) set_mime_text(out, dap4_dmr, x_plain, last_modified_time(d_dataset), dmr.dap_version());
1172 conditional_timeout_cancel();
1176 dmr.print_dap4(xml, !d_dap4ce.empty() );
1177 out << xml.get_doc() << flush;
1180 void BESDapResponseBuilder::send_dap4_data_using_ce(ostream &out, DMR &dmr,
bool with_mime_headers)
1182 if (!d_dap4ce.empty()) {
1183 D4ConstraintEvaluator parser(&dmr);
1184 bool parse_ok = parser.parse(d_dap4ce);
1185 if (!parse_ok)
throw Error(malformed_expr,
"Constraint Expression (" + d_dap4ce +
") failed to parse.");
1191 dmr.root()->set_send_p(
true);
1194 if (dmr.response_limit() != 0 && dmr.request_size(
true) > dmr.response_limit()) {
1195 string msg =
"The Request for " + long_to_string(dmr.request_size(
true) / 1024)
1196 +
"MB is too large; requests for this user are limited to " + long_to_string(dmr.response_limit() / 1024)
1201 if (!store_dap4_result(out, dmr)) {
1202 serialize_dap4_data(out, dmr, with_mime_headers);
1206 void BESDapResponseBuilder::send_dap4_data(ostream &out, DMR &dmr,
bool with_mime_headers)
1211 if (!d_dap4function.empty()) {
1212 D4BaseTypeFactory d4_factory;
1213 DMR function_result(&d4_factory,
"function_results");
1217 if (!ServerFunctionsList::TheList())
1219 "The function expression could not be evaluated because there are no server functions defined on this server");
1221 D4FunctionEvaluator parser(&dmr, ServerFunctionsList::TheList());
1222 bool parse_ok = parser.parse(d_dap4function);
1223 if (!parse_ok)
throw Error(
"Function Expression (" + d_dap4function +
") failed to parse.");
1225 parser.eval(&function_result);
1229 send_dap4_data_using_ce(out, function_result, with_mime_headers);
1232 send_dap4_data_using_ce(out, dmr, with_mime_headers);
1241 BESDEBUG(
"dap",
"BESDapResponseBuilder::serialize_dap4_data() - BEGIN" << endl);
1243 if (with_mime_headers) set_mime_binary(out, dap4_data, x_plain, last_modified_time(d_dataset), dmr.dap_version());
1247 dmr.print_dap4(xml, !d_dap4ce.empty());
1252 chunked_ostream cos(out, max((
unsigned int) CHUNK_SIZE, xml.get_doc_size() + 2));
1254 conditional_timeout_cancel();
1257 cos << xml.get_doc() << CRLF << flush;
1260 D4StreamMarshaller m(cos);
1261 dmr.root()->serialize(m, dmr, !d_dap4ce.empty());
1262 #ifdef CLEAR_LOCAL_DATA 1263 dmr.root()->clear_local_data();
1267 BESDEBUG(
"dap",
"BESDapResponseBuilder::serialize_dap4_data() - END" << endl);
1286 if (get_store_result().length() != 0) {
1287 string serviceUrl = get_store_result();
1294 string *stylesheet_ref = 0, ss_ref_value;
1296 if (found && ss_ref_value.length() > 0) {
1297 stylesheet_ref = &ss_ref_value;
1301 if (resultCache == NULL) {
1308 string msg =
"The Stored Result request cannot be serviced. ";
1309 msg +=
"Unable to acquire StoredResultCache instance. ";
1310 msg +=
"This is most likely because the StoredResultCache is not (correctly) configured.";
1312 BESDEBUG(
"dap",
"[WARNING] " << msg << endl);
1313 d4au.writeD4AsyncResponseRejected(xmlWrtr, UNAVAILABLE, msg, stylesheet_ref);
1314 out << xmlWrtr.get_doc();
1316 BESDEBUG(
"dap",
"BESDapResponseBuilder::store_dap4_result() - Sent AsyncRequestRejected" << endl);
1321 if (get_async_accepted().length() != 0) {
1326 BESDEBUG(
"dap",
"BESDapResponseBuilder::store_dap4_result() - serviceUrl="<< serviceUrl << endl);
1328 string storedResultId =
"";
1332 "BESDapResponseBuilder::store_dap4_result() - storedResultId='"<< storedResultId <<
"'" << endl);
1335 BESDEBUG(
"dap",
"BESDapResponseBuilder::store_dap4_result() - targetURL='"<< targetURL <<
"'" << endl);
1337 d4au.writeD4AsyncAccepted(xmlWrtr, 0, 0, targetURL, stylesheet_ref);
1338 out << xmlWrtr.get_doc();
1340 BESDEBUG(
"dap",
"BESDapResponseBuilder::store_dap4_result() - sent AsyncAccepted" << endl);
1348 d4au.writeD4AsyncRequired(xmlWrtr, 0, 0, stylesheet_ref);
1349 out << xmlWrtr.get_doc();
1351 BESDEBUG(
"dap",
"BESDapResponseBuilder::store_dap4_result() - sent AsyncAccepted" << endl);
virtual std::string get_ce() const
Get the constraint expression.
virtual std::string get_dap4ce() const
Get the DAP4 constraint expression.
virtual void serialize_dap2_data_dds(std::ostream &out, libdap::DDS &dds, libdap::ConstraintEvaluator &eval, bool ce_eval=true)
static BESDapResponseCache * get_instance()
virtual void send_dap2_data(std::ostream &data_stream, libdap::DDS &dds, libdap::ConstraintEvaluator &eval, bool with_mime_headers=true)
Transmit data.
virtual string store_dap4_result(libdap::DMR &dmr, const string &constraint, BESDapResponseBuilder *rb)
virtual bool start(string name)
virtual std::string get_dap4function() const
Get the DAP4 server side function expression.
static string assemblePath(const string &firstPart, const string &secondPart, bool addLeadingSlash=false)
Assemble path fragments making sure that they are separated by a single '/' character.
void register_timeout() const
static BESStoredDapResultCache * get_instance()
virtual void split_ce(libdap::ConstraintEvaluator &eval, const std::string &expr="")
virtual void remove_timeout() const
void set_timeout(int timeout=0)
virtual void set_dataset_name(const std::string _dataset)
Set the dataset pathname.
virtual void set_dap4function(std::string _func)
virtual void send_ddx(std::ostream &out, libdap::DDS &dds, libdap::ConstraintEvaluator &eval, bool with_mime_headers=true)
void get_value(const string &s, string &val, bool &found)
Retrieve the value of a given key, if set.
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)
virtual void set_ce(std::string _ce)
void conditional_timeout_cancel()
bool store_dap2_result(ostream &out, libdap::DDS &dds, libdap::ConstraintEvaluator &eval)
static BESKeys * TheKeys()
virtual void establish_timeout(std::ostream &stream) const
virtual bool store_dap4_result(ostream &out, libdap::DMR &dmr)
virtual std::string get_dataset_name() const
Get the dataset name.
virtual void set_dap4ce(std::string _ce)
virtual void unlock_and_close(const string &target)
virtual string store_dap2_result(libdap::DDS &dds, const std::string &constraint, BESDapResponseBuilder *rb, libdap::ConstraintEvaluator *eval)
virtual void serialize_dap4_data(std::ostream &out, libdap::DMR &dmr, bool with_mime_headers=true)
virtual void send_dds(std::ostream &out, libdap::DDS &dds, libdap::ConstraintEvaluator &eval, bool constrained=false, bool with_mime_headers=true)
Transmit a DDS.