BESContainerStorageCatalog Class Reference

implementation of BESContainerStorage that represents a regular expression means of determining a data type. More...

#include <BESContainerStorageCatalog.h>

Inheritance diagram for BESContainerStorageCatalog:

Inheritance graph
[legend]
Collaboration diagram for BESContainerStorageCatalog:

Collaboration graph
[legend]
List of all members.

Public Types

typedef map< string, BESContainer
* >::const_iterator 
Container_citer
typedef map< string, BESContainer
* >::iterator 
Container_iter

Public Member Functions

 BESContainerStorageCatalog (const string &n)
 create an instance of this persistent store with the given name.
virtual ~BESContainerStorageCatalog ()
virtual void add_container (const string &s_name, const string &r_name, const string &type)
 adds a container with the provided information
bool isData (const string &inQuestion, list< string > &provides)
 is the specified node in question served by a request handler
virtual void dump (ostream &strm) const
 dumps information about this object
virtual void look_for (BESContainer &d)
 looks for the specified container using the given name
virtual bool del_container (const string &s_name)
 removes a container with the given symbolic name
virtual bool del_containers ()
 removes all container
virtual void show_containers (BESInfo &info)
 show information for each container in this persistent store
virtual const string & get_name () const
 retrieve the name of this persistent store

Protected Attributes

string _root_dir
string _my_name

Detailed Description

implementation of BESContainerStorage that represents a regular expression means of determining a data type.

When a container is added to this container storage, the file extension is used to determine the type of data using a set of regular expressions. The regular expressions are retrieved from the BES initialization file using TheBESKeys. It also gets the root directory for where the files exist. This way, the user need not know the root directory or the type of data represented by the file.

Catalog.<name>.RootDirectory is the key representing the base directory where the files are physically located. The real_name of the container is determined by concatenating the file name to the base directory.

Catalog.<name>.TypeMatch is the key representing the regular expressions. This key is formatted as follows:

<data type>:<reg exp>;<data type>:<reg exp>;

For example: cedar:cedar\/.*\.cbf;cdf:cdf\/.*\.cdf;

The first would match anything that might look like: cedar/datfile01.cbf

<name> is the name of this container storage, so you could have multiple container stores using regular expressions.

The containers are stored in a volatile list.

See also:
BESContainerStorage

BESContainer

BESKeys

Definition at line 77 of file BESContainerStorageCatalog.h.


Member Typedef Documentation

typedef map< string, BESContainer * >::const_iterator BESContainerStorageVolatile::Container_citer [inherited]

Definition at line 67 of file BESContainerStorageVolatile.h.

typedef map< string, BESContainer * >::iterator BESContainerStorageVolatile::Container_iter [inherited]

Definition at line 68 of file BESContainerStorageVolatile.h.


Constructor & Destructor Documentation

BESContainerStorageCatalog::BESContainerStorageCatalog ( const string &  n  ) 

create an instance of this persistent store with the given name.

Creates an instances of BESContainerStorageCatalog with the given name. Looks up the base directory and regular expressions in the dods initialization file using TheBESKeys. THrows an exception if either of these cannot be determined or if the regular expressions are incorrectly formed.

<data type>:<reg exp>;<data type>:<reg exp>;

each type/reg expression pair is separated by a semicolon and ends with a semicolon. The data type/expression pair itself is separated by a semicolon.

Parameters:
n name of this persistent store
Exceptions:
BESContainerStorageException if unable to find the base directory or regular expressions in the dods initialization file. Also thrown if the type matching expressions are malformed.
See also:
BESKeys

BESContainer

Definition at line 61 of file BESContainerStorageCatalog.cc.

References BESContainerStorageVolatile::_root_dir, BESException::get_file(), BESException::get_line(), BESException::get_message(), BESCatalogUtils::get_root_dir(), and BESCatalogUtils::Utils().

Here is the call graph for this function:

BESContainerStorageCatalog::~BESContainerStorageCatalog (  )  [virtual]

Definition at line 75 of file BESContainerStorageCatalog.cc.


Member Function Documentation

void BESContainerStorageCatalog::add_container ( const string &  s_name,
const string &  r_name,
const string &  type 
) [virtual]

adds a container with the provided information

If a match is made with the real name passed then the type is set.

The real name of the container (the file name) is constructed using the root directory from the initialization file with the passed real name appended to it.

The information is then passed to the add_container method in the parent class.

Parameters:
s_name symbolic name for the container
r_name real name (full path to the file) for the container
type type of data represented by this container

Reimplemented from BESContainerStorageVolatile.

Definition at line 95 of file BESContainerStorageCatalog.cc.

