libdap  Updated for version 3.20.6
libdap4 is an implementation of OPeNDAP's DAP protocol.
libdap::AISConnect Class Reference

#include <AISConnect.h>

Inheritance diagram for libdap::AISConnect:
Inheritance graph

Public Member Functions

 AISConnect (const string &name) throw (AISDatabaseReadFailed)
 
 AISConnect (const string &name, const string &ais_db) throw (AISDatabaseReadFailed)
 
virtual string CE ()
 Get the Connect's constraint expression. More...
 
string get_protocol ()
 
string get_version ()
 
bool is_cache_enabled ()
 
bool is_local ()
 
virtual void read_data (DataDDS &data, Response *rs)
 Read data which is preceded by MIME headers. This method works for both data dds and data ddx responses. More...
 
virtual void read_data (DDS &data, Response *rs)
 
virtual void read_data_no_mime (DataDDS &data, Response *rs)
 Read data from a file which does not have response MIME headers. This method is a companion to read_data(). While read_data() assumes that the response has MIME headers, this method does not. If you call this with a Response that does contain headers, it will throw an Error (and the message is likely to be inscrutable). More...
 
virtual void read_data_no_mime (DDS &data, Response *rs)
 
virtual void request_das (DAS &das)
 
virtual void request_das_url (DAS &das)
 Get the DAS from a server. More...
 
virtual void request_data (DataDDS &data, string expr="")
 Get the DAS from a server. More...
 
virtual void request_data_ddx (DataDDS &data, string expr="")
 
virtual void request_data_ddx_url (DataDDS &data)
 
virtual void request_data_url (DataDDS &data)
 Get the DAS from a server. More...
 
virtual void request_dds (DDS &dds, string expr="")
 Get the DDS from a server. More...
 
virtual void request_dds_url (DDS &dds)
 Get the DDS from a server. More...
 
virtual void request_ddx (DDS &dds, string expr="")
 Get the DDX from a server. More...
 
virtual void request_ddx_url (DDS &dds)
 The 'url' version of request_ddx. More...
 
virtual string request_protocol ()
 
virtual string request_version ()
 
void set_accept_deflate (bool deflate)
 
void set_cache_enabled (bool enabled)
 
void set_credentials (string u, string p)
 Set the credentials for responding to challenges while dereferencing URLs. More...
 
void set_xdap_accept (int major, int minor)
 
void set_xdap_protocol (int major, int minor)
 
virtual string URL (bool CE=true)
 Get the object's URL. More...
 
virtual ~AISConnect ()
 

Protected Member Functions

Suppress the C++ defaults for these.
 AISConnect ()
 
 AISConnect (const AISConnect &ac)
 

Detailed Description

Provide seamless client-side AIS services.

Definition at line 45 of file AISConnect.h.

Constructor & Destructor Documentation

◆ AISConnect() [1/2]

libdap::AISConnect::AISConnect ( const string &  name)
throw (AISDatabaseReadFailed
)

Build an AISConnect. This calls Connect's constructor with name and accepts its default values for the other parameters. The AIS database to use is read from the configuration file ~/.dodsrc.

Parameters
nameCreate a virtual, AIS-enhanced, connection for this OPeNDAP data source.
Exceptions
AISDatabaseReadFailedThrown if the AIS database listed in the ~/.dodsrc file could not be opened.

Definition at line 40 of file AISConnect.cc.

◆ AISConnect() [2/2]

libdap::AISConnect::AISConnect ( const string &  name,
const string &  ais 
)
throw (AISDatabaseReadFailed
)

Build an AISConnect. This calls Connect's constructor with name and accepts its default values for the other parameters. The AIS is initialized to use the database named by ais.

Parameters
nameCreate a virtual, AIS-enhanced, connection for this OPeNDAP data source.
aisRead the AIS information from this XML file.
Exceptions
AISDatabaseReadFailedThrown if the AIS database listed in the ~/.dodsrc file could not be opened.

Definition at line 57 of file AISConnect.cc.

◆ ~AISConnect()

libdap::AISConnect::~AISConnect ( )
virtual

Destroy an AISConnect.

Definition at line 65 of file AISConnect.cc.

Member Function Documentation

◆ CE()

string libdap::Connect::CE ( )
virtualinherited

Get the Connect's constraint expression.

Return the constraint expression (CE) part of the Connect URL. Note that this CE is supplied as part of the URL passed to the Connect's constructor. It is not the CE passed to the request_data() function.

Returns
A string containing the constraint expression (if any) submitted to the Connect object's constructor.

