35#include "BESDapResponse.h"
36#include "BESContextManager.h"
37#include "BESConstraintFuncs.h"
38#include "BESDataNames.h"
47#define prolog std::string("BESDapResponse::").append(__func__).append("() - ")
69 BESDEBUG(MODULE,prolog <<
"BEGIN" << endl);
72 context_key =
"dap_explicit_containers";
73 context_value = BESContextManager::TheManager()->
get_context(context_key, found);
76 if (context_value ==
"yes")
77 d_explicit_containers =
true;
78 else if (context_value ==
"no")
79 d_explicit_containers =
false;
81 throw BESError(
"dap_explicit_containers must be yes or no",
82 BES_SYNTAX_USER_ERROR, __FILE__, __LINE__);
85 context_key =
"dap_format";
86 context_value = BESContextManager::TheManager()->
get_context(context_key, found);
89 if (context_value ==
"dap2")
90 d_explicit_containers =
false;
92 d_explicit_containers =
true;
95 BESDEBUG(MODULE,prolog <<
"d_explicit_containers: " << (d_explicit_containers?
"true":
"false") << endl);
97 context_key =
"xdap_accept";
98 context_value = BESContextManager::TheManager()->
get_context(context_key, found);
100 if (found) d_dap_client_protocol = context_value;
101 BESDEBUG(MODULE,prolog <<
"d_dap_client_protocol: " << d_dap_client_protocol << endl);
103 context_key =
"xml:base";
104 context_value = BESContextManager::TheManager()->
get_context(context_key, found);
106 if (found) d_request_xml_base = context_value;
107 BESDEBUG(MODULE,prolog <<
"d_request_xml_base: " << d_request_xml_base << endl);
109 BESDEBUG(MODULE,prolog <<
"END" << endl);
121 return !d_explicit_containers;
141 BESConstraintFuncs::post_append(dhi);
189 strm << BESIndent::LMarg <<
"BESDapResponse::dump - (" << (
void *)
this <<
")" << endl;
191 strm << BESIndent::LMarg <<
"d_explicit_containers: " << d_explicit_containers << endl;
192 strm << BESIndent::LMarg <<
"d_dap_client_protocol: " << d_dap_client_protocol << endl;
193 BESIndent::UnIndent();
195 BESIndent::UnIndent();
std::string get_dap4_constraint() const
retrieve the constraint expression for this container
std::string get_dap4_function() const
retrieve the constraint expression for this container
std::string get_constraint() const
retrieve the constraint expression for this container
virtual std::string get_context(const std::string &name, bool &found)
retrieve the value of the specified context from the BES
void read_contexts()
Extract the dap protocol from the setContext information This method checks four contexts: dap_explic...
virtual void set_dap4_function(BESDataHandlerInterface &dhi)
set the constraint depending on the context
virtual void set_dap4_constraint(BESDataHandlerInterface &dhi)
set the constraint depending on the context
virtual void set_constraint(BESDataHandlerInterface &dhi)
set the constraint depending on the context
virtual void dump(std::ostream &strm) const
dumps information about this object
bool is_dap2()
See get_explicit_containers()
Structure storing information used by the BES to handle the request.
std::map< std::string, std::string > data
the map of string data that will be required for the current request.
BESContainer * container
pointer to current container in this interface
Base exception class for the BES with basic string message.