42 #include <BaseTypeFactory.h>
43 #include <Ancillary.h>
46 #include <InternalErr.h>
47 #include <mime_util.h>
49 using namespace libdap;
81 catch (InternalErr & e) {
82 BESDapError ex(e.get_error_message(),
true, e.get_error_code(), __FILE__, __LINE__);
86 BESDapError ex(e.get_error_message(),
false, e.get_error_code(), __FILE__, __LINE__);
90 string s =
"unknown exception caught building DAS";
108 BaseTypeFactory factory;
109 dds->set_factory(&factory);
110 dds->filename(accessed);
111 dds->set_dataset_name(name_path(accessed));
112 dds->parse(accessed);
118 Ancillary::read_ancillary_das(*das, accessed);
120 dds->transfer_attributes(das);
129 catch (InternalErr & e) {
130 BESDapError ex(e.get_error_message(),
true, e.get_error_code(), __FILE__, __LINE__);
134 BESDapError ex(e.get_error_message(),
false, e.get_error_code(), __FILE__, __LINE__);
138 string s =
"unknown exception caught building DDS";
155 DataDDS *dds = bdds->
get_dds();
157 BaseTypeFactory factory;
158 dds->set_factory(&factory);
159 dds->filename(accessed);
160 dds->set_dataset_name(name_path(accessed));
161 Connect *url =
new Connect(accessed);
162 Response *r =
new Response(fopen(accessed.c_str(),
"r"), 0);
164 if (!r->get_stream())
165 throw Error(
string(
"The input source: ") + accessed + string(
" could not be opened"));
167 url->read_data_no_mime(*dds, r);
171 DDS::Vars_iter i = dds->var_begin();
172 DDS::Vars_iter e = dds->var_end();
173 for (; i != e; i++) {
181 Ancillary::read_ancillary_das(*das, accessed);
182 dds->transfer_attributes(das);
191 catch (InternalErr & e) {
192 BESDapError ex(e.get_error_message(),
true, e.get_error_code(), __FILE__, __LINE__);
196 BESDapError ex(e.get_error_message(),
false, e.get_error_code(), __FILE__, __LINE__);
200 string s =
"unknown exception caught building DAS";
223 map<string, string> attrs;
226 list<string> services;
228 if (services.size() > 0) {
230 attrs[
"handles"] = handles;
241 strm <<
BESIndent::LMarg <<
"DapRequestHandler::dump - (" << (
void *)
this <<
")" << endl;
brief represents simple text information in a response object, such as version and help inforamtion...
exception thrown if an internal error is found and is fatal to the BES
#define DAPREADER_VERSION
exception thrown if inernal error encountered
virtual void dump(ostream &strm) const
dumps information about this object
string get_symbolic_name() const
retrieve the symbolic name for this container
Represents an OPeNDAP DDS DAP2 data object within the BES.
virtual void clear_container()
clear the container in the DAP response object
static bool dap_build_data(BESDataHandlerInterface &dhi)
#define DAPREADER_PACKAGE
virtual string access()=0
returns the true name of this container
virtual void clear_container()
clear the container in the DAP response object
informational response object
static string implode(const list< string > &values, char delim)
implode a list of values into a single string delimited by delim
DapRequestHandler(const string &name)
virtual BESResponseObject * get_response_object()
return the current response object
Abstract exception class for the BES with basic string message.
static BESServiceRegistry * TheRegistry()
BESResponseHandler * response_handler
virtual void set_constraint(BESDataHandlerInterface &dhi)
set the constraint depending on the context
virtual void begin_tag(const string &tag_name, map< string, string > *attrs=0)
static ostream & LMarg(ostream &strm)
virtual void set_container(const string &cn)
set the container in the DAP response object
error object created from libdap error objects and can handle those errors
Represents an OPeNDAP DataDDS DAP2 data object within the BES.
virtual void clear_container()
clear the container in the DAP response object
Represents a specific data type request handler.
static bool dap_build_help(BESDataHandlerInterface &dhi)
Structure storing information used by the BES to handle the request.
static bool dap_build_dds(BESDataHandlerInterface &dhi)
virtual ~DapRequestHandler(void)
virtual void set_container(const string &cn)
set the container in the DAP response object
virtual bool add_handler(const string &handler_name, p_request_handler handler_method)
add a handler method to the request handler that knows how to fill in a specific response object ...
Represents an OPeNDAP DAS DAP2 data object within the BES.
static bool dap_build_das(BESDataHandlerInterface &dhi)
virtual void set_container(const string &cn)
set the container in the DAP response object
virtual void dump(ostream &strm) const
dumps information about this object
virtual void add_module(const string &n, const string &v)
Abstract base class representing a specific set of information in response to a request to the BES...
BESContainer * container
pointer to current container in this interface
virtual void end_tag(const string &tag_name)
static bool dap_build_vers(BESDataHandlerInterface &dhi)
virtual void services_handled(const string &handler, list< string > &services)
returns the list of servies provided by the handler in question