CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DbConnectionConfiguration.h
Go to the documentation of this file.
1 #ifndef COND_DBCommon_DbConnectionConfiguration_h
2 #define COND_DBCommon_DbConnectionConfiguration_h
3 //
4 // Package: CondCore/DBCommon
5 // Class: DbConnectionConfiguration
6 //
10 //
11 //
12 #include <string>
13 // coral includes
14 #include "CoralBase/MessageStream.h"
15 #include "RelationalAccess/IMonitoring.h"
16 
17 namespace coral {
18  class IConnectionServiceConfiguration;
19 }
20 
21 namespace edm{
22  class ParameterSet;
23 }
24 
25 namespace cond{
26  class CoralServiceManager;
27 
29 
31 
33  public:
34  static const std::vector<DbConnectionConfiguration>& defaultConfigurations();
35  public:
37  DbConnectionConfiguration( bool connectionSharing,
39  bool readOnlySessionOnUpdateConnections,
42  bool poolAutomaticCleanUp,
44  const std::string& transactionId,
45  coral::MsgLevel msgLev,
46  coral::monitor::Level monitorLev,
47  bool SQLMonitoring );
48 
52  // configuration from edm parameter set
53  void setParameters( const edm::ParameterSet& connectionPset );
54  // configuration for individual connection parameters
55  void setConnectionSharing( bool flag );
56  void setConnectionTimeOut( int timeOut );
57  void setReadOnlySessionOnUpdateConnections( bool flag );
59  void setConnectionRetrialTimeOut( int timeout );
60  void setPoolAutomaticCleanUp( bool flag );
61  // authentication
62  void setAuthenticationPath( const std::string& p );
63  void setAuthenticationSystem( int authSysCode );
64  // transaction Id for multijob (used by frontier)
65  void setTransactionId( std::string const & tid);
66  // message level
67  void setMessageLevel( coral::MsgLevel l );
68  // monitoring level
70  // SQL monitoring
71  void setSQLMonitoring( bool flag );
72  // force the coral configuration
73  void configure( coral::IConnectionServiceConfiguration& coralConfig) const;
74  // getters
75  bool isConnectionSharingEnabled() const;
76  int connectionTimeOut() const;
78  int connectionRetrialPeriod() const;
79  int connectionRetrialTimeOut() const;
80  bool isPoolAutomaticCleanUpEnabled() const;
81  const std::string& authenticationPath() const;
82  const std::string& transactionId() const;
83  coral::MsgLevel messageLevel() const;
84  bool isSQLMonitoringEnabled() const;
85  private:
86  std::pair<bool,bool> m_connectionSharing;
87  std::pair<bool,int> m_connectionTimeOut;
89  std::pair<bool,int> m_connectionRetrialPeriod;
90  std::pair<bool,int> m_connectionRetrialTimeOut;
91  std::pair<bool,bool> m_poolAutomaticCleanUp;
93  int m_authSys;
95  coral::MsgLevel m_messageLevel;
97  //int m_idleConnectionCleanupPeriod;
98 
101  };
102 }
103 #endif
DbConnectionConfiguration & operator=(const DbConnectionConfiguration &rhs)
const std::string & transactionId() const
void setTransactionId(std::string const &tid)
std::pair< bool, bool > m_poolAutomaticCleanUp
void setParameters(const edm::ParameterSet &connectionPset)
std::pair< bool, int > m_connectionRetrialTimeOut
void configure(coral::IConnectionServiceConfiguration &coralConfig) const
std::pair< bool, int > m_connectionRetrialPeriod
std::pair< bool, bool > m_readOnlySessionOnUpdateConnections
std::pair< bool, bool > m_connectionSharing
void setAuthenticationPath(const std::string &p)
const std::string & authenticationPath() const
void setMonitoringLevel(coral::monitor::Level l)
static const std::vector< DbConnectionConfiguration > & defaultConfigurations()