CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Private Attributes
cond::DbConnection Class Reference

#include <DbConnection.h>

Classes

class  ConnectionImpl
 

Public Member Functions

void close ()
 
DbConnectionConfigurationconfiguration ()
 
DbConnectionConfiguration const & configuration () const
 
void configure ()
 
void configure (cond::DbConfigurationDefaults defaultItem)
 
void configure (const edm::ParameterSet &connectionPset)
 
boost::shared_ptr
< ora::ConnectionPool
connectionPool () const
 
coral::IConnectionService & connectionService () const
 
DbSession createSession () const
 
 DbConnection ()
 
 DbConnection (const DbConnection &conn)
 
bool isOpen () const
 
const coral::IMonitoringReporter & monitoringReporter () const
 
DbConnectionoperator= (const DbConnection &conn)
 
coral::IWebCacheControl & webCacheControl () const
 
virtual ~DbConnection ()
 

Private Attributes

boost::shared_ptr< ConnectionImplm_implementation
 

Detailed Description

Definition at line 35 of file DbConnection.h.

Constructor & Destructor Documentation

DbConnection::DbConnection ( )

Definition at line 31 of file DbConnection.cc.

References configure().

31  :
32  m_implementation(new ConnectionImpl()){
33  configure();
34 }
boost::shared_ptr< ConnectionImpl > m_implementation
Definition: DbConnection.h:69
DbConnection::DbConnection ( const DbConnection conn)

Definition at line 36 of file DbConnection.cc.

36  :
37  m_implementation( conn.m_implementation ){
38 }
boost::shared_ptr< ConnectionImpl > m_implementation
Definition: DbConnection.h:69
DbConnection::~DbConnection ( )
virtual

Definition at line 40 of file DbConnection.cc.

40  {
41 }

Member Function Documentation

void DbConnection::close ( void  )
cond::DbConnectionConfiguration & DbConnection::configuration ( )
cond::DbConnectionConfiguration const & DbConnection::configuration ( ) const

Definition at line 88 of file DbConnection.cc.

89 {
90  return m_implementation->m_configuration;
91 }
boost::shared_ptr< ConnectionImpl > m_implementation
Definition: DbConnection.h:69
void DbConnection::configure ( )
void DbConnection::configure ( cond::DbConfigurationDefaults  defaultItem)

Definition at line 55 of file DbConnection.cc.

References cond::DbConnectionConfiguration::defaultConfigurations().

55  {
56  m_implementation->m_configuration = DbConnectionConfiguration::defaultConfigurations()[ defaultItem ];
57  configure();
58 }
boost::shared_ptr< ConnectionImpl > m_implementation
Definition: DbConnection.h:69
static const std::vector< DbConnectionConfiguration > & defaultConfigurations()
void DbConnection::configure ( const edm::ParameterSet connectionPset)

Definition at line 61 of file DbConnection.cc.

61  {
62  m_implementation->m_configuration.setParameters( connectionPset );
63  configure();
64 }
boost::shared_ptr< ConnectionImpl > m_implementation
Definition: DbConnection.h:69
boost::shared_ptr< ora::ConnectionPool > DbConnection::connectionPool ( ) const

Definition at line 93 of file DbConnection.cc.

93  {
94  return m_implementation->m_connectionPool;
95 }
boost::shared_ptr< ConnectionImpl > m_implementation
Definition: DbConnection.h:69
coral::IConnectionService & DbConnection::connectionService ( ) const

Definition at line 97 of file DbConnection.cc.

References edm::hlt::Exception.

97  {
98  if(!isOpen())
99  throw cond::Exception("DbConnection::connectionService: cannot get connection service. Connection has not been open.");
100  return m_implementation->m_connectionPool->connectionService();
101 }
bool isOpen() const
Definition: DbConnection.cc:78
boost::shared_ptr< ConnectionImpl > m_implementation
Definition: DbConnection.h:69
cond::DbSession DbConnection::createSession ( ) const
bool DbConnection::isOpen ( ) const

Definition at line 78 of file DbConnection.cc.

79 {
80  return m_implementation->m_connectionPool.get();
81 }
boost::shared_ptr< ConnectionImpl > m_implementation
Definition: DbConnection.h:69
const coral::IMonitoringReporter & DbConnection::monitoringReporter ( ) const

Definition at line 103 of file DbConnection.cc.

References edm::hlt::Exception.

Referenced by cond::SQLReport::reportForConnection().

103  {
104  if(!isOpen())
105  throw cond::Exception("DbConnection::monitoringReporter: cannot get connection service. Connection has not been open.");
106  return m_implementation->m_connectionPool->connectionService().monitoringReporter();
107 }
bool isOpen() const
Definition: DbConnection.cc:78
boost::shared_ptr< ConnectionImpl > m_implementation
Definition: DbConnection.h:69
cond::DbConnection & DbConnection::operator= ( const DbConnection conn)

Definition at line 43 of file DbConnection.cc.

References m_implementation.

44 {
45  if(this!=&conn) m_implementation = conn.m_implementation;
46  return *this;
47 }
boost::shared_ptr< ConnectionImpl > m_implementation
Definition: DbConnection.h:69
coral::IWebCacheControl & DbConnection::webCacheControl ( ) const

Definition at line 109 of file DbConnection.cc.

References edm::hlt::Exception.

109  {
110  if(!isOpen())
111  throw cond::Exception("DbConnection::webCacheControl: cannot get connection service. Connection has not been open.");
112  return m_implementation->m_connectionPool->connectionService().webCacheControl();
113 }
bool isOpen() const
Definition: DbConnection.cc:78
boost::shared_ptr< ConnectionImpl > m_implementation
Definition: DbConnection.h:69

Member Data Documentation

boost::shared_ptr<ConnectionImpl> cond::DbConnection::m_implementation
private

Definition at line 69 of file DbConnection.h.

Referenced by operator=().