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

CdbEnvironment Class Reference

The configuration options of the Conditions/DB API. More...

#include <CdbEnvironment.hh>

List of all members.

Static Public Member Functions

int setDebugMode (int newMode=0)
 Set the current value of the "DEBUG LEVEL".

int getDebugMode ()
 Get the current value of the "DEBUG LEVEL".

CdbStateId defaultStateId (const BdbTime &theValidityTime)
 Get default value of the state identifier.

BdbTime getTruncateTime ()
 Get the current value of the "truncate" time.

BdbTime setTruncateTime (const BdbTime &theNewTruncateTime)
 Set the new value of the "truncate" time.

std::string defaultTechnology ()
 Get default technology name.

std::string defaultImplementation (const char *theTechnologyName)
 Get default implementation name.

std::string defaultDatabase (const char *theTechnologyName, const char *theImplementationName)
 Get default database name.

std::string defaultView (const char *theTechnologyName, const char *theImplementationName, const char *theDatabaseName)
 Get default view name.

void setDefault (const char *theTechnologyName, const char *theImplementationName, const char *theDatabaseName, const char *theViewName)
 Set a combination of default parameters.

CdbStatus getDefaultTechnology (std::string &theTechnologyName)
 Get default technology name.

CdbStatus getDefaultImplementation (std::string &theImplementationName, const char *theTechnologyName=0)
 Get default implementation name.

CdbStatus getDefaultDatabase (std::string &theDatabaseName, const char *theImplementationName=0, const char *theTechnologyName=0)
 Get default database name.

CdbStatus getDefaultView (std::string &theViewName, const char *theDatabaseName=0, const char *theImplementationName=0, const char *theTechnologyName=0)
 Get default view name.

CdbStatus getDefaultPath (std::string &theViewName, std::string &theDatabaseName, std::string &theImplementationName, std::string &theTechnologyName)
 Get all defaults.

CdbStatus setDefaultTechnology (const char *theTechnologyName)
 Set default technology.

CdbStatus setDefaultImplementation (const char *theImplementationName, const char *theTechnologyName=0)
 Set default implementation.

CdbStatus setDefaultDatabase (const char *theDatabaseName, const char *theImplementationName=0, const char *theTechnologyName=0)
 Set default database.

CdbStatus setDefaultView (const char *theViewName, const char *theDatabaseName=0, const char *theImplementationName=0, const char *theTechnologyName=0)
 Set default view.

CdbStatus setDefaultPath (const char *theViewName, const char *theDatabaseName, const char *theImplementationName, const char *theTechnologyName)
 Set all defaults to specified path.

CdbAnyTypeDict< std::string > & extra ()
 Access a dictionary of extra parameters.


Friends

class Cdb


Detailed Description

The configuration options of the Conditions/DB API.

This utility class provides global control options in the scope of an application process.

NOTE: Most of the operations provided by this class may involve interraction with a persistent store(s).

DESIGN NOTE: The design of this class is based on the 'PIMPL' idiom to introduce the compilation firewall between clients of this utility class and its actual "back-end" implementation

Definition at line 29 of file CdbEnvironment.hh.


Member Function Documentation

std::string CdbEnvironment::defaultDatabase const char *    theTechnologyName,
const char *    theImplementationName
[static]
 

Get default database name.

Returns an empty string if there is no information for specified combination of parameters values.

Definition at line 95 of file CdbEnvironment.cc.

References CdbEnvironmentImpl::getDefaultDatabase().

Referenced by CdbRooInit::beginJob(), and CdbBdbInit::beginJob().

std::string CdbEnvironment::defaultImplementation const char *    theTechnologyName [static]
 

Get default implementation name.

Returns an empty string if there is no information for specified combination of parameters values.

NOTE: This is an obsolete method to be removed soon.

Definition at line 83 of file CdbEnvironment.cc.

References CdbEnvironmentImpl::getDefaultImplementation().

Referenced by CdbRooInit::beginJob(), and CdbBdbInit::beginJob().

CdbStateId CdbEnvironment::defaultStateId const BdbTime   theValidityTime [static]
 

Get default value of the state identifier.

The method delivers a value of the identifier calculated in the scope of he current default environment. The only explicit parameter of the method is a point of time in the validity dimension, in which the identifier is requested.

The returned identifier will be "invalid" should any problem occures to construct (calculate) the identifier.

See also:
CdbStateId
Returns:
a value of the identifier.

Definition at line 46 of file CdbEnvironment.cc.

References CdbView::instance(), and CdbStatus::Success.

std::string CdbEnvironment::defaultTechnology   [static]
 

Get default technology name.

NOTE: This is an obsolete method to be removed soon.

Definition at line 72 of file CdbEnvironment.cc.

References CdbEnvironmentImpl::getDefaultTechnology().

Referenced by CdbRooInit::beginJob(), and CdbBdbInit::beginJob().

std::string CdbEnvironment::defaultView const char *    theTechnologyName,
const char *    theImplementationName,
const char *    theDatabaseName
[static]
 

Get default view name.

Returns an empty string if there is no information for specified combination of parameters values.

NOTE: This is an obsolete method to be removed soon.

Definition at line 109 of file CdbEnvironment.cc.

References CdbEnvironmentImpl::getDefaultView().

Referenced by CdbRooInit::beginJob(), CdbBdbInit::beginJob(), CdbSQLApiDatabase::defaultView(), CdbRooRoDatabase::defaultView(), CdbBdbWDatabase::defaultView(), and CdbBdbSDatabase::defaultView().

CdbAnyTypeDict< std::string > & CdbEnvironment::extra   [static]
 

Access a dictionary of extra parameters.

The dictionary is meant to be used to pass optional parameters to technology specific implementations of the CDB API. The "environment" makes no separation between the API's implementations.

Here is a suggested format for technology-specific parameters:

//

For example, if we had a hypothetical implementation of the CDB API storing plain text strings in a relational database then we could control a client size cache by mean of this parameter:

"Text/SQL/max_cache_size"

See also:
class CdbAnyTypeDict

Definition at line 236 of file CdbEnvironment.cc.

References CdbEnvironmentImpl::extra().

Referenced by CdbRooRoCdb::initialize().

int CdbEnvironment::getDebugMode   [static]
 

Get the current value of the "DEBUG LEVEL".

See also:
CdbEnvironment::setDebugMode()

Definition at line 40 of file CdbEnvironment.cc.

Referenced by CdbRooRoPartitionsLayoutR::iterator(), CdbBdbSPartitionsLayoutP::iterator(), and CdbSQLOrigin::visible_partitions_iterator().

CdbStatus CdbEnvironment::getDefaultDatabase std::string &    theDatabaseName,
const char *    theImplementationName = 0,
const char *    theTechnologyName = 0
[static]
 

Get default database name.

The database is defined as a set of self-consistent (persistent, but not limited to) datasets with CDB metadata and actual user defined payload.

Definition at line 153 of file CdbEnvironment.cc.

References CdbEnvironmentImpl::getDefaultDatabase().

CdbStatus CdbEnvironment::getDefaultImplementation std::string &    theImplementationName,
const char *    theTechnologyName = 0
[static]
 

Get default implementation name.

The implementation name corresponds to specific implementation of the full CDB API based on certain technology. Don't mix this "specific implementation" with the various used of the same persistent technology.

Omitting the technology name when calling this method whould imply that the current default technology (as defined by the previous method) is going to be used.

Definition at line 145 of file CdbEnvironment.cc.

References CdbEnvironmentImpl::getDefaultImplementation().

Referenced by Cdb::instance().

CdbStatus CdbEnvironment::getDefaultPath std::string &    theViewName,
std::string &    theDatabaseName,
std::string &    theImplementationName,
std::string &    theTechnologyName
[static]
 

Get all defaults.

This method will return the current path in the tree of defaults.

Definition at line 175 of file CdbEnvironment.cc.

References CdbEnvironmentImpl::getDefaultPath().

CdbStatus CdbEnvironment::getDefaultTechnology std::string &    theTechnologyName [static]
 

Get default technology name.

The technology name is the top-level scope of the CDB API. Names returned by this method are associated with particular persistent technologies used in a specific way (which means that the same persistent technology may be used in different ways. If thsi is going to be the case then different "technology" names must be returned for each specific use by the current method).

The method will return CdbStatus::NotFound in case if there is no one specific technology known beneath CDB API.

Definition at line 139 of file CdbEnvironment.cc.

References CdbEnvironmentImpl::getDefaultTechnology().

Referenced by Cdb::instance().

CdbStatus CdbEnvironment::getDefaultView std::string &    theViewName,
const char *    theDatabaseName = 0,
const char *    theImplementationName = 0,
const char *    theTechnologyName = 0
[static]
 

Get default view name.

The view defines which slice of an actual database is available to an application. Views in fact are providing mapping from a virtual namespace available to client applications onto the actual data sets stored in databases.

Definition at line 163 of file CdbEnvironment.cc.

References CdbEnvironmentImpl::getDefaultView().

BdbTime CdbEnvironment::getTruncateTime   [static]
 

Get the current value of the "truncate" time.

