CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
DTLVStatusHandler Class Reference

#include <DTLVStatusHandler.h>

Inheritance diagram for DTLVStatusHandler:
popcon::PopConSourceHandler< DTLVStatus >

Public Member Functions

 DTLVStatusHandler (const edm::ParameterSet &ps)
 
void getNewObjects ()
 
std::string id () const
 
virtual ~DTLVStatusHandler ()
 
- Public Member Functions inherited from popcon::PopConSourceHandler< DTLVStatus >
void convertFromOld ()
 
SummarydummySummary (typename OldContainer::value_type const &) const
 
void initialize (cond::DbSession dbSession, cond::TagInfo const &tagInfo, cond::LogDBEntry const &logDBEntry)
 
Ref lastPayload () const
 
cond::LogDBEntry const & logDBEntry () const
 
std::pair< Container const
*, std::string const > 
operator() (cond::DbSession session, cond::TagInfo const &tagInfo, cond::LogDBEntry const &logDBEntry) const
 
 PopConSourceHandler ()
 
Container const & returnData ()
 
void sort ()
 
cond::TagInfo const & tagInfo () const
 
std::string const & userTextLog () const
 
virtual ~PopConSourceHandler ()
 

Private Attributes

cond::DbConnection buff_conn
 
cond::DbSession buff_session
 
std::string bufferConnect
 
DTLVStatusccbStatus
 
std::string dataTag
 
cond::DbConnection omds_conn
 
cond::DbSession omds_session
 
std::string onlineAuthentication
 
std::string onlineConnect
 

Additional Inherited Members

- Public Types inherited from popcon::PopConSourceHandler< DTLVStatus >
typedef std::vector< TripletContainer
 
typedef std::vector< std::pair
< DTLVStatus *, cond::Time_t > > 
OldContainer
 
typedef PopConSourceHandler
< DTLVStatus
self
 
typedef cond::Summary Summary
 
typedef cond::Time_t Time_t
 
typedef DTLVStatus value_type
 
- Protected Member Functions inherited from popcon::PopConSourceHandler< DTLVStatus >
int add (value_type *payload, Summary *summary, Time_t time)
 
- Protected Attributes inherited from popcon::PopConSourceHandler< DTLVStatus >
OldContainer m_to_transfer
 
std::string m_userTextLog
 

Detailed Description

Description: Class to copy CCB DCS-status via PopCon

Date:
2010/09/14 13:54:04
Revision:
1.3
Author
Paolo Ronchese INFN Padova

Definition at line 37 of file DTLVStatusHandler.h.

Constructor & Destructor Documentation

DTLVStatusHandler::DTLVStatusHandler ( const edm::ParameterSet ps)

Constructor

Definition at line 44 of file DTLVStatusHandler.cc.

References gather_cfg::cout.

44  :
45  dataTag( ps.getParameter<std::string> ( "tag" ) ),
46  onlineConnect( ps.getParameter<std::string> ( "onlineDB" ) ),
48  "onlineAuthentication" ) ),
49  bufferConnect( ps.getParameter<std::string> ( "bufferDB" ) ),
50  omds_conn(),
51  buff_conn(),
52  omds_session(),
53  buff_session() {
54  std::cout << " PopCon application for DT DCS data (CCB status) export "
55  << std::endl;
56 }
T getParameter(std::string const &) const
cond::DbConnection buff_conn
cond::DbSession omds_session
cond::DbSession buff_session
cond::DbConnection omds_conn
std::string onlineAuthentication
std::string onlineConnect
tuple cout
Definition: gather_cfg.py:121
std::string bufferConnect
DTLVStatusHandler::~DTLVStatusHandler ( )
virtual

Destructor

Definition at line 61 of file DTLVStatusHandler.cc.

61  {
62 }

Member Function Documentation

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::DbTransaction::commit(), 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(), cond::DbConnectionConfiguration::setAuthenticationPath(), cond::DbTransaction::start(), popcon::PopConSourceHandler< DTLVStatus >::tagInfo(), and cond::DbSession::transaction().

67  {
68 
69  // online DB connection
70  std::cout << "configure omds DbConnection" << std::endl;
71  // conn->configure( cond::CmsDefaults );
74  std::cout << "create omds DbSession" << std::endl;
76  std::cout << "open omds session" << std::endl;
78  std::cout << "start omds transaction" << std::endl;
80  std::cout << "" << std::endl;
81 
82  // buffer DB connection
83  std::cout << "configure buffer DbConnection" << std::endl;
86  std::cout << "create buffer DbSession" << std::endl;
88  std::cout << "open buffer session" << std::endl;
89  buff_session.open( bufferConnect );
90  std::cout << "start buffer transaction" << std::endl;
91  buff_session.transaction().start();
92 
93  // offline info
94 
95  //to access the information on the tag inside the offline database:
96  cond::TagInfo const & ti = tagInfo();
97  unsigned int last = ti.lastInterval.first;
98  std::cout << "latest DCS data (CCB status) already copied for run: "
99  << last << std::endl;
100 
101  if ( last == 0 ) {
102  DTLVStatus* dummyConf = new DTLVStatus( dataTag );
103  cond::Time_t snc = 1;
104  m_to_transfer.push_back( std::make_pair( dummyConf, snc ) );
105  }
106 
107  //to access the information on last successful log entry for this tag:
108 // cond::LogDBEntry const & lde = logDBEntry();
109 
110  //to access the lastest payload (Ref is a smart pointer)
111 // Ref payload = lastPayload();
112 
113  unsigned lastRun = last;
114  std::cout << "check for new runs since " << lastRun << std::endl;
115 
116  buff_session.transaction().commit();
117  buff_session.close();
119 
120  return;
121 
122 }
DbTransaction & transaction()
Definition: DbSession.cc:189
void open(const std::string &connectionString, bool readOnly=false)
Definition: DbSession.cc:144
int commit()
commit transaction.
DbConnectionConfiguration & configuration()
Definition: DbConnection.cc:89
cond::DbConnection buff_conn
int start(bool readOnly=false)
start transaction
unsigned long long Time_t
Definition: Time.h:16
cond::DbSession omds_session
cond::DbSession buff_session
cond::DbConnection omds_conn
DbSession createSession() const
Definition: DbConnection.cc:72
std::string onlineAuthentication
void setAuthenticationPath(const std::string &p)
cond::ValidityInterval lastInterval
Definition: TagInfo.h:11
std::string onlineConnect
tuple cout
Definition: gather_cfg.py:121
std::string bufferConnect
std::string DTLVStatusHandler::id ( void  ) const
virtual

Implements popcon::PopConSourceHandler< DTLVStatus >.

Definition at line 125 of file DTLVStatusHandler.cc.

References dataTag.

125  {
126  return dataTag;
127 }

Member Data Documentation

cond::DbConnection DTLVStatusHandler::buff_conn
private

Definition at line 64 of file DTLVStatusHandler.h.

Referenced by getNewObjects().

cond::DbSession DTLVStatusHandler::buff_session
private

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().

cond::DbConnection DTLVStatusHandler::omds_conn
private

Definition at line 63 of file DTLVStatusHandler.h.

Referenced by getNewObjects().

cond::DbSession DTLVStatusHandler::omds_session
private

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().