Definition at line 1146 of file Connect.cc.

◆ get_protocol()

string libdap::Connect::get_protocol ( )
inlineinherited

Return the DAP protocol version of the most recent response. Before a response is made, this contains the string "2.0."

Definition at line 193 of file Connect.h.

◆ get_version()

string libdap::Connect::get_version ( )
inlineinherited

Return the protocol/implementation version of the most recent response. This is a poorly designed method, but it returns information that is useful when used correctly. Before a response is made, this contains the string "unknown." This should ultimately hold the protocol version; it currently holds the implementation version.

@see get_protocol()
Deprecated:

Definition at line 185 of file Connect.h.

◆ read_data()

void libdap::Connect::read_data ( DataDDS data,
Response rs 
)
virtualinherited

Read data which is preceded by MIME headers. This method works for both data dds and data ddx responses.

Note
If you need the DataDDS to hold specializations of the type classes, be sure to include the factory class which will instantiate those specializations in the DataDDS. Either pass a pointer to the factory to DataDDS constructor or use the DDS::set_factory() method after the object is built.
See also
read_data_no_mime()
Parameters
dataResult.
rsRead from this Response object.

Definition at line 989 of file Connect.cc.

◆ read_data_no_mime()

void libdap::Connect::read_data_no_mime ( DataDDS data,
Response rs 
)
virtualinherited

Read data from a file which does not have response MIME headers. This method is a companion to read_data(). While read_data() assumes that the response has MIME headers, this method does not. If you call this with a Response that does contain headers, it will throw an Error (and the message is likely to be inscrutable).

Note
This method will use the 'type' information in the Response object to choose between processing the response as a data dds or data ddx. If there is no type information, it will attempt to figure it out.
Parameters
dataResult.
rsRead from this Response object.

Definition at line 1062 of file Connect.cc.

◆ request_das()

void libdap::AISConnect::request_das ( DAS das)
virtual

Request an AIS-enhanced DAS object. Read the DAS object for this virtual connection's data source. Then check the AIS database and merge in any ancillary resources listed for it.

Parameters
dasDeposit information to this object.
Exceptions
ErrorThrown if the DAS request fails due to user error.
InternalErrThrown if either the DAS request or the AIS merge request fails.

Reimplemented from libdap::Connect.

Definition at line 79 of file AISConnect.cc.

◆ request_das_url()

void libdap::Connect::request_das_url ( DAS das)
virtualinherited

Get the DAS from a server.

Reads the DAS corresponding to the dataset in the Connect object's URL. Although DAP does not support using CEs with DAS requests, if present in the Connect object's instance, they will be escaped and passed as the query string of the request.

Different from request_das method in that this method uses the URL as given without attaching .das or projections or selections.

Parameters
dasResult.

Definition at line 496 of file Connect.cc.

◆ request_data()

void libdap::Connect::request_data ( DataDDS data,
string  expr = "" 
)
virtualinherited

Get the DAS from a server.

Reads the DataDDS object corresponding to the dataset in the Connect object's URL. If present in the Connect object's instance, a CE will be escaped, combined with expr and passed as the query string of the request. The result is a DataDDS which contains the data values bound to variables.

Note
If you need the DataDDS to hold specializations of the type classes, be sure to include the factory class which will instantiate those specializations in the DataDDS. Either pass a pointer to the factory to DataDDS constructor or use the DDS::set_factory() method after the object is built.
Parameters
dataResult.
exprSend this constraint expression to the server.

Definition at line 845 of file Connect.cc.

◆ request_data_url()

void libdap::Connect::request_data_url ( DataDDS data)
virtualinherited

Get the DAS from a server.

Reads the DataDDS object corresponding to the dataset in the Connect object's URL. If present in the Connect object's instance, a CE will be escaped, combined with expr and passed as the query string of the request. The result is a DataDDS which contains the data values bound to variables.

Different from request_data in that this method uses the syntax of the new OPeNDAP server commands using dispatch

Note
If you need the DataDDS to hold specializations of the type classes, be sure to include the factory class which will instantiate those specializations in the DataDDS. Either pass a pointer to the factory to DataDDS constructor or use the DDS::set_factory() method after the object is built.
Parameters
dataResult.

Definition at line 896 of file Connect.cc.

◆ request_dds()

void libdap::Connect::request_dds ( DDS dds,
string  expr = "" 
)
virtualinherited

Get the DDS from a server.

Reads the DDS corresponding to the dataset in the Connect object's URL. If present in the Connect object's instance, a CE will be escaped, combined with expr and passed as the query string of the request.

Note
If you need the DDS to hold specializations of the type classes, be sure to include the factory class which will instantiate those specializations in the DDS. Either pass a pointer to the factory to DDS constructor or use the DDS::set_factory() method after the object is built.
Parameters
ddsResult.
exprSend this constraint expression to the server.

Definition at line 562 of file Connect.cc.

◆ request_dds_url()

void libdap::Connect::request_dds_url ( DDS dds)
virtualinherited

Get the DDS from a server.

Reads the DDS corresponding to the dataset in the Connect object's URL. If present in the Connect object's instance, a CE will be escaped, combined with expr and passed as the query string of the request.

Different from request_dds method above in that this method assumes URL is complete and does not add anything to the command, such as .dds or projections or selections.

Note
If you need the DDS to hold specializations of the type classes, be sure to include the factory class which will instantiate those specializations in the DDS. Either pass a pointer to the factory to DDS constructor or use the DDS::set_factory() method after the object is built.
Parameters
ddsResult.

Definition at line 642 of file Connect.cc.

◆ request_ddx()

void libdap::Connect::request_ddx ( DDS dds,
string  expr = "" 
)
virtualinherited

Get the DDX from a server.

Reads the DDX corresponding to the dataset in the Connect object's URL. If present in the Connect object's instance, a CE will be escaped, combined with expr and passed as the query string of the request.

Note
A DDX is represented as XML on the wire but in memory libdap uses a DDS object with variables that hold their own attributes (the DDS itself holds the global attributes).
Parameters
ddsResult.
exprSend this constraint expression to the server.

Definition at line 705 of file Connect.cc.

◆ request_ddx_url()

void libdap::Connect::request_ddx_url ( DDS dds)
virtualinherited

The 'url' version of request_ddx.

See also
Connect::request_ddx.

Definition at line 773 of file Connect.cc.

◆ request_protocol()

string libdap::Connect::request_protocol ( )
virtualinherited

Get protocol version information from the server. This is a new method which will ease the transition to DAP 4. Note that this method returns the version of the DAP protocol implemented by the server. The request_version() method returns the server's version number, not the DAP protocol version.

Note
This method actually asks the server for the protocol version - use get_protocol() to get the protocol information from the most recent response (e.g., from the last DDX response returned by the server).
Returns
The DAP protocol version string.

Definition at line 398 of file Connect.cc.

◆ request_version()

string libdap::Connect::request_version ( )
virtualinherited

Get version information from the server. This is a new method which will ease the transition to DAP 4.

Note
Use request_protocol() to get the DAP protocol version.
Returns
The DAP version string.
See also
request_protocol()

Definition at line 362 of file Connect.cc.

◆ set_accept_deflate()

void libdap::Connect::set_accept_deflate ( bool  deflate)
inherited

Set the accept deflate property.

Parameters
deflateTrue if the client can accept compressed responses, False otherwise.

Definition at line 1168 of file Connect.cc.

◆ set_cache_enabled()

void libdap::Connect::set_cache_enabled ( bool  cache)
inherited

Disable any further use of the client-side cache. In a future version of this software, this should be handled so that the www library is not initialized with the cache running by default.

Definition at line 1188 of file Connect.cc.

◆ set_credentials()

void libdap::Connect::set_credentials ( string  u,
string  p 
)
inherited

Set the credentials for responding to challenges while dereferencing URLs.

Parameters
uThe username.
pThe password.
See also
extract_auth_info()

Definition at line 1159 of file Connect.cc.

◆ set_xdap_protocol()

void libdap::Connect::set_xdap_protocol ( int  major,
int  minor 
)
inherited

Set the XDAP-Accept property/header. This is used to send to a server the (highest) DAP protocol version number that this client understands.

Parameters
majorThe client dap protocol major version
minorThe client dap protocol minor version

Definition at line 1179 of file Connect.cc.

◆ URL()

string libdap::Connect::URL ( bool  ce = true)
virtualinherited

Get the object's URL.

Return the Connect object's URL in a string. The URL was set by the class constructor, and may not be reset. If you want to open another URL, you must create another Connect object. There is a Connections class created to handle the management of multiple Connect objects.

See also
Connections
Returns
A string containing the URL of the data to which the Connect object refers. If the object refers to local data, the function returns the null string.
Parameters
ceIf TRUE, the returned URL will include any constraint expression enclosed with the Connect object's URL (including the ?). If FALSE, any constraint expression will be removed from the URL. The default is TRUE.

Definition at line 1127 of file Connect.cc.


The documentation for this class was generated from the following files: