bes  Updated for version 3.17.4
BESContainerStorageList Class Reference

Provides a mechanism for accessing container information from different container stores registered with this server. More...

#include <BESContainerStorageList.h>

Inheritance diagram for BESContainerStorageList:
Inheritance graph

Public Member Functions

virtual bool add_persistence (BESContainerStorage *p)
 Add a persistent store to the list. More...
 
virtual bool deref_persistence (const string &persist_name)
 dereference a persistent store in the list. More...
 
virtual void dump (ostream &strm) const
 dumps information about this object More...
 
virtual BESContainerStoragefind_persistence (const string &persist_name)
 find the persistence store with the given name More...
 
virtual bool isnice ()
 
virtual BESContainerlook_for (const string &sym_name)
 look for the specified container information in the list of persistent stores. More...
 
virtual bool ref_persistence (const string &persist_name)
 refence the specified persistent store if in the list More...
 
virtual void show_containers (BESInfo &info)
 show information for each container in each persistence store More...
 

Static Public Member Functions

static BESContainerStorageListTheList ()
 

Detailed Description

This class provides a mechanism for users to access container information from different container stores, such as from a MySQL database, a file, or volatile stores.

Users can add different BESContainerStorage instances to this persistent list. Then, when a user looks for a symbolic name, that search goes through the list of persistent stores in order.

If the symbolic name is not found then a flag is checked to determine whether to simply log the fact that the symbolic name was not found, or to throw an exception of type BESContainerStorageException.

See also
BESContainerStorage
BESContainer
BESContainerStorageException

Definition at line 67 of file BESContainerStorageList.h.

Member Function Documentation

◆ add_persistence()

bool BESContainerStorageList::add_persistence ( BESContainerStorage cp)
virtual

Each persistent store has a name. If a persistent store already exists in the list with that name then the persistent store is not added. Otherwise the store is added to the list.

The persistent stores are searched in the order in which they were added.

Parameters
cppersistent store to add to the list
Returns
true if successfully added, false otherwise
See also
BESContainerStorage

Definition at line 77 of file BESContainerStorageList.cc.

References BESContainerStorage::get_name().

◆ deref_persistence()

bool BESContainerStorageList::deref_persistence ( const string &  persist_name)
virtual

de-reference the names persistent store. If found, the reference on the catalog is decremented and true is returned. If the reference reaches zero then the catalog is removed. If not found then false is returned.

Parameters
persist_namename of the persistent store to be de-referenced
Returns
true if successfully de-referenced, false otherwise
See also
BESContainerStorage

Definition at line 159 of file BESContainerStorageList.cc.

◆ dump()

void BESContainerStorageList::dump ( ostream &  strm) const
virtual

Displays the pointer value of this instance along with information about the container storage objects stored in this list.

Parameters
strmC++ i/o stream to dump the information to

Implements BESObj.

Definition at line 332 of file BESContainerStorageList.cc.

◆ find_persistence()

BESContainerStorage * BESContainerStorageList::find_persistence ( const string &  persist_name)
virtual

Returns the persistence store with the given name

Parameters
persist_namename of the persistent store to be found
Returns
the persistence store BESContainerStorage
See also
BESContainerStorage

Definition at line 208 of file BESContainerStorageList.cc.

◆ look_for()

BESContainer * BESContainerStorageList::look_for ( const string &  sym_name)
virtual

Look for the container with the specified symbolic name in the BESContainerStorage instances. The first to find it wins.

If the container information is not found then, depending on the value of the key BES.Container.Persistence in the bes configuration file, an exception is thrown or it is logged to the bes log file that it was not found. If the key is set to Nice, nice, or NICE then information is logged to the bes log file stating that the container information was not found.

Parameters
sym_namesymbolic name of the container to look for
Returns
a new instances of BESContainer if found, else 0. The caller owns the returned container and is responsible for deleting cleaning
Exceptions
BESSyntaxUserErrorif container not found and strict set in the bes configuration file for BES.Container.Persistence
See also
BESContainerStorage
BESContainer
BESKeys
BESLog
BESSyntaxUserError

Definition at line 268 of file BESContainerStorageList.cc.

◆ ref_persistence()

bool BESContainerStorageList::ref_persistence ( const string &  persist_name)
virtual

Increments the reference count of the persistent store in the list. This lets the system know that there is a module that is referencing the specified catalog

Parameters
persist_namename of the persistent store to be referenced
Returns
true if successfully referenced, false otherwise
See also
BESContainerStorage

Definition at line 123 of file BESContainerStorageList.cc.

◆ show_containers()

void BESContainerStorageList::show_containers ( BESInfo info)
virtual

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

Parameters
infoobject to store the container and persistent store information
See also
BESInfo

Definition at line 312 of file BESContainerStorageList.cc.


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