23 #include <BaseTypeFactory.h>
24 #include <Ancillary.h>
27 #include <InternalErr.h>
28 #include <mime_util.h>
30 using namespace libdap ;
57 das->parse( accessed ) ;
63 catch(InternalErr & e) {
64 BESDapError ex( e.get_error_message(),
true, e.get_error_code(),
65 __FILE__, __LINE__ ) ;
69 BESDapError ex( e.get_error_message(),
false, e.get_error_code(),
70 __FILE__, __LINE__ ) ;
74 string s =
"unknown exception caught building DAS";
93 BaseTypeFactory factory;
94 dds->set_factory( &factory ) ;
95 dds->filename( accessed );
96 dds->set_dataset_name( name_path( accessed ) ) ;
97 dds->parse( accessed ) ;
98 dds->set_factory( 0 ) ;
103 Ancillary::read_ancillary_das( *das, accessed ) ;
105 dds->transfer_attributes( das ) ;
114 catch(InternalErr & e) {
115 BESDapError ex( e.get_error_message(),
true, e.get_error_code(),
116 __FILE__, __LINE__ ) ;
120 BESDapError ex( e.get_error_message(),
false, e.get_error_code(),
121 __FILE__, __LINE__ ) ;
125 string s =
"unknown exception caught building DDS";
143 DataDDS *dds = bdds->
get_dds() ;
145 BaseTypeFactory factory;
146 dds->set_factory( &factory ) ;
147 dds->filename( accessed ) ;
148 dds->set_dataset_name( name_path( accessed ) ) ;
149 Connect *url =
new Connect( accessed ) ;
150 Response *r =
new Response( fopen( accessed.c_str(),
"r" ), 0 ) ;
152 if( !r->get_stream() )
153 throw Error(
string(
"The input source: ")
155 + string(
" could not be opened"));
157 url->read_data_no_mime( *dds, r ) ;
158 dds->set_factory( 0 ) ;
161 DDS::Vars_iter i = dds->var_begin() ;
162 DDS::Vars_iter e = dds->var_end() ;
166 b->set_read_p(
true ) ;
172 Ancillary::read_ancillary_das( *das, accessed ) ;
173 dds->transfer_attributes( das ) ;
182 catch(InternalErr & e) {
183 BESDapError ex( e.get_error_message(),
true, e.get_error_code(),
184 __FILE__, __LINE__ ) ;
188 BESDapError ex( e.get_error_message(),
false, e.get_error_code(),
189 __FILE__, __LINE__ ) ;
193 string s =
"unknown exception caught building DAS";
218 map<string,string> attrs ;
221 list<string> services ;
223 if( services.size() > 0 )
226 attrs[
"handles"] = handles ;
239 << (
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