Public Member Functions | |
FrontierProxy () | |
std::string | getRealConnectString () const |
void | initialize (const std::string &userconnect, const DbConnection &connection) |
bool | isTransactional () const |
~FrontierProxy () | |
Static Private Member Functions | |
static unsigned int | countslash (const std::string &input) |
Private Attributes | |
std::vector< std::string > | m_refreshtablelist |
std::string | m_transactionId |
std::string | m_userconnect |
Definition at line 14 of file FrontierProxy.cc.
cond::FrontierProxy::FrontierProxy | ( | ) |
Definition at line 32 of file FrontierProxy.cc.
References cond::IOVNames::iovDataTableName(), cond::IOVNames::iovTableName(), and m_refreshtablelist.
{ m_refreshtablelist.reserve(10); //table names for IOVSequence in the old POOL mapping m_refreshtablelist.push_back(cond::IOVNames::iovTableName()); m_refreshtablelist.push_back(cond::IOVNames::iovDataTableName()); //table names for IOVSequence in ORA //FIXME: do not use hard-coded names, ORA should provide them for a given container... m_refreshtablelist.push_back("ORA_C_COND_IOVSEQUENCE"); m_refreshtablelist.push_back("ORA_C_COND_IOVSEQU_A0"); m_refreshtablelist.push_back("ORA_C_COND_IOVSEQU_A1"); // do not refesh tag table in production... // m_refreshtablelist.push_back(cond::MetaDataNames::metadataTable()); }
cond::FrontierProxy::~FrontierProxy | ( | ) |
Definition at line 46 of file FrontierProxy.cc.
{ m_refreshtablelist.clear(); }
unsigned int cond::FrontierProxy::countslash | ( | const std::string & | input | ) | [static, private] |
Definition at line 101 of file FrontierProxy.cc.
References prof2calltree::count.
{ unsigned int count=0; std::string::size_type slashpos( 0 ); while( slashpos!=std::string::npos){ slashpos = input.find('/', slashpos ); if ( slashpos != std::string::npos ){ ++count; // start next search after this word slashpos += 1; } } return count; }
std::string cond::FrontierProxy::getRealConnectString | ( | ) | const [virtual] |
Implements cond::TechnologyProxy.
Definition at line 51 of file FrontierProxy.cc.
References Exception, edm::Service< T >::isAvailable(), prof2calltree::l, and query::result.
{ std::string result = m_userconnect; std::string proto("frontier://"); std::string::size_type fpos=m_userconnect.find(proto); unsigned int nslash=this->countslash(m_userconnect.substr(proto.size(),m_userconnect.size()-fpos)); if(nslash==1){ edm::Service<edm::SiteLocalConfig> localconfservice; if( !localconfservice.isAvailable() ){ throw cms::Exception("edm::SiteLocalConfigService is not available"); } result=localconfservice->lookupCalibConnect(m_userconnect); } if (!m_transactionId.empty()) { size_t l = result.rfind('/'); result.insert(l,"(freshkey="+m_transactionId+')'); } return result; }
void cond::FrontierProxy::initialize | ( | const std::string & | userconnect, |
const DbConnection & | connection | ||
) | [virtual] |
Implements cond::TechnologyProxy.
Definition at line 72 of file FrontierProxy.cc.
References cond::DbConnection::configuration(), cond::DbConnectionConfiguration::transactionId(), and cond::DbConnection::webCacheControl().
{ m_userconnect = userconnect; m_transactionId = connection.configuration().transactionId(); std::string refreshConnect; std::string realconnect=this->getRealConnectString(); std::string::size_type startRefresh = realconnect.find("://"); if (startRefresh != std::string::npos){ startRefresh += 3; } std::string::size_type endRefresh=realconnect.rfind("/", std::string::npos); if (endRefresh == std::string::npos){ refreshConnect = realconnect; }else{ refreshConnect = realconnect.substr(startRefresh, endRefresh-startRefresh); if(refreshConnect.substr(0,1) != "("){ //if the connect string is not a complicated parenthesized string, // an https:// needs to be at the beginning of it refreshConnect.insert(0, "https://"); } } std::vector<std::string>::iterator ibeg=m_refreshtablelist.begin(); std::vector<std::string>::iterator iend=m_refreshtablelist.end(); for(std::vector<std::string>::iterator it=ibeg; it!=iend; ++it){ connection.webCacheControl().refreshTable(refreshConnect,*it ); } }
bool cond::FrontierProxy::isTransactional | ( | ) | const [inline, virtual] |
std::vector<std::string> cond::FrontierProxy::m_refreshtablelist [private] |
Definition at line 27 of file FrontierProxy.cc.
Referenced by FrontierProxy().
std::string cond::FrontierProxy::m_transactionId [private] |
Definition at line 26 of file FrontierProxy.cc.
std::string cond::FrontierProxy::m_userconnect [private] |
Definition at line 25 of file FrontierProxy.cc.