The "truncate" time if set will restrict the end time of stored objects in the validity dimension. This restriction applies to any kinds of conditions stored through CDB API.

The default value of this time is "+Infinity", which means there is no restriction. The value of this parameter can be set at any time during an application execution. Should this happen the subsequent storing attempt would be affected.

See also:
CdbEnvironment::setTruncateTime()
Returns:
a value of the truncate time.

Definition at line 60 of file CdbEnvironment.cc.

References CdbEnvironmentImpl::getTruncateTime().

Referenced by CdbSQLApiCondition::storeObject(), and CdbBdbSCondition::storeObject().

int CdbEnvironment::setDebugMode int    newMode = 0 [static]
 

Set the current value of the "DEBUG LEVEL".

If 0 value is passed into the method then it means no debug output. Interpretations for other values are not defined yet. The current behaviour is "print as much as the corresponding component wants to".

Returns:
the previous value of the mode

Definition at line 30 of file CdbEnvironment.cc.

Referenced by main(), and CdbBrowserTool::run().

void CdbEnvironment::setDefault const char *    theTechnologyName,
const char *    theImplementationName,
const char *    theDatabaseName,
const char *    theViewName
[static]
 

Set a combination of default parameters.

NOTE: This is an obsolete method to be removed soon.

Definition at line 125 of file CdbEnvironment.cc.

References CdbEnvironmentImpl::setDefaultPath().

Referenced by CdbRooInit::beginJob(), CdbBdbInit::beginJob(), CdbBdbSCdb::initialize(), and main().

CdbStatus CdbEnvironment::setDefaultDatabase const char *    theDatabaseName,
const char *    theImplementationName = 0,
const char *    theTechnologyName = 0
[static]
 

Set default database.

The database must be available to the specified (or default) implementation.

NOTE: Passing 0 pointer as a database name is _not_ allowed by this method. The method will return CdbStatus::Error in this case.

Definition at line 201 of file CdbEnvironment.cc.

References CdbEnvironmentImpl::setDefaultDatabase().

CdbStatus CdbEnvironment::setDefaultImplementation const char *    theImplementationName,
const char *    theTechnologyName = 0
[static]
 

Set default implementation.

The implementation implementing given (or default) technology must already be instantiated by current application, and it must be known to CDB API.

NOTE: Passing 0 pointer as an implementation name is _not_ allowed by this method. The method will return CdbStatus::Error in this case.

Definition at line 193 of file CdbEnvironment.cc.

References CdbEnvironmentImpl::setDefaultImplementation().

CdbStatus CdbEnvironment::setDefaultPath const char *    theViewName,
const char *    theDatabaseName,
const char *    theImplementationName,
const char *    theTechnologyName
[static]
 

Set all defaults to specified path.

This method will set new path in the tree of defaults.

The method will check the presense and availability of specified components passed to this command.

NOTE: Passing 0 pointers for any of the method's parameters is _not_ allowed by this method. The method will return CdbStatus::Error in this case.

Definition at line 223 of file CdbEnvironment.cc.

References CdbEnvironmentImpl::setDefaultPath().

Referenced by main().

CdbStatus CdbEnvironment::setDefaultTechnology const char *    theTechnologyName [static]
 

Set default technology.

The technology must already be instantiated by current application, and it must be known to CDB API.

NOTE: Passing 0 pointer as a technology name is _not_ allowed by this method. The method will return CdbStatus::Error in this case.

Definition at line 187 of file CdbEnvironment.cc.

References CdbEnvironmentImpl::setDefaultTechnology().

CdbStatus CdbEnvironment::setDefaultView const char *    theViewName,
const char *    theDatabaseName = 0,
const char *    theImplementationName = 0,
const char *    theTechnologyName = 0
[static]
 

Set default view.

The view must already exist in the scope of the specified (or default) database.

NOTE: Passing 0 pointer as a view name is _not_ allowed by this method. The method will return CdbStatus::Error in this case.

Definition at line 211 of file CdbEnvironment.cc.

References CdbEnvironmentImpl::setDefaultView().

BdbTime CdbEnvironment::setTruncateTime const BdbTime   theNewTruncateTime [static]
 

Set the new value of the "truncate" time.

See also:
CdbEnvironment::getTruncateTime()
Returns:
a previous value of the truncate time.

Definition at line 66 of file CdbEnvironment.cc.

References CdbEnvironmentImpl::setTruncateTime().

Referenced by CdbRooInit::beginJob(), CdbBdbInit::beginJob(), and main().


Friends And Related Function Documentation

friend class Cdb [friend]
 

Definition at line 335 of file CdbEnvironment.hh.


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