#include <DTLVStatusHandler.h>
Public Member Functions | |
DTLVStatusHandler (const edm::ParameterSet &ps) | |
void | getNewObjects () |
std::string | id () const |
virtual | ~DTLVStatusHandler () |
Private Attributes | |
cond::DbConnection | buff_conn |
cond::DbSession | buff_session |
std::string | bufferConnect |
DTLVStatus * | ccbStatus |
std::string | dataTag |
cond::DbConnection | omds_conn |
cond::DbSession | omds_session |
std::string | onlineAuthentication |
std::string | onlineConnect |
Description: Class to copy CCB DCS-status via PopCon
Definition at line 37 of file DTLVStatusHandler.h.
DTLVStatusHandler::DTLVStatusHandler | ( | const edm::ParameterSet & | ps | ) |
Constructor
Definition at line 44 of file DTLVStatusHandler.cc.
References gather_cfg::cout.
: dataTag( ps.getParameter<std::string> ( "tag" ) ), onlineConnect( ps.getParameter<std::string> ( "onlineDB" ) ), onlineAuthentication( ps.getParameter<std::string> ( "onlineAuthentication" ) ), bufferConnect( ps.getParameter<std::string> ( "bufferDB" ) ), omds_conn(), buff_conn(), omds_session(), buff_session() { std::cout << " PopCon application for DT DCS data (CCB status) export " << std::endl; }
DTLVStatusHandler::~DTLVStatusHandler | ( | ) | [virtual] |
void DTLVStatusHandler::getNewObjects | ( | ) | [virtual] |
Operations
Implements popcon::PopConSourceHandler< DTLVStatus >.
Definition at line 67 of file DTLVStatusHandler.cc.
References buff_conn, buff_session, bufferConnect, cond::DbSession::close(), cond::DbConnection::configuration(), cond::DbConnection::configure(), gather_cfg::cout, cond::DbConnection::createSession(), dataTag, prof2calltree::last, cond::TagInfo::lastInterval, MergeJob_cfg::lastRun, popcon::PopConSourceHandler< DTLVStatus >::m_to_transfer, omds_conn, omds_session, onlineAuthentication, onlineConnect, cond::DbSession::open(), popcon::PopConSourceHandler< DTLVStatus >::tagInfo(), and cond::DbSession::transaction().
{ // online DB connection std::cout << "configure omds DbConnection" << std::endl; // conn->configure( cond::CmsDefaults ); omds_conn.configuration().setAuthenticationPath( onlineAuthentication ); omds_conn.configure(); std::cout << "create omds DbSession" << std::endl; omds_session = omds_conn.createSession(); std::cout << "open omds session" << std::endl; omds_session.open( onlineConnect ); std::cout << "start omds transaction" << std::endl; omds_session.transaction().start(); std::cout << "" << std::endl; // buffer DB connection std::cout << "configure buffer DbConnection" << std::endl; buff_conn.configuration().setAuthenticationPath( onlineAuthentication ); buff_conn.configure(); std::cout << "create buffer DbSession" << std::endl; cond::DbSession buff_session = buff_conn.createSession(); std::cout << "open buffer session" << std::endl; buff_session.open( bufferConnect ); std::cout << "start buffer transaction" << std::endl; buff_session.transaction().start(); // offline info //to access the information on the tag inside the offline database: cond::TagInfo const & ti = tagInfo(); unsigned int last = ti.lastInterval.first; std::cout << "latest DCS data (CCB status) already copied for run: " << last << std::endl; if ( last == 0 ) { DTLVStatus* dummyConf = new DTLVStatus( dataTag ); cond::Time_t snc = 1; m_to_transfer.push_back( std::make_pair( dummyConf, snc ) ); } //to access the information on last successful log entry for this tag: // cond::LogDBEntry const & lde = logDBEntry(); //to access the lastest payload (Ref is a smart pointer) // Ref payload = lastPayload(); unsigned lastRun = last; std::cout << "check for new runs since " << lastRun << std::endl; buff_session.transaction().commit(); buff_session.close(); omds_session.close(); return; }
std::string DTLVStatusHandler::id | ( | void | ) | const [virtual] |
Implements popcon::PopConSourceHandler< DTLVStatus >.
Definition at line 125 of file DTLVStatusHandler.cc.
References dataTag.
{ return dataTag; }
Definition at line 64 of file DTLVStatusHandler.h.
Referenced by getNewObjects().
Definition at line 66 of file DTLVStatusHandler.h.
Referenced by getNewObjects().
std::string DTLVStatusHandler::bufferConnect [private] |
Definition at line 60 of file DTLVStatusHandler.h.
Referenced by getNewObjects().
DTLVStatus* DTLVStatusHandler::ccbStatus [private] |
Definition at line 61 of file DTLVStatusHandler.h.
std::string DTLVStatusHandler::dataTag [private] |
Definition at line 57 of file DTLVStatusHandler.h.
Referenced by getNewObjects(), and id().
Definition at line 63 of file DTLVStatusHandler.h.
Referenced by getNewObjects().
Definition at line 65 of file DTLVStatusHandler.h.
Referenced by getNewObjects().
std::string DTLVStatusHandler::onlineAuthentication [private] |
Definition at line 59 of file DTLVStatusHandler.h.
Referenced by getNewObjects().
std::string DTLVStatusHandler::onlineConnect [private] |
Definition at line 58 of file DTLVStatusHandler.h.
Referenced by getNewObjects().