#include <DbConnectionConfiguration.h>
Public Member Functions | |
const std::string & | authenticationPath () const |
void | configure (coral::IConnectionServiceConfiguration &coralConfig) const |
int | connectionRetrialPeriod () const |
int | connectionRetrialTimeOut () const |
int | connectionTimeOut () const |
DbConnectionConfiguration (bool connectionSharing, int connectionTimeOut, bool readOnlySessionOnUpdateConnections, int connectionRetrialPeriod, int connectionRetrialTimeOut, bool poolAutomaticCleanUp, const std::string &authenticationPath, const std::string &transactionId, coral::MsgLevel msgLev, coral::monitor::Level monitorLev, bool SQLMonitoring) | |
DbConnectionConfiguration () | |
DbConnectionConfiguration (const DbConnectionConfiguration &rhs) | |
bool | isConnectionSharingEnabled () const |
bool | isPoolAutomaticCleanUpEnabled () const |
bool | isReadOnlySessionOnUpdateConnectionEnabled () const |
bool | isSQLMonitoringEnabled () const |
coral::MsgLevel | messageLevel () const |
DbConnectionConfiguration & | operator= (const DbConnectionConfiguration &rhs) |
void | setAuthenticationPath (const std::string &p) |
void | setConnectionRetrialPeriod (int period) |
void | setConnectionRetrialTimeOut (int timeout) |
void | setConnectionSharing (bool flag) |
void | setConnectionTimeOut (int timeOut) |
void | setMessageLevel (coral::MsgLevel l) |
void | setMonitoringLevel (coral::monitor::Level l) |
void | setParameters (const edm::ParameterSet &connectionPset) |
void | setPoolAutomaticCleanUp (bool flag) |
void | setReadOnlySessionOnUpdateConnections (bool flag) |
void | setSQLMonitoring (bool flag) |
void | setTransactionId (std::string const &tid) |
const std::string & | transactionId () const |
~DbConnectionConfiguration () | |
Static Public Member Functions | |
static std::vector < DbConnectionConfiguration > & | defaultConfigurations () |
Private Attributes | |
std::string | m_authPath |
std::pair< bool, int > | m_connectionRetrialPeriod |
std::pair< bool, int > | m_connectionRetrialTimeOut |
std::pair< bool, bool > | m_connectionSharing |
std::pair< bool, int > | m_connectionTimeOut |
coral::MsgLevel | m_messageLevel |
coral::monitor::Level | m_monitoringLevel |
CoralServiceManager * | m_pluginManager |
std::pair< bool, bool > | m_poolAutomaticCleanUp |
std::pair< bool, bool > | m_readOnlySessionOnUpdateConnections |
bool | m_SQLMonitoring |
std::string | m_transactionId |
Definition at line 30 of file DbConnectionConfiguration.h.
cond::DbConnectionConfiguration::DbConnectionConfiguration | ( | ) |
Definition at line 31 of file DbConnectionConfiguration.cc.
: m_connectionSharing(false,false), m_connectionTimeOut(false,0), m_readOnlySessionOnUpdateConnections(false,false), m_connectionRetrialPeriod(false,0), m_connectionRetrialTimeOut(false,0), m_poolAutomaticCleanUp(false,false), m_authPath(), m_transactionId(), m_messageLevel(coral::Error), m_monitoringLevel(coral::monitor::Off), m_SQLMonitoring(false), m_pluginManager(new CoralServiceManager){ }
cond::DbConnectionConfiguration::DbConnectionConfiguration | ( | bool | connectionSharing, |
int | connectionTimeOut, | ||
bool | readOnlySessionOnUpdateConnections, | ||
int | connectionRetrialPeriod, | ||
int | connectionRetrialTimeOut, | ||
bool | poolAutomaticCleanUp, | ||
const std::string & | authenticationPath, | ||
const std::string & | transactionId, | ||
coral::MsgLevel | msgLev, | ||
coral::monitor::Level | monitorLev, | ||
bool | SQLMonitoring | ||
) |
cond::DbConnectionConfiguration::DbConnectionConfiguration | ( | const DbConnectionConfiguration & | rhs | ) |
Definition at line 71 of file DbConnectionConfiguration.cc.
: m_connectionSharing(rhs.m_connectionSharing), m_connectionTimeOut(rhs.m_connectionTimeOut), m_readOnlySessionOnUpdateConnections(rhs.m_readOnlySessionOnUpdateConnections), m_connectionRetrialPeriod(rhs.m_connectionRetrialPeriod), m_connectionRetrialTimeOut(rhs.m_connectionRetrialTimeOut), m_poolAutomaticCleanUp(rhs.m_poolAutomaticCleanUp), m_authPath(rhs.m_authPath), m_transactionId(rhs.m_transactionId), m_messageLevel(rhs.m_messageLevel), m_monitoringLevel(rhs.m_monitoringLevel), m_SQLMonitoring(rhs.m_SQLMonitoring), m_pluginManager(new CoralServiceManager){ }
cond::DbConnectionConfiguration::~DbConnectionConfiguration | ( | ) |
Definition at line 86 of file DbConnectionConfiguration.cc.
{ delete m_pluginManager; }
const std::string & cond::DbConnectionConfiguration::authenticationPath | ( | ) | const |
Definition at line 286 of file DbConnectionConfiguration.cc.
{ return m_authPath; }
void cond::DbConnectionConfiguration::configure | ( | coral::IConnectionServiceConfiguration & | coralConfig | ) | const |
Definition at line 197 of file DbConnectionConfiguration.cc.
References path().
{ // message streaming coral::MessageStream::setMsgVerbosity( m_messageLevel ); // authentication std::string authServiceName("CORAL/Services/EnvironmentAuthenticationService"); if( !m_authPath.empty() ) { authServiceName = "COND/Services/XMLAuthenticationService"; boost::filesystem::path boostAuthPath( m_authPath ); if(boost::filesystem::is_directory(boostAuthPath)) { boostAuthPath /= boost::filesystem::path("authentication.xml"); } std::string authFileName = boostAuthPath.string(); coral::Context::instance().PropertyManager().property("AuthenticationFile")->set(authFileName); coral::Context::instance().loadComponent( authServiceName, m_pluginManager ); } coralConfig.setAuthenticationService( authServiceName ); // connection sharing if(m_connectionSharing.first) { if(m_connectionSharing.second) coralConfig.enableConnectionSharing(); else coralConfig.disableConnectionSharing(); } // connection timeout if(m_connectionTimeOut.first) { coralConfig.setConnectionTimeOut(m_connectionTimeOut.second); } // read only session on update connection if(m_readOnlySessionOnUpdateConnections.first) { if(m_readOnlySessionOnUpdateConnections.second) coralConfig.enableReadOnlySessionOnUpdateConnections(); else coralConfig.disableReadOnlySessionOnUpdateConnections(); } // pool automatic clean up if(m_poolAutomaticCleanUp.first) { if(m_poolAutomaticCleanUp.second) coralConfig.enablePoolAutomaticCleanUp(); else coralConfig.disablePoolAutomaticCleanUp(); } // connection retrial period if(m_connectionRetrialPeriod.first) { coralConfig.setConnectionRetrialPeriod( m_connectionRetrialPeriod.second ); } // connection retrial timeout if( m_connectionRetrialTimeOut.first) { coralConfig.setConnectionRetrialTimeOut(m_connectionRetrialTimeOut.second ); } // monitoring level coralConfig.setMonitoringLevel( m_monitoringLevel ); // SQL monitoring if( m_SQLMonitoring ) { std::string pluginName("COND/Services/SQLMonitoringService"); coral::Context::instance().loadComponent( pluginName, m_pluginManager ); coralConfig.setMonitoringLevel(coral::monitor::Trace); } }
int cond::DbConnectionConfiguration::connectionRetrialPeriod | ( | ) | const |
Definition at line 274 of file DbConnectionConfiguration.cc.
{ return m_connectionRetrialPeriod.second; }
int cond::DbConnectionConfiguration::connectionRetrialTimeOut | ( | ) | const |
Definition at line 278 of file DbConnectionConfiguration.cc.
{ return m_connectionRetrialTimeOut.second; }
int cond::DbConnectionConfiguration::connectionTimeOut | ( | ) | const |
Definition at line 266 of file DbConnectionConfiguration.cc.
{ return m_connectionTimeOut.second; }
std::vector< cond::DbConnectionConfiguration > & cond::DbConnectionConfiguration::defaultConfigurations | ( | ) | [static] |
Definition at line 16 of file DbConnectionConfiguration.cc.
Referenced by cond::DbConnection::configure().
{ static std::vector<DbConnectionConfiguration> s_defaultConfigurations; // coral default s_defaultConfigurations.push_back( cond::DbConnectionConfiguration() ); // cms default s_defaultConfigurations.push_back( cond::DbConnectionConfiguration( false, 0, false, 10, 60, false, "", "", coral::Error, coral::monitor::Off, false ) ); // prod default s_defaultConfigurations.push_back( cond::DbConnectionConfiguration( false, 0, false, 10, 60, false, "", "", coral::Error, coral::monitor::Off, false ) ); // tool default s_defaultConfigurations.push_back( cond::DbConnectionConfiguration( false, 0, false, 10, 60, false, "", "",coral::Error, coral::monitor::Off, false ) ); // web default s_defaultConfigurations.push_back( cond::DbConnectionConfiguration( false, 0, false, 10, 60, false, "", "",coral::Error, coral::monitor::Off, false ) ); return s_defaultConfigurations; }
bool cond::DbConnectionConfiguration::isConnectionSharingEnabled | ( | ) | const |
Definition at line 261 of file DbConnectionConfiguration.cc.
{ return m_connectionSharing.second; }
bool cond::DbConnectionConfiguration::isPoolAutomaticCleanUpEnabled | ( | ) | const |
Definition at line 282 of file DbConnectionConfiguration.cc.
{ return m_poolAutomaticCleanUp.second; }
bool cond::DbConnectionConfiguration::isReadOnlySessionOnUpdateConnectionEnabled | ( | ) | const |
Definition at line 270 of file DbConnectionConfiguration.cc.
{ return m_readOnlySessionOnUpdateConnections.second; }
bool cond::DbConnectionConfiguration::isSQLMonitoringEnabled | ( | ) | const |
Definition at line 301 of file DbConnectionConfiguration.cc.
{ return m_SQLMonitoring; }
coral::MsgLevel cond::DbConnectionConfiguration::messageLevel | ( | ) | const |
Definition at line 296 of file DbConnectionConfiguration.cc.
{ return m_messageLevel; }
cond::DbConnectionConfiguration & cond::DbConnectionConfiguration::operator= | ( | const DbConnectionConfiguration & | rhs | ) |
Definition at line 91 of file DbConnectionConfiguration.cc.
References m_authPath, m_connectionRetrialPeriod, m_connectionRetrialTimeOut, m_connectionSharing, m_connectionTimeOut, m_messageLevel, m_monitoringLevel, m_poolAutomaticCleanUp, m_readOnlySessionOnUpdateConnections, m_SQLMonitoring, and m_transactionId.
{ m_connectionSharing = rhs.m_connectionSharing; m_connectionTimeOut = rhs.m_connectionTimeOut; m_readOnlySessionOnUpdateConnections = rhs.m_readOnlySessionOnUpdateConnections; m_connectionRetrialPeriod = rhs.m_connectionRetrialPeriod; m_connectionRetrialTimeOut = rhs.m_connectionRetrialTimeOut; m_poolAutomaticCleanUp = rhs.m_poolAutomaticCleanUp; m_authPath = rhs.m_authPath; m_transactionId=rhs.m_transactionId; m_messageLevel = rhs.m_messageLevel; m_monitoringLevel = rhs.m_monitoringLevel; m_SQLMonitoring = rhs.m_SQLMonitoring; return *this; }
void cond::DbConnectionConfiguration::setAuthenticationPath | ( | const std::string & | p | ) |
Definition at line 174 of file DbConnectionConfiguration.cc.
References L1TEmulatorMonitor_cff::p.
Referenced by cond::PayLoadInspector< DataT >::plot(), cond::PayLoadInspector< DataT >::summary(), and cond::PayLoadInspector< DataT >::trend_plot().
{ m_authPath = p; }
void cond::DbConnectionConfiguration::setConnectionRetrialPeriod | ( | int | period | ) |
Definition at line 159 of file DbConnectionConfiguration.cc.
References ExpressReco_HICollisions_FallBack::period.
{ m_connectionRetrialPeriod.first = true; m_connectionRetrialPeriod.second = period; }
void cond::DbConnectionConfiguration::setConnectionRetrialTimeOut | ( | int | timeout | ) |
Definition at line 164 of file DbConnectionConfiguration.cc.
{ m_connectionRetrialTimeOut.first = true; m_connectionRetrialTimeOut.second = timeout; }
void cond::DbConnectionConfiguration::setConnectionSharing | ( | bool | flag | ) |
Definition at line 144 of file DbConnectionConfiguration.cc.
{ m_connectionSharing.first = true; m_connectionSharing.second = flag; }
void cond::DbConnectionConfiguration::setConnectionTimeOut | ( | int | timeOut | ) |
Definition at line 149 of file DbConnectionConfiguration.cc.
{ m_connectionTimeOut.first = true; m_connectionTimeOut.second = timeOut; }
void cond::DbConnectionConfiguration::setMessageLevel | ( | coral::MsgLevel | l | ) |
Definition at line 183 of file DbConnectionConfiguration.cc.
References prof2calltree::l.
{ m_messageLevel = l; }
void cond::DbConnectionConfiguration::setMonitoringLevel | ( | coral::monitor::Level | l | ) |
Definition at line 187 of file DbConnectionConfiguration.cc.
References prof2calltree::l.
{ m_monitoringLevel = l; }
void cond::DbConnectionConfiguration::setParameters | ( | const edm::ParameterSet & | connectionPset | ) |
Definition at line 106 of file DbConnectionConfiguration.cc.
References builder_last_value_cfg::authPath, Debug, edm::ParameterSet::getUntrackedParameter(), and testEve_cfg::level.
Referenced by cond::service::PoolDBOutputService::PoolDBOutputService().
{ std::string authPath = connectionPset.getUntrackedParameter<std::string>("authenticationPath",""); setAuthenticationPath(authPath); setTransactionId(connectionPset.getUntrackedParameter<std::string>("transactionId","")); int messageLevel = connectionPset.getUntrackedParameter<int>("messageLevel",0); coral::MsgLevel level = coral::Error; switch (messageLevel) { case 0 : level = coral::Error; break; case 1: level = coral::Warning; break; case 2: level = coral::Info; break; case 3: level = coral::Debug; break; default: level = coral::Error; } setMessageLevel(level); bool enableConnectionSharing = connectionPset.getUntrackedParameter<bool>("enableConnectionSharing",true); setConnectionSharing( enableConnectionSharing ); int connectionTimeOut = connectionPset.getUntrackedParameter<int>("connectionTimeOut",600); setConnectionTimeOut( connectionTimeOut ); bool enableReadOnlySessionOnUpdateConnection = connectionPset.getUntrackedParameter<bool>("enableReadOnlySessionOnUpdateConnection",true); setReadOnlySessionOnUpdateConnections( enableReadOnlySessionOnUpdateConnection ); int connectionRetrialPeriod = connectionPset.getUntrackedParameter<int>("connectionRetrialPeriod",30); setConnectionRetrialPeriod( connectionRetrialPeriod ); int connectionRetrialTimeOut = connectionPset.getUntrackedParameter<int>("connectionRetrialTimeOut",180); setConnectionRetrialTimeOut( connectionRetrialTimeOut ); bool enablePoolAutomaticCleanUp = connectionPset.getUntrackedParameter<bool>("enablePoolAutomaticCleanUp",false); setPoolAutomaticCleanUp( enablePoolAutomaticCleanUp ); //int idleConnectionCleanupPeriod = connectionPset.getUntrackedParameter<int>("idleConnectionCleanupPeriod",300); }
void cond::DbConnectionConfiguration::setPoolAutomaticCleanUp | ( | bool | flag | ) |
Definition at line 169 of file DbConnectionConfiguration.cc.
{ m_poolAutomaticCleanUp.first = true; m_poolAutomaticCleanUp.second = flag; }
void cond::DbConnectionConfiguration::setReadOnlySessionOnUpdateConnections | ( | bool | flag | ) |
Definition at line 154 of file DbConnectionConfiguration.cc.
{ m_readOnlySessionOnUpdateConnections.first = true; m_readOnlySessionOnUpdateConnections.second = flag; }
void cond::DbConnectionConfiguration::setSQLMonitoring | ( | bool | flag | ) |
Definition at line 193 of file DbConnectionConfiguration.cc.
{ m_SQLMonitoring = flag; }
void cond::DbConnectionConfiguration::setTransactionId | ( | std::string const & | tid | ) |
Definition at line 179 of file DbConnectionConfiguration.cc.
{ m_transactionId=tid; }
const std::string & cond::DbConnectionConfiguration::transactionId | ( | ) | const |
Definition at line 291 of file DbConnectionConfiguration.cc.
Referenced by cond::FrontierProxy::initialize().
{ return m_transactionId; }
std::string cond::DbConnectionConfiguration::m_authPath [private] |
Definition at line 89 of file DbConnectionConfiguration.h.
Referenced by operator=().
std::pair<bool,int> cond::DbConnectionConfiguration::m_connectionRetrialPeriod [private] |
Definition at line 86 of file DbConnectionConfiguration.h.
Referenced by operator=().
std::pair<bool,int> cond::DbConnectionConfiguration::m_connectionRetrialTimeOut [private] |
Definition at line 87 of file DbConnectionConfiguration.h.
Referenced by operator=().
std::pair<bool,bool> cond::DbConnectionConfiguration::m_connectionSharing [private] |
Definition at line 83 of file DbConnectionConfiguration.h.
Referenced by operator=().
std::pair<bool,int> cond::DbConnectionConfiguration::m_connectionTimeOut [private] |
Definition at line 84 of file DbConnectionConfiguration.h.
Referenced by operator=().
coral::MsgLevel cond::DbConnectionConfiguration::m_messageLevel [private] |
Definition at line 91 of file DbConnectionConfiguration.h.
Referenced by operator=().
coral::monitor::Level cond::DbConnectionConfiguration::m_monitoringLevel [private] |
Definition at line 92 of file DbConnectionConfiguration.h.
Referenced by operator=().
Definition at line 96 of file DbConnectionConfiguration.h.
std::pair<bool,bool> cond::DbConnectionConfiguration::m_poolAutomaticCleanUp [private] |
Definition at line 88 of file DbConnectionConfiguration.h.
Referenced by operator=().
std::pair<bool,bool> cond::DbConnectionConfiguration::m_readOnlySessionOnUpdateConnections [private] |
Definition at line 85 of file DbConnectionConfiguration.h.
Referenced by operator=().
bool cond::DbConnectionConfiguration::m_SQLMonitoring [private] |
Definition at line 95 of file DbConnectionConfiguration.h.
Referenced by operator=().
std::string cond::DbConnectionConfiguration::m_transactionId [private] |
Definition at line 90 of file DbConnectionConfiguration.h.
Referenced by operator=().