37 #include "BESDataResponseHandler.h" 38 #include "BESDataDDSResponse.h" 39 #include "BESRequestHandlerList.h" 40 #include "BESDapNames.h" 41 #include "BESDataNames.h" 43 #include "BESContextManager.h" 44 #include "BESInternalError.h" 47 BESDataResponseHandler::BESDataResponseHandler(
const string &name )
52 BESDataResponseHandler::~BESDataResponseHandler( )
72 dhi.action_name = DATA_RESPONSE_STR;
75 DataDDS *dds =
new DataDDS(NULL,
"virtual");
89 string response_size_limit = BESContextManager::TheManager()->
get_context(
"max_response_size", found);
90 if (found && !response_size_limit.empty()) {
93 long rsl = strtol(response_size_limit.c_str(), &endptr, 10);
94 if (rsl == 0 && errno > 0) {
95 string err = strerror(errno);
97 delete bdds; bdds = 0;
99 + response_size_limit +
") was bad: " + err, __FILE__, __LINE__);
102 dds->set_response_limit(rsl);
106 if (dds->get_keywords().has_keyword(
"dap")) {
107 dds->set_dap_version(dds->get_keywords().get_keyword_value(
"dap"));
134 transmitter->send_response( DATA_SERVICE, _response, dhi ) ;
147 strm << BESIndent::LMarg <<
"BESDataResponseHandler::dump - (" 148 << (
void *)
this <<
")" << endl ;
149 BESIndent::Indent() ;
151 BESIndent::UnIndent() ;
155 BESDataResponseHandler::DataResponseBuilder(
const string &name )
string get_dap_client_protocol() const
Return the dap version string sent by the client (e.g., the OLFS)
string get_constraint() const
retrieve the constraint expression for this container
exception thrown if inernal error encountered
response handler that builds an OPeNDAP Data DDS object
virtual string get_context(const string &name, bool &found)
retrieve the value of the specified context from the BES
virtual void dump(ostream &strm) const
dumps information about this object
handler object that knows how to create a specific response object
virtual void transmit(BESTransmitter *transmitter, BESDataHandlerInterface &dhi)
transmit the response object built by the execute command
virtual void execute_each(BESDataHandlerInterface &dhi)
for each container in the given data handler interface, execute the given request ...
void set_constraint(const string &s)
set the constraint for this container
Represents an OPeNDAP DataDDS DAP2 data object within the BES.
virtual void dump(ostream &strm) const
dumps information about this object
Structure storing information used by the BES to handle the request.
virtual void execute(BESDataHandlerInterface &dhi)
executes the command 'get data for <def_name>' by executing the request for each container in the spe...
void first_container()
set the container pointer to the first container in the containers list
BESContainer * container
pointer to current container in this interface