38 #include <D4BaseTypeFactory.h>
39 #include <Ancillary.h>
40 #include <InternalErr.h>
41 #include <mime_util.h>
64 #define FITS_NAME "fits"
96 throw BESDapError(fits_error,
false, unknown_error, __FILE__, __LINE__);
98 Ancillary::read_ancillary_das(*das, accessed);
101 catch( InternalErr &e ) {
102 throw BESDapError(e.get_error_message(),
true, e.get_error_code(), __FILE__, __LINE__);
105 throw BESDapError(e.get_error_message(),
false, e.get_error_code(), __FILE__, __LINE__);
108 throw BESDapError(
"Unknown exception caught building FITS das response",
true, unknown_error, __FILE__, __LINE__);
126 throw BESDapError(fits_error,
false, unknown_error, __FILE__, __LINE__);
129 Ancillary::read_ancillary_dds(*dds, accessed);
134 throw BESDapError(fits_error,
false, unknown_error, __FILE__, __LINE__);
136 Ancillary::read_ancillary_das(*das, accessed);
138 dds->transfer_attributes(das);
144 catch( InternalErr &e ) {
145 throw BESDapError(e.get_error_message(),
true, e.get_error_code(), __FILE__, __LINE__);
148 throw BESDapError(e.get_error_message(),
false, e.get_error_code(), __FILE__, __LINE__);
151 string err =
"Unknown exception caught building FITS dds response";
152 throw BESDapError(err,
true, unknown_error, __FILE__, __LINE__);
166 DataDDS *dds = bdds->
get_dds();
170 throw BESDapError(fits_error,
false, unknown_error, __FILE__, __LINE__);
172 Ancillary::read_ancillary_dds(*dds, accessed);
178 throw BESDapError(fits_error,
false, unknown_error, __FILE__, __LINE__);
180 Ancillary::read_ancillary_das(*das, accessed);
182 dds->transfer_attributes(das);
188 catch( InternalErr &e ) {
189 throw BESDapError(e.get_error_message(),
true, e.get_error_code(), __FILE__, __LINE__);
192 throw BESDapError(e.get_error_message(),
false, e.get_error_code(), __FILE__, __LINE__);
195 string err =
"Unknown exception caught building FITS data response";
196 throw BESDapError(err,
true, unknown_error, __FILE__, __LINE__);
218 BaseTypeFactory factory;
219 DDS dds(&factory, name_path(data_path),
"3.2");
220 dds.filename(data_path);
226 throw BESDapError(fits_error,
false, unknown_error, __FILE__, __LINE__);
230 throw BESDapError(fits_error,
false, unknown_error, __FILE__, __LINE__);
231 Ancillary::read_ancillary_das(das, data_path);
233 dds.transfer_attributes(&das);
235 catch( InternalErr &e ) {
236 throw BESDapError(e.get_error_message(),
true, e.get_error_code(), __FILE__, __LINE__);
239 throw BESDapError(e.get_error_message(),
false, e.get_error_code(), __FILE__, __LINE__);
242 throw BESDapError(
"Unknown exception caught building FITS DMR response",
true, unknown_error, __FILE__, __LINE__);
254 dmr->set_factory(
new D4BaseTypeFactory);
255 dmr->build_using_dds(dds);
272 info->
add_module(MODULE_NAME, MODULE_VERSION);
283 map<string, string> attrs;
284 attrs[
"name"] = MODULE_NAME ;
285 attrs[
"version"] = MODULE_VERSION ;
290 list<string> services;
292 if (services.size() > 0) {
294 attrs[
"handles"] = handles;
311 strm <<
BESIndent::LMarg <<
"FitsRequestHandler::dump - (" << (
void *)
this <<
")" << endl;
brief represents simple text information in a response object, such as version and help inforamtion...
#define DAP4DATA_RESPONSE
static bool fits_build_das(BESDataHandlerInterface &dhi)
exception thrown if inernal error encountered
static bool fits_build_help(BESDataHandlerInterface &dhi)
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 fits_build_vers(BESDataHandlerInterface &dhi)
virtual void set_dap4_constraint(BESDataHandlerInterface &dhi)
set the constraint depending on the context
virtual string access()=0
returns the true name of this container
virtual void clear_container()
clear the container in the DAP response object
virtual void set_dap4_function(BESDataHandlerInterface &dhi)
set the constraint depending on the context
informational response object
static string implode(const list< string > &values, char delim)
implode a list of values into a single string delimited by delim
virtual BESResponseObject * get_response_object()
return the current response object
static BESServiceRegistry * TheRegistry()
virtual ~FitsRequestHandler(void)
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)
Represents an OPeNDAP DMR DAP4 data object within the BES.
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 dump(ostream &strm) const
dumps information about this object
static bool fits_build_data(BESDataHandlerInterface &dhi)
virtual void clear_container()
clear the container in the DAP response object
Represents a specific data type request handler.
Structure storing information used by the BES to handle the request.
FitsRequestHandler(const string &name)
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 fits_build_dds(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
bool fits_read_attributes(libdap::DAS &das, const std::string &filename, std::string &error)
virtual void end_tag(const string &tag_name)
bool fits_read_descriptors(libdap::DDS &dds, const std::string &filename, std::string &error)
virtual void services_handled(const string &handler, list< string > &services)
returns the list of servies provided by the handler in question
static bool fits_build_dmr(BESDataHandlerInterface &dhi)
Build a DMR object.