CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_1/src/CondCore/DBCommon/interface/DbConnection.h

Go to the documentation of this file.
00001 #ifndef COND_DBCommon_DbConnection_h
00002 #define COND_DBCommon_DbConnection_h
00003 
00004 #include <string>
00005 #include <boost/shared_ptr.hpp>
00006 #include "DbConnectionConfiguration.h"
00007 #include "DbSession.h"
00008 //
00009 // Package:    CondCore/DBCommon
00010 // Class:      DbConnection
00011 //
00016 namespace coral {
00017   class ConnectionService;
00018   class ISessionProxy;
00019   class IMonitoringReporter;
00020   class IWebCacheControl;
00021 }
00022 
00023 namespace edm{
00024   class ParameterSet;
00025 }
00026 
00027 namespace ora {
00028   class ConnectionPool;
00029 }
00030 
00031 namespace cond{
00032 
00033   /*
00034   **/
00035   class DbConnection{
00036   public:
00037     DbConnection();
00038     
00039     DbConnection(const DbConnection& conn);
00040     
00041     virtual ~DbConnection();
00042 
00043     DbConnection& operator=(const DbConnection& conn);
00044     
00045     void configure();    
00046     
00047     void configure( cond::DbConfigurationDefaults defaultItem );    
00048     
00049     void configure( const edm::ParameterSet& connectionPset );
00050     
00051     void close();
00052 
00053     bool isOpen() const;
00054 
00055     DbSession createSession() const;
00056 
00057     DbConnectionConfiguration & configuration();
00058     DbConnectionConfiguration const & configuration() const;
00059 
00060     boost::shared_ptr<ora::ConnectionPool> connectionPool() const;
00061 
00062     coral::IConnectionService& connectionService() const;
00063 
00064     const coral::IMonitoringReporter& monitoringReporter() const;
00065 
00066     coral::IWebCacheControl& webCacheControl() const;
00067 
00068     private:
00069     class ConnectionImpl;
00070     
00071     private:
00072     boost::shared_ptr<ConnectionImpl> m_implementation;
00073 
00074   };
00075 }
00076 #endif
00077 // DBCONNECTION_H