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 37 of file DbConnection.cc.

References configure().

37  :
38  m_implementation(new ConnectionImpl()){
39  configure();
40 }
boost::shared_ptr< ConnectionImpl > m_implementation
Definition: DbConnection.h:69
DbConnection::DbConnection ( const DbConnection conn)

Definition at line 42 of file DbConnection.cc.

42  :
43  m_implementation( conn.m_implementation ){
44 }
boost::shared_ptr< ConnectionImpl > m_implementation
Definition: DbConnection.h:69
DbConnection::~DbConnection ( )
virtual

Definition at line 46 of file DbConnection.cc.

46  {
47 }

Member Function Documentation

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

Definition at line 94 of file DbConnection.cc.

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

Definition at line 61 of file DbConnection.cc.

References cond::DbConnectionConfiguration::defaultConfigurations().

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

Definition at line 67 of file DbConnection.cc.

67  {
68  m_implementation->m_configuration.setParameters( connectionPset );
69  configure();
70 }
boost::shared_ptr< ConnectionImpl > m_implementation
Definition: DbConnection.h:69
boost::shared_ptr< ora::ConnectionPool > DbConnection::connectionPool ( ) const

Definition at line 99 of file DbConnection.cc.

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

Definition at line 103 of file DbConnection.cc.

References edm::hlt::Exception.

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

Definition at line 84 of file DbConnection.cc.

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

Definition at line 109 of file DbConnection.cc.

References edm::hlt::Exception.

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

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

Definition at line 49 of file DbConnection.cc.

References m_implementation.

50 {
51  if(this!=&conn) m_implementation = conn.m_implementation;
52  return *this;
53 }
boost::shared_ptr< ConnectionImpl > m_implementation
Definition: DbConnection.h:69
coral::IWebCacheControl & DbConnection::webCacheControl ( ) const

Definition at line 115 of file DbConnection.cc.

References edm::hlt::Exception.

115  {
116  if(!isOpen())
117  throw cond::Exception("DbConnection::webCacheControl: cannot get connection service. Connection has not been open.");
118  return m_implementation->m_connectionPool->connectionService().webCacheControl();
119 }
bool isOpen() const
Definition: DbConnection.cc:84
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=().