#include <DODSFilter.h>
Collaboration diagram for DODSFilter:
Public Types | |
enum | Response { Unknown_Response, DAS_Response, DDS_Response, DataDDS_Response, DDX_Response, BLOB_Response, Version_Response } |
Public Member Functions | |
virtual void | dataset_constraint (DDS &dds, ConstraintEvaluator &eval, FILE *out) const |
DODSFilter (int argc, char *argv[]) throw (Error) | |
DODSFilter constructor. | |
DODSFilter () | |
virtual void | establish_timeout (FILE *stream) const |
virtual void | functional_constraint (BaseType &var, DDS &dds, ConstraintEvaluator &eval, FILE *out) const |
virtual string | get_action () const |
virtual string | get_cache_dir () const |
Get the cache directory. | |
virtual string | get_ce () const |
Get the constraint expression. | |
virtual string | get_cgi_version () const |
virtual time_t | get_das_last_modified_time (const string &anc_location="") const |
virtual time_t | get_data_last_modified_time (const string &anc_location="") const |
virtual time_t | get_dataset_last_modified_time () const |
virtual string | get_dataset_name () const |
Get the dataset name. | |
virtual string | get_dataset_version () const |
Get the version information for the dataset. | |
virtual time_t | get_dds_last_modified_time (const string &anc_location="") const |
virtual time_t | get_request_if_modified_since () const |
virtual Response | get_response () const |
int | get_timeout () const |
virtual string | get_URL () const |
virtual bool | is_conditional () const |
Is this request conditional? | |
virtual void | print_usage () const |
Print usage information for a filter program. | |
virtual void | read_ancillary_das (DAS &das, const string &anc_location="") const |
Test if ancillary data must be read. | |
virtual void | read_ancillary_dds (DDS &dds, const string &anc_location="") const |
Test if ancillary data must be read. | |
virtual void | send_blob (DDS &dds, FILE *out, bool with_mime_headers=true) |
virtual void | send_das (FILE *out, DAS &das, const string &anc_location="", bool with_mime_headers=true) const |
Transmit a DAS. | |
virtual void | send_das (DAS &das, const string &anc_location="", bool with_mime_headers=true) const |
virtual void | send_data (DDS &dds, ConstraintEvaluator &eval, FILE *data_stream, const string &anc_location="", bool with_mime_headers=true) const |
Transmit data. | |
virtual void | send_dds (FILE *out, DDS &dds, ConstraintEvaluator &eval, bool constrained=false, const string &anc_location="", bool with_mime_headers=true) const |
Transmit a DDS. | |
virtual void | send_dds (DDS &dds, ConstraintEvaluator &eval, bool constrained=false, const string &anc_location="", bool with_mime_headers=true) const |
virtual void | send_ddx (DDS &dds, ConstraintEvaluator &eval, FILE *out, bool with_mime_headers=true) const |
virtual void | send_version_info () const |
Send version information back to the client program. | |
virtual void | set_ce (string _ce) |
virtual void | set_cgi_version (string version) |
virtual void | set_dataset_name (const string _dataset) |
virtual void | set_response (const string &r) |
void | set_timeout (int timeout=0) |
virtual void | set_URL (const string &url) |
virtual | ~DODSFilter () |
Protected Member Functions | |
void | initialize (int argc, char *argv[]) |
void | initialize () |
virtual int | process_options (int argc, char *argv[]) |
Protected Attributes | |
string | d_action |
time_t | d_anc_das_lmt |
time_t | d_anc_dds_lmt |
string | d_anc_dir |
string | d_anc_file |
bool | d_bad_options |
string | d_cache_dir |
string | d_ce |
string | d_cgi_ver |
bool | d_comp |
bool | d_conditional_request |
string | d_dataset |
time_t | d_if_modified_since |
string | d_program_name |
Response | d_response |
int | d_timeout |
string | d_url |
The filter program receives a data request from the dispatch script. It receives its operating parameters from the command line, like any UNIX command, and it returns its output to standard output, which the httpd server packages up into a reply to the client.
This class contains some common functions for the filter programs used to make up the DODS data servers. The filter programs do not have to be called by a CGI program, but that is the normal mechanism by which they are invoked.
We need to rethink the ancillary file/directory stuff. I don't think it's ever been used...
Definition at line 80 of file DODSFilter.h.
|
Types of responses DODSFilter know about.
Definition at line 84 of file DODSFilter.h. |
|
Make an empty instance. Use the set_*() methods to load with needed values. You must call at least set_dataset_name() or be requesting version information.
Definition at line 130 of file DODSFilter.h. |
|
Create an instance of DODSFilter using the command line arguments passed by the CGI (or other) program. The default constructor is private; this and the copy constructor (which is just the default copy constructor) are the only way to create an instance of DODSFilter. These are the valid options:
Definition at line 167 of file DODSFilter.cc. References DBG. |
|
Definition at line 184 of file DODSFilter.cc. |
|
Definition at line 829 of file DODSFilter.cc. References d_dataset, DBG, delete_xdrstdio(), new_xdrstdio(), DDS::print_constrained(), DDS::var_begin(), and DDS::var_end(). Referenced by send_data(). |
Here is the call graph for this function:
|
Use values of this instance to establish a timeout alarm for the server. If the timeout value is zero, do nothing.
Definition at line 615 of file DODSFilter.cc. References d_timeout, SignalHandler::instance(), and SignalHandler::register_handler(). Referenced by send_data(). |
Here is the call graph for this function:
|
Definition at line 803 of file DODSFilter.cc. References d_dataset, delete_xdrstdio(), new_xdrstdio(), BaseType::print_decl(), and BaseType::serialize(). Referenced by send_data(). |
Here is the call graph for this function:
|
Get the string name of the response to be returned. Definition at line 445 of file DODSFilter.cc. |
|
The
Definition at line 581 of file DODSFilter.cc. |
|
Return the entire constraint expression in a string. This includes both the projection and selection clauses, but not the question mark.
Definition at line 341 of file DODSFilter.cc. |
|
Return the version information passed to the instance when it was created. This string is passed to the DODSFilter ctor using the -v option.
Definition at line 329 of file DODSFilter.cc. |
|
Get the last modified time for the dataset's DAS. This time, given in seconds since the epoch (1 Jan 1970 00:00:00 GMT), is the greater of the datasets's and any ancillary DAS' last modified time.
Definition at line 486 of file DODSFilter.cc. References d_anc_dir, d_anc_file, d_dataset, DBG, find_ancillary_file(), get_dataset_last_modified_time(), and last_modified_time(). Referenced by send_das(). |
Here is the call graph for this function:
|
Get the last modified time to be used for a particular data request. This method should look at both the constraint expression and any ancillary files for this dataset. The implementation provided here returns the latest time returned by the
Definition at line 538 of file DODSFilter.cc. References d_anc_dir, d_anc_file, d_dataset, DBG, find_ancillary_file(), get_dataset_last_modified_time(), and last_modified_time(). Referenced by send_blob(), and send_data(). |
Here is the call graph for this function:
|
Get the dataset's last modified time. This returns the time at which the dataset was last modified as defined by UNIX's notion of modification. This does not take into account the modification of an ancillary DAS or DDS. Time is given in seconds since the epoch (1 Jan 1970 00:00:00 GMT). This method perform a simple check on the file named by the dataset given when the DODSFilter instance was created. If the dataset is not a filter, this method returns the current time. Servers which provide access to non-file-based data should subclass DODSFilter and supply a more suitable version of this method.
From the stat(2) man page: ``Traditionally,
Definition at line 471 of file DODSFilter.cc. References d_dataset, and last_modified_time(). Referenced by get_das_last_modified_time(), get_data_last_modified_time(), and get_dds_last_modified_time(). |
Here is the call graph for this function:
|
The ``dataset name'' is the filename or other string that the filter program will use to access the data. In some cases this will indicate a disk file containing the data. In others, it may represent a database query or some other exotic data access method.
Definition at line 361 of file DODSFilter.cc. |
|
To read version information that is specific to a certain dataset, override this method with an implementation that does what you want. By default, this returns an empty string.
Definition at line 400 of file DODSFilter.cc. Referenced by send_version_info(). |
|
Get the last modified time for the dataset's DDS. This time, given in seconds since the epoch (1 Jan 1970 00:00:00 GMT), is the greater of the datasets's and any ancillary DDS' last modified time.
Definition at line 509 of file DODSFilter.cc. References d_anc_dir, d_anc_file, d_dataset, DBG, find_ancillary_file(), get_dataset_last_modified_time(), and last_modified_time(). Referenced by send_dds(), and send_ddx(). |
Here is the call graph for this function:
|
Get the value of a conditional request's If-Modified-Since header. This value is used to determine if the request should get a full response or a Not Modified (304) response. The time is given in seconds since the Unix epoch (midnight, 1 Jan 1970). If no time was given with the request, this methods returns -1.
Definition at line 569 of file DODSFilter.cc. Referenced by send_blob(), send_das(), send_data(), send_dds(), and send_ddx(). |
|
Get the enum name of the response to be returned. Definition at line 439 of file DODSFilter.cc. Referenced by initialize(). |
|
Get the server's timeout value. Definition at line 598 of file DODSFilter.cc. |
|
Get the URL. This returns the URL, minus the constraint originally sent to the server.
Definition at line 376 of file DODSFilter.cc. |
|
Initialize. Specializations can call this once an empty DODSFilter has been created using the default constructor. Using a method such as this provides a way to specialize the process_options() method and then have that specialization called by the subclass' constructor. This class and any class that specializes it should call this method in its constructor. Note that when this method is called, the object is not fully constructed.
Definition at line 232 of file DODSFilter.cc. References d_dataset, d_program_name, get_response(), initialize(), print_usage(), process_options(), and www2id(). |
Here is the call graph for this function:
|
Called when initializing a DODSFilter that's not going to be passed a command line arguments. Definition at line 191 of file DODSFilter.cc. References d_anc_das_lmt, d_anc_dds_lmt, d_anc_dir, d_anc_file, d_bad_options, d_cache_dir, d_ce, d_cgi_ver, d_comp, d_conditional_request, d_dataset, d_if_modified_since, d_program_name, d_response, d_timeout, and d_url. Referenced by initialize(). |
|
Definition at line 299 of file DODSFilter.cc. Referenced by send_blob(), send_das(), send_data(), send_dds(), and send_ddx(). |
|
This message is printed when the filter program is incorrectly invoked by the dispatch CGI. This is an error in the server installation or the CGI implementation, so the error message is written to stderr instead of stdout. A server's stderr messages show up in the httpd log file. In addition, an error object is sent back to the client program telling them that the server is broken. Definition at line 690 of file DODSFilter.cc. References ErrMsgT(), unknown_error, and usage. Referenced by initialize(), process_options(), set_response(), and set_URL(). |
Here is the call graph for this function:
|
Processing the command line options passed to the filter is handled by this method so that specializations can change the options easily.
Definition at line 261 of file DODSFilter.cc. References d_anc_dir, d_anc_file, d_cache_dir, d_comp, d_conditional_request, d_if_modified_since, d_timeout, DBG, DBGN, print_usage(), set_ce(), set_cgi_version(), set_response(), and set_URL(). Referenced by initialize(). |
Here is the call graph for this function:
|
Read the ancillary DAS information and merge it into the input DAS object.
Definition at line 637 of file DODSFilter.cc. References d_anc_dir, d_anc_file, d_dataset, DBG, find_ancillary_file(), and DAS::parse(). |
Here is the call graph for this function:
|
Read the ancillary DDS information and merge it into the input DDS object.
Definition at line 663 of file DODSFilter.cc. References d_anc_dir, d_anc_file, d_dataset, DBG, find_ancillary_file(), and DDS::parse(). |
Here is the call graph for this function:
|
Write the BLOB response to the client.
Definition at line 990 of file DODSFilter.cc. References d_anc_dir, d_ce, d_cgi_ver, d_comp, d_dataset, deflate, deflate_exists(), dods_data, get_data_last_modified_time(), get_request_if_modified_since(), is_conditional(), BaseType::serialize(), set_mime_binary(), set_mime_not_modified(), DDS::var_end(), and x_plain. |
Here is the call graph for this function:
|
This function formats and prints an ASCII representation of a DAS on stdout. This has the effect of sending the DAS object back to the client program.
Definition at line 721 of file DODSFilter.cc. References d_cgi_ver, dods_das, get_das_last_modified_time(), get_request_if_modified_since(), is_conditional(), DAS::print(), set_mime_not_modified(), set_mime_text(), and x_plain. |
Here is the call graph for this function:
|
Definition at line 739 of file DODSFilter.cc. |
|
Send the data in the DDS object back to the client program. The data is encoded in XDR format, and enclosed in a MIME document which is all sent to
Definition at line 873 of file DODSFilter.cc. References compressor(), d_ce, d_cgi_ver, d_comp, d_dataset, d_timeout, dataset_constraint(), deflate, deflate_exists(), dods_data, establish_timeout(), ConstraintEvaluator::eval_function(), functional_constraint(), ConstraintEvaluator::functional_expression(), get_data_last_modified_time(), get_request_if_modified_since(), is_conditional(), ConstraintEvaluator::parse_constraint(), set_mime_binary(), set_mime_not_modified(), DDS::set_timeout(), DDS::tag_nested_sequences(), unknown_error, and x_plain. |
Here is the call graph for this function:
|
This function formats and prints an ASCII representation of a DDS on stdout. When called by a CGI program, this has the effect of sending a DDS object back to the client program. Either an entire DDS or a constrained DDS may be sent.
Definition at line 762 of file DODSFilter.cc. References d_ce, d_cgi_ver, dods_dds, ConstraintEvaluator::functional_expression(), get_dds_last_modified_time(), get_request_if_modified_since(), is_conditional(), ConstraintEvaluator::parse_constraint(), DDS::print(), DDS::print_constrained(), set_mime_not_modified(), set_mime_text(), and x_plain. |
Here is the call graph for this function:
|
Definition at line 793 of file DODSFilter.cc. |
|
Send the DDX response. The DDX never contains data, instead it holds a reference to a Blob response which is used to get the data values. The DDS and DAS objects are built using code that already exists in the servers.
Definition at line 961 of file DODSFilter.cc. References d_anc_dir, d_ce, d_cgi_ver, d_url, dap4_ddx, get_dds_last_modified_time(), get_request_if_modified_since(), is_conditional(), ConstraintEvaluator::parse_constraint(), DDS::print_xml(), set_mime_not_modified(), set_mime_text(), and x_plain. |
Here is the call graph for this function:
|
This function formats and sends to stdout version information from the httpd server, the server dispatch scripts, the DODS core software, and (optionally) the dataset. Definition at line 704 of file DODSFilter.cc. References d_cgi_ver, do_version(), and get_dataset_version(). |
Here is the call graph for this function:
|
Definition at line 347 of file DODSFilter.cc. References d_ce, and www2id(). Referenced by process_options(). |
Here is the call graph for this function:
|
Set the CGI/Server version number. Servers use this when answering requests for version information. The version `number' should include both the name of the server (e.g., Note that the -v switch that this class understands is deprecated since it is usually called by Perl code. It makes more sense to have the actual C++ software set the version string.
Definition at line 318 of file DODSFilter.cc. References d_cgi_ver. Referenced by process_options(). |
|
Definition at line 367 of file DODSFilter.cc. |
Here is the call graph for this function:
|
Set the response to be returned. Valid response names are "DAS", "DDS", "DataDDS, "Version".
Definition at line 411 of file DODSFilter.cc. References d_action, d_response, and print_usage(). Referenced by process_options(). |
Here is the call graph for this function:
|
Set the server's timeout value. A value of zero (the default) means no timeout.
Definition at line 591 of file DODSFilter.cc. References d_timeout. |
|
Set the URL. Set the URL sent to the server.
Definition at line 384 of file DODSFilter.cc. References d_url, and print_usage(). Referenced by process_options(). |
Here is the call graph for this function:
|
Definition at line 109 of file DODSFilter.h. Referenced by set_response(). |
|
Definition at line 113 of file DODSFilter.h. Referenced by initialize(). |
|
Definition at line 114 of file DODSFilter.h. Referenced by initialize(). |
|
Definition at line 103 of file DODSFilter.h. Referenced by get_das_last_modified_time(), get_data_last_modified_time(), get_dds_last_modified_time(), initialize(), process_options(), read_ancillary_das(), read_ancillary_dds(), send_blob(), and send_ddx(). |
|
Definition at line 104 of file DODSFilter.h. Referenced by get_das_last_modified_time(), get_data_last_modified_time(), get_dds_last_modified_time(), initialize(), process_options(), read_ancillary_das(), and read_ancillary_dds(). |
|
Definition at line 96 of file DODSFilter.h. Referenced by initialize(). |
|
Definition at line 105 of file DODSFilter.h. Referenced by initialize(), and process_options(). |
|
Definition at line 101 of file DODSFilter.h. Referenced by initialize(), send_blob(), send_data(), send_dds(), send_ddx(), and set_ce(). |
|
Definition at line 102 of file DODSFilter.h. Referenced by initialize(), send_blob(), send_das(), send_data(), send_dds(), send_ddx(), send_version_info(), and set_cgi_version(). |
|
Definition at line 95 of file DODSFilter.h. Referenced by initialize(), process_options(), send_blob(), and send_data(). |
|
Definition at line 97 of file DODSFilter.h. Referenced by initialize(), and process_options(). |
|
Definition at line 100 of file DODSFilter.h. Referenced by dataset_constraint(), functional_constraint(), get_das_last_modified_time(), get_data_last_modified_time(), get_dataset_last_modified_time(), get_dds_last_modified_time(), initialize(), read_ancillary_das(), read_ancillary_dds(), send_blob(), send_data(), and set_dataset_name(). |
|
Definition at line 115 of file DODSFilter.h. Referenced by initialize(), and process_options(). |
|
Definition at line 99 of file DODSFilter.h. Referenced by initialize(). |
|
Definition at line 108 of file DODSFilter.h. Referenced by initialize(), and set_response(). |
|
Definition at line 111 of file DODSFilter.h. Referenced by establish_timeout(), initialize(), process_options(), send_data(), and set_timeout(). |
|
Definition at line 106 of file DODSFilter.h. Referenced by initialize(), send_ddx(), and set_URL(). |