00001 #ifndef COND_DBCommon_ConnectionConfiguration_h 00002 #define COND_DBCommon_ConnectionConfiguration_h 00003 #include "RelationalAccess/IMonitoring.h" 00004 // 00005 // Package: DBCommon 00006 // Class : Connection 00007 // 00011 // 00012 // Author: Zhen Xie 00013 // 00014 namespace cond{ 00015 class ConnectionConfiguration{ 00016 public: 00017 ConnectionConfiguration(); 00018 ~ConnectionConfiguration(); 00019 00023 void enableConnectionSharing(); 00024 00029 void disableConnectionSharing(); 00030 00034 bool isConnectionSharingEnabled() const; 00035 00039 void setConnectionRetrialPeriod( int timeInSeconds ); 00040 00044 int connectionRetrialPeriod() const; 00045 00050 void setConnectionRetrialTimeOut( int timeOutInSeconds ); 00051 00056 int connectionRetrialTimeOut() const; 00057 00061 void setConnectionTimeOut( int timeOutInSeconds ); 00062 00066 int connectionTimeOut(); 00067 00072 void setIdleConnectionCleanupPeriod( int timeInSeconds ); 00073 00077 int idleConnectionCleanupPeriod() const; 00078 00082 void enableReadOnlySessionOnUpdateConnections(); 00083 00087 void disableReadOnlySessionOnUpdateConnections(); 00088 00092 bool isReadOnlySessionOnUpdateConnectionsEnabled(); 00093 00097 void enablePoolAutomaticCleanUp(); 00098 00102 void disablePoolAutomaticCleanUp(); 00103 00107 bool isPoolAutomaticCleanUpEnabled() const; 00108 00109 // set the monitoring level 00110 void setMonitorLevel(coral::monitor::Level level); 00111 // monitoring level 00112 coral::monitor::Level monitorLevel() const; 00113 private: 00114 bool m_enableConSharing; 00115 int m_connectionRetrialPeriod; 00116 int m_connectionRetrialTimeOut; 00117 int m_connectionTimeOut; 00118 int m_idleconnectionCleanupPeriod; 00119 bool m_enableCommonConnection; 00120 bool m_enablePoolAutomaticCleanUp; 00121 coral::monitor::Level m_monitorLevel; 00122 }; 00123 } 00124 #endif