References BESContainerStorageVolatile::add_container(), BESCatalogUtils::exclude(), BESCatalogUtils::include(), BESCatalogUtils::match_list_begin(), and BESCatalogUtils::match_list_end().

Here is the call graph for this function:

bool BESContainerStorageCatalog::isData ( const string &  inQuestion,
list< string > &  provides 
)

is the specified node in question served by a request handler

Determine if the node in question is served by a request handler (provides data) and what the request handler serves for the node

Parameters:
inQuestion node to look up
provides what is provided for the node by the node types request handler return true if a request hanlder serves the specified node, false otherwise

Definition at line 162 of file BESContainerStorageCatalog.cc.

References BESCatalogUtils::match_list_begin(), and BESCatalogUtils::match_list_end().

Here is the call graph for this function:

void BESContainerStorageCatalog::dump ( ostream &  strm  )  const [virtual]

dumps information about this object

Displays the pointer value of this instance along with information about the "storage" of containers in a catalog.

Parameters:
strm C++ i/o stream to dump the information to

Reimplemented from BESContainerStorageVolatile.

Definition at line 195 of file BESContainerStorageCatalog.cc.

References BESCatalogUtils::dump(), BESContainerStorage::get_name(), BESIndent::Indent(), BESIndent::LMarg(), and BESIndent::UnIndent().

Here is the call graph for this function:

void BESContainerStorageVolatile::look_for ( BESContainer d  )  [virtual, inherited]

looks for the specified container using the given name

If a match is made with the symbolic name found in the container then the information is stored in the passed container object and the is_valid flag is set to true. If not found, then is_valid is set to false.

Parameters:
d container to look for and, if found, store the information in.

Implements BESContainerStorage.

Definition at line 72 of file BESContainerStorageVolatile.cc.

References BESContainer::get_symbolic_name(), BESContainer::set_container_type(), BESContainer::set_real_name(), and BESContainer::set_valid_flag().

Referenced by pvolT::run().

Here is the call graph for this function:

bool BESContainerStorageVolatile::del_container ( const string &  s_name  )  [virtual, inherited]

removes a container with the given symbolic name

This method removes a container to the persistence store with the given symbolic name. It deletes the container.

Parameters:
s_name symbolic name for the container
Returns:
true if successfully removed and false otherwise

Implements BESContainerStorage.

Definition at line 134 of file BESContainerStorageVolatile.cc.

Referenced by pvolT::run().

bool BESContainerStorageVolatile::del_containers (  )  [virtual, inherited]

removes all container

This method removes all containers from the persistent store. It does not delete the real data behind the container.

Returns:
true if successfully removed and false otherwise

Implements BESContainerStorage.

Definition at line 157 of file BESContainerStorageVolatile.cc.

void BESContainerStorageVolatile::show_containers ( BESInfo info  )  [virtual, inherited]

show information for each container in this persistent store

For each container in this persistent store, add infomation about each of those containers. The information added to the information object includes a line for each container within this persistent store which includes the symbolic name, the real name, and the data type, separated by commas.

In the case of this persistent store information from each container added to the volatile list is added to the information object.

Parameters:
info object to store the container and persistent store information
See also:
BESInfo

Implements BESContainerStorage.

Definition at line 187 of file BESContainerStorageVolatile.cc.

References BESInfo::add_tag(), BESInfo::begin_tag(), BESInfo::end_tag(), BESContainer::get_container_type(), BESContainerStorage::get_name(), BESContainer::get_real_name(), and BESContainer::get_symbolic_name().

Referenced by pvolT::run().

Here is the call graph for this function:

virtual const string& BESContainerStorage::get_name (  )  const [inline, virtual, inherited]

retrieve the name of this persistent store

Returns:
name of this persistent store.

Definition at line 86 of file BESContainerStorage.h.

References BESContainerStorage::_my_name.

Referenced by BESContainerStorageList::add_persistence(), BESContainerStorageVolatile::dump(), BESContainerStorageFile::dump(), dump(), BESContainerStorageVolatile::show_containers(), and BESContainerStorageFile::show_containers().


Member Data Documentation

string BESContainerStorageVolatile::_root_dir [protected, inherited]

Definition at line 62 of file BESContainerStorageVolatile.h.

Referenced by BESContainerStorageVolatile::add_container(), BESContainerStorageCatalog(), and BESContainerStorageVolatile::BESContainerStorageVolatile().

string BESContainerStorage::_my_name [protected, inherited]

Definition at line 69 of file BESContainerStorage.h.

Referenced by BESContainerStorage::get_name().


The documentation for this class was generated from the following files:
Generated on Wed Aug 29 03:23:31 2007 for OPeNDAP Back End Server (BES) by  doxygen 1.5.2