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 (const cond::persistency::Session &dbSession, cond::TagInfo_t const &tagInfo, cond::LogDBEntry_t const &logDBEntry)
 
Ref lastPayload () const
 
cond::LogDBEntry_t const & logDBEntry () const
 
std::pair< Container const
*, std::string const > 
operator() (const cond::persistency::Session &session, cond::TagInfo_t const &tagInfo, cond::LogDBEntry_t const &logDBEntry) const
 
 PopConSourceHandler ()
 
Container const & returnData ()
 
void sort ()
 
cond::TagInfo_t 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/07/21 16:06:53
Revision:
1.2
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 43 of file DTLVStatusHandler.cc.

References gather_cfg::cout.

43  :
44  dataTag( ps.getParameter<std::string> ( "tag" ) ),
45  onlineConnect( ps.getParameter<std::string> ( "onlineDB" ) ),
47  "onlineAuthentication" ) ),
48  bufferConnect( ps.getParameter<std::string> ( "bufferDB" ) ),
49  omds_conn(),
50  buff_conn(),
51  omds_session(),
52  buff_session() {
53  std::cout << " PopCon application for DT DCS data (CCB status) export "
54  << std::endl;
55 }
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 60 of file DTLVStatusHandler.cc.

60  {
61 }

Member Function Documentation

void DTLVStatusHandler::getNewObjects ( )
virtual

Operations

Implements popcon::PopConSourceHandler< DTLVStatus >.

Definition at line 66 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_t::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().

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

Implements popcon::PopConSourceHandler< DTLVStatus >.

Definition at line 124 of file DTLVStatusHandler.cc.

References dataTag.

124  {
125  return dataTag;
126 }

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