AISMerge Class Reference

Merge AIS resources. More...

#include <AISMerge.h>

Collaboration diagram for AISMerge:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 AISMerge (const string &database) throw (AISDatabaseReadFailed)
virtual Responseget_ais_resource (const string &res)
virtual void merge (const string &primary, DAS &das)
virtual ~AISMerge ()

Friends

class AISMergeTest

Detailed Description

Manage a single AIS database. Open an AIS database and handle merging DAP objects with the ancillary resources it references. This class uses AISResources to actually open the AIS database and locate AIS resources for a particular primary data source. This class dereferences AIS resources returned by AISResources and merges that with an existing DAP object (currently only the DAS object is supported. 02/25/03 jhrg).

Definition at line 61 of file AISMerge.h.


Constructor & Destructor Documentation

AISMerge::AISMerge ( const string &  database  )  throw (AISDatabaseReadFailed) [inline]

Initialize an instance so that it reads from database.

Parameters:
database Name of a database of AIS resources.
Exceptions:
AISDatabaseReadFailed Thrown if the named database cannot be opened.

Definition at line 73 of file AISMerge.h.

virtual AISMerge::~AISMerge (  )  [inline, virtual]

Destroy an instance. This is explicitly declared virtual to support subclassing.

Definition at line 79 of file AISMerge.h.


Member Function Documentation

Response * AISMerge::get_ais_resource ( const string &  res  )  [virtual]

Access an AIS resource. The resource may be a local file or a URL. Assume all resource URIs have no leading spaces. This method is public so that a client of libdap++ can specialize its behavior. This implementation dereferences a URL or opens a file and returns a FILE pointer which can be used to read the contents. In the case of a URL, 'the contents' means the body of the HTTP response. For a file, it means the entire file.

Parameters:
res The AIS resource.
Returns:
Either an open FILE * which points to the resource or null if the resource could not be opened. This method does not throw an exception for resources that cannot be opened because that can happen for a number of reasons which are hardly 'exceptional.'

Definition at line 48 of file AISMerge.cc.

References HTTPConnect::fetch_url().

Referenced by merge().

Here is the call graph for this function:

void AISMerge::merge ( const string &  primary,
DAS das 
) [virtual]

Access the AIS ancillary resources matched to primary and merge those with the DAS object das.

This method uses AISResources::has_resource(...) to determine if primary has an entry in the AIS database. It uses AISResources::get_resource(...) to get a ResourceVector of AIS resources for primary. It then uses its own get_ais_resources(...) to access the actual resources via a FILE pointer. Clients may use this information to specialize AISMerge::merge(...).

Parameters:
primary The URL of the primary resource.
das The target of the merge operation. This must already contain the DAS for primary.

Definition at line 76 of file AISMerge.cc.

References AttrTable::erase(), Resource::fallback, get_ais_resource(), Error::get_error_message(), AISResources::get_resource(), AttrTable::get_size(), AISResources::has_resource(), Resource::overwrite, DAS::parse(), and Resource::replace.

Referenced by AISConnect::request_das().

Here is the call graph for this function:


Friends And Related Function Documentation

friend class AISMergeTest [friend]

Definition at line 67 of file AISMerge.h.


The documentation for this class was generated from the following files:
Generated on Wed Jun 27 12:57:21 2007 for libdap++ by  doxygen 1.4.7