Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

CdbBdbProxyCache Class Reference

The persistent cache management on behalf of the Condition/DB proxies. More...

#include <CdbBdbProxyCache.hh>

Inheritance diagram for CdbBdbProxyCache:

CdbBdbProxyBase< T > CdbBdbProxyBase< CdbCPtr< CdbNTuple< T, NCOL > > > CdbBdbProxyBase< SimpleProxyProduct > CdbBdbEnvProxy< T, P > CdbBdbProxyBaseUsingRevision< T > CdbBdbNTupleProxy< T, NCOL > CdbBdbProxyBaseUsingRevision< SimpleProxyProduct > SimpleProxy SimpleProxyUsingRevision List of all members.

Protected Member Functions

 CdbBdbProxyCache (const char *theFullConditionPath=0)
 The normal and default constructor.

virtual ~CdbBdbProxyCache ()
 The destructor.

void subscribeCondition (const char *theFullPath)
 Add condition to the cache.

void subscribeCondition (const std::string &theFullPath)
void unSubscribeCondition (const char *theFullPath)
 Remove occurances of specified element from the cache.

void unSubscribeCondition (const std::string &theFullPath)
void unSubscribeAllConditions ()
 Remove all elements from the cache.

bool isCacheValid (const BdbTime &theValidityTime) const
 Test if the cache is valid.

CdbStatus updateCache (const BdbTime &theValidityTime, const CdbStateId &theStateId, std::vector< CdbBdbProxyElement > &theListOfElements)
 Update the cache.

CdbStatus updateCache (const BdbTime &theValidityTime, const char *theRevisionName, unsigned int thePartitionId, std::vector< CdbBdbProxyElement > &theListOfElements)
 Update the cache (using explicitly specified revision & partition).

void invalidatePersistentCacheAll ()
 Invalidate the persistent cache of the proxy (all elements).

CdbStatus invalidatePersistentCache (const char *theFullPath)
 Invalidate the persistent cache of the proxy (specified element only).

CdbStatus invalidatePersistentCache (const std::string &theFullPath)

Friends

class CdbRTestUtility

Detailed Description

The persistent cache management on behalf of the Condition/DB proxies.

The class hides the actual operations with the persistent store.

Definition at line 20 of file CdbBdbProxyCache.hh.


Constructor & Destructor Documentation

CdbBdbProxyCache::CdbBdbProxyCache const char *    theFullConditionPath = 0 [explicit, protected]
 

The normal and default constructor.

The only argument of the constructor takes the full path name of a condition managed by the current class. More elements can be added later by calling the "::addToCache()" method

Definition at line 27 of file CdbBdbProxyCache.cc.

CdbBdbProxyCache::~CdbBdbProxyCache   [protected, virtual]
 

The destructor.

Definition at line 38 of file CdbBdbProxyCache.cc.


Member Function Documentation

CdbStatus CdbBdbProxyCache::invalidatePersistentCache const std::string &    theFullPath [protected]
 

Definition at line 126 of file CdbBdbProxyCache.cc.

References CdbStatus::NotFound, and CdbStatus::Success.

CdbStatus CdbBdbProxyCache::invalidatePersistentCache const char *    theFullPath [protected]
 

Invalidate the persistent cache of the proxy (specified element only).

These methods will locate and invalidate the cache for specified condition only. If teh condition is found then CdbStatus::Success status value will be returned. If not - CdbStatus::NotFound.

Definition at line 120 of file CdbBdbProxyCache.cc.

void CdbBdbProxyCache::invalidatePersistentCacheAll   [protected]
 

Invalidate the persistent cache of the proxy (all elements).

Definition at line 107 of file CdbBdbProxyCache.cc.

bool CdbBdbProxyCache::isCacheValid const BdbTime   theValidityTime const [protected]
 

Test if the cache is valid.

The cache is valid if all its elements are valid, which means that (1) the specified time fits into validity intervals of all managed conditions, and (2) the corresponding persistent references are not 0-0-0-0 ones.

NOTE: The cache is still valid if there is no elements in it.

Definition at line 84 of file CdbBdbProxyCache.cc.

Referenced by CdbBdbProxyBaseUsingRevision< T >::faultHandler(), and CdbBdbProxyBase< T >::faultHandler().

void CdbBdbProxyCache::subscribeCondition const std::string &    theFullPath [protected]
 

Definition at line 54 of file CdbBdbProxyCache.cc.

References subscribeCondition().

void CdbBdbProxyCache::subscribeCondition const char *    theFullPath [protected]
 

Add condition to the cache.

This method does not check if the passed name is unique in the cache scope. The corresponding cache element will put into non-invalid state.

Definition at line 42 of file CdbBdbProxyCache.cc.

Referenced by CdbBdbEnvProxy< T, P >::CdbBdbEnvProxy(), CdbBdbNTupleProxy< T, NCOL >::CdbBdbNTupleProxy(), SimpleProxy::SimpleProxy(), SimpleProxyUsingRevision::SimpleProxyUsingRevision(), and subscribeCondition().

void CdbBdbProxyCache::unSubscribeAllConditions   [protected]
 

Remove all elements from the cache.

Definition at line 78 of file CdbBdbProxyCache.cc.

void CdbBdbProxyCache::unSubscribeCondition const std::string &    theFullPath [protected]
 

Definition at line 67 of file CdbBdbProxyCache.cc.

void CdbBdbProxyCache::unSubscribeCondition const char *    theFullPath [protected]
 

Remove occurances of specified element from the cache.

The method will remove all occurances (if any) of specified condition from the cache. The absense of conditions with specified name in the cache does not trigger any problems.

Definition at line 61 of file CdbBdbProxyCache.cc.

CdbStatus CdbBdbProxyCache::updateCache const BdbTime   theValidityTime,
const char *    theRevisionName,
unsigned int    thePartitionId,
std::vector< CdbBdbProxyElement > &    theListOfElements
[protected]
 

Update the cache (using explicitly specified revision & partition).

This operation is similar to the previous one, except it will attempt to use the specified revision and partition when looking for objects.

Definition at line 242 of file CdbBdbProxyCache.cc.

References CdbStatus::Error, CdbStatus::IllegalParameters, CdbCondition::instance(), CdbBdbObjectConvertor::narrow(), and CdbStatus::Success.

CdbStatus CdbBdbProxyCache::updateCache const BdbTime   theValidityTime,
const CdbStateId   theStateId,
std::vector< CdbBdbProxyElement > &    theListOfElements
[protected]
 

Update the cache.

This operation will refresh the objects and validity intervals of managed conditions from the persistent store. The transaction will be started/commited if required.

Upon its successfull completion the method will set up an array with information about cached elements, including their intervals of validity.

The method returns "CdbStatus::Success" if operation was successfull.

Definition at line 143 of file CdbBdbProxyCache.cc.

References CdbStatus::Error, CdbCondition::instance(), CdbBdbObjectConvertor::narrow(), and CdbStatus::Success.

Referenced by CdbBdbProxyBaseUsingRevision< T >::faultHandler(), and CdbBdbProxyBase< T >::faultHandler().


Friends And Related Function Documentation

friend class CdbRTestUtility [friend]
 

Reimplemented in CdbBdbProxyBase< T >, CdbBdbProxyBase< SimpleProxyProduct >, and CdbBdbProxyBase< CdbCPtr< CdbNTuple< T, NCOL > > >.

Definition at line 151 of file CdbBdbProxyCache.hh.


The documentation for this class was generated from the following files:
Generated on Mon Dec 5 18:22:18 2005 for CDB by doxygen1.3-rc3