CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DataManager.cc
Go to the documentation of this file.
2 
4 
5 
6 
7 
8 
9 namespace l1t
10 {
11 
13  : session( 0 ),
14  connection( 0 ) {}
15 
16  DataManager::DataManager (const std::string & connectString,
17  const std::string & authenticationPath,
18  bool isOMDS )
19  {
20  connect( connectString, authenticationPath, isOMDS ) ;
21  }
22 
23  void
24  DataManager::connect(const std::string & connectString,
25  const std::string & authenticationPath,
26  bool isOMDS )
27  {
29  setDebug( false ) ;
30 
31  if( !isOMDS )
32  {
35  true ) ;
36  }
37 
38  connection->configuration().setAuthenticationPath( authenticationPath ) ;
40 
42  session->open( connectString, isOMDS ) ;
43 }
44 
46 {
47  // delete all in reverse direction
48  if( connection )
49  connection->close() ;
50  if( session )
51  session->close() ;
52 
53  delete connection ;
54  delete session ;
55 }
56 
58 {
59  static edm::eventsetup::TypeTag defaultType;
61 
62  if (typeTag == defaultType)
63  //throw cond::Exception ("l1t::DataManager::findType")
64  edm::LogError("L1TriggerDB") << "DataManager::findType() : " << type << " was not found";
65 
66  return typeTag;
67 }
68 
69  void
71  {
72  if( debug )
73  {
75  }
76  else
77  {
78  connection->configuration().setMessageLevel( coral::Error ) ;
79  }
80  }
81 }
type
Definition: HCALResponse.h:21
void open(const std::string &connectionString, bool readOnly=false)
Definition: DbSession.cc:159
DbConnectionConfiguration & configuration()
Definition: DbConnection.cc:83
edm::eventsetup::TypeTag findType(const std::string &type) const
Definition: DataManager.cc:57
void connect(const std::string &connectString, const std::string &authenticationPath, bool isOMDS=false)
Definition: DataManager.cc:24
#define debug
Definition: HDRShower.cc:19
DbSession createSession() const
Definition: DbConnection.cc:66
void setAuthenticationPath(const std::string &p)
virtual ~DataManager()
Definition: DataManager.cc:45
cond::DbConnection * connection
Definition: DataManager.h:45
void setDebug(bool debug)
Definition: DataManager.cc:70
const bool Debug
cond::DbSession * session
Definition: DataManager.h:44
static HCTypeTag findType(char const *iTypeName)
find a type based on the types name, if not found will return default HCTypeTag
Definition: HCTypeTag.cc:125