CMS 3D CMS Logo

l1t::DataManager Class Reference

#include <CondTools/L1Trigger/interface/DataManager.h>

Inheritance diagram for l1t::DataManager:

l1t::DataReader l1t::DataWriter l1t::OMDSReader

List of all members.

Public Member Functions

 DataManager (const std::string &connect, const std::string &authenticationPath, bool isOMDS=false)
void setDebug (bool debug)
virtual ~DataManager ()

Protected Member Functions

edm::eventsetup::TypeTag findType (const std::string &type) const

Protected Attributes

cond::Connectionconnection
cond::MetaDatametadata
cond::DBSessionsession


Detailed Description

Definition at line 24 of file DataManager.h.


Constructor & Destructor Documentation

l1t::DataManager::DataManager ( const std::string &  connect,
const std::string &  authenticationPath,
bool  isOMDS = false 
) [explicit]

Definition at line 12 of file DataManager.cc.

References cond::DBSession::configuration(), cond::Connection::connect(), connection, cond::SessionConfiguration::connectionConfiguration(), cond::Connection::coralTransaction(), metadata, cond::DBSession::open(), session, cond::SessionConfiguration::setAuthenticationMethod(), cond::SessionConfiguration::setAuthenticationPath(), cond::SessionConfiguration::setBlobStreamer(), setDebug(), and cond::XML.

00015 {
00016 //     // Initialize session used with this object
00017 //     poolSession = new cond::DBSession ();
00018 //     poolSession->configuration ().setAuthenticationMethod (cond::Env);
00019 // //    poolSession->sessionConfiguration ().setMessageLevel (cond::Info);
00020 //     poolSession->configuration ().connectionConfiguration ()->enableConnectionSharing ();
00021 //     poolSession->configuration ().connectionConfiguration ()->enableReadOnlySessionOnUpdateConnections ();
00022 
00023 //     coralSession = new cond::DBSession ();
00024 //     coralSession->configuration ().setAuthenticationMethod (cond::Env);
00025 // //    coralSession->sessionConfiguration ().setMessageLevel (cond::Info);
00026 //     coralSession->configuration ().connectionConfiguration ()->enableConnectionSharing ();
00027 //     coralSession->configuration ().connectionConfiguration ()->enableReadOnlySessionOnUpdateConnections ();
00028 
00029     session = new cond::DBSession();
00030     setDebug( false ) ;
00031 
00032     if( isOMDS )
00033       {
00034         session->configuration().setAuthenticationMethod(cond::XML);
00035       }
00036     else
00037       {
00038         //      session->configuration().setAuthenticationMethod(cond::Env);
00039         session->configuration().setAuthenticationMethod(cond::XML);
00040         session->configuration().connectionConfiguration()
00041           ->enableConnectionSharing ();
00042         session->configuration().connectionConfiguration()
00043           ->enableReadOnlySessionOnUpdateConnections ();
00044       }
00045     session->configuration().setAuthenticationPath( authenticationPath ) ;
00046     session->configuration().setBlobStreamer("COND/Services/TBufferBlobStreamingService") ;
00047     session->open() ;
00048     
00049 
00050     // create Coral connection and pool. This ones should be connected on required basis
00051 //     coral = new cond::CoralTransaction (connect, coralSession);
00052 //     pool = new cond::PoolTransaction (connect, catalog, poolSession);
00053 
00054     connection = new cond::Connection( connect ) ;
00055     connection->connect( session ) ;
00056     cond::CoralTransaction& coral = connection->coralTransaction() ;
00057 //     coral = &( connection->coralTransaction() ) ;
00058 //     pool = &( connection->poolTransaction() ) ;
00059 
00060     // and data object
00061     metadata = new cond::MetaData (coral);
00062 
00063     // wsun: need to disconnect?
00064     // connection->disconnect() ;
00065 
00066     // can I use two sessions? One for pool and one for coral? So that I could connect to one and another....
00067     // will sqlite will be happy with transactions?
00068 }

l1t::DataManager::~DataManager (  )  [virtual]

Definition at line 70 of file DataManager.cc.

References connection, cond::Connection::disconnect(), metadata, and session.

00071 {
00072   connection->disconnect() ;
00073 
00074     // detele all in reverse direction
00075     // closing and comminting may be a good idea here
00076     // in case we have exception in some other part between connect/close pairs
00077 
00078     delete metadata;
00079 //     delete pool;
00080 //     delete coral;
00081     delete connection ;
00082 //     delete coralSession;
00083 //     delete poolSession;
00084     delete session ;
00085 }


Member Function Documentation

edm::eventsetup::TypeTag l1t::DataManager::findType ( const std::string &  type  )  const [protected]

Definition at line 87 of file DataManager.cc.

References edm::eventsetup::heterocontainer::HCTypeTag< Group >::findType().

Referenced by l1t::DataReader::createPayload().

00088 {
00089   static edm::eventsetup::TypeTag defaultType;
00090   edm::eventsetup::TypeTag typeTag = edm::eventsetup::TypeTag::findType (type);
00091   
00092   if (typeTag == defaultType)
00093     //throw cond::Exception ("l1t::DataManager::findType")
00094     edm::LogError("L1TriggerDB") << "DataManager::findType() : " << type << " was not found";
00095   
00096   return typeTag;
00097 }

void l1t::DataManager::setDebug ( bool  debug  ) 

Definition at line 100 of file DataManager.cc.

References cond::DBSession::configuration(), cond::Debug, cond::Error, session, and cond::SessionConfiguration::setMessageLevel().

Referenced by DataManager().

00101   {
00102     if( debug )
00103       {
00104         session->configuration().setMessageLevel( cond::Debug ) ;
00105       }
00106     else
00107       {
00108         session->configuration().setMessageLevel( cond::Error ) ;
00109       }
00110   }


Member Data Documentation

cond::Connection* l1t::DataManager::connection [protected]

Definition at line 43 of file DataManager.h.

Referenced by l1t::DataWriter::addMappings(), l1t::DataReader::createPayload(), DataManager(), l1t::DataWriter::findTokenForTag(), l1t::DataReader::loadIntervals(), l1t::OMDSReader::OMDSReader(), l1t::DataReader::payloadToken(), l1t::DataReader::readKey(), l1t::DataReader::readPayload(), l1t::DataWriter::updateIOV(), l1t::DataWriter::writeKey(), l1t::DataWriter::writeKeyList(), l1t::DataWriter::writePayload(), and ~DataManager().

cond::MetaData* l1t::DataManager::metadata [protected]

Definition at line 46 of file DataManager.h.

Referenced by l1t::DataWriter::addMappings(), DataManager(), l1t::DataWriter::findTokenForTag(), l1t::DataReader::loadIntervals(), l1t::DataReader::payloadToken(), and ~DataManager().

cond::DBSession* l1t::DataManager::session [protected]

Definition at line 42 of file DataManager.h.

Referenced by DataManager(), setDebug(), and ~DataManager().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:48:00 2009 for CMSSW by  doxygen 1.5.4