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
cond::MetaData Class Reference

#include <MetaData.h>

Public Member Functions

bool addMapping (const std::string &name, const std::string &token, cond::TimeType timetype=cond::runnumber)
 
void deleteAllEntries ()
 
void deleteEntryByTag (const std::string &tag)
 
const std::string getToken (const std::string &tagname) const
 
bool hasTag (const std::string &name) const
 
void listAllTags (std::vector< std::string > &result) const
 
 MetaData (cond::DbSession &userSession)
 
 ~MetaData ()
 

Private Attributes

cond::DbSession m_userSession
 

Detailed Description

Definition at line 19 of file MetaData.h.

Constructor & Destructor Documentation

MetaData::MetaData ( cond::DbSession userSession)
explicit

Definition at line 31 of file MetaData.cc.

31  :m_userSession( userSession ){
32 }
cond::DbSession m_userSession
Definition: MetaData.h:48
MetaData::~MetaData ( )

Definition at line 33 of file MetaData.cc.

33  {
34 }

Member Function Documentation

bool MetaData::addMapping ( const std::string &  name,
const std::string &  token,
cond::TimeType  timetype = cond::runnumber 
)

Definition at line 36 of file MetaData.cc.

References cppFunctionSkipper::exception, and ora::OId::fromString().

Referenced by cond::persistency::IOVCache::addTag(), cond::ExportIOVUtilities::execute(), cond::AlignSplitIOV::execute(), TestFunct::Write(), and TestFunct::WriteWithIOV().

38  {
39  try{
40  ora::OId oid;
41  oid.fromString( iovtoken );
43  }catch( const coral::DuplicateEntryInUniqueKeyException& er ){
44  mdDuplicateEntryError("addMapping",name);
45  }catch(std::exception& er){
46  mdError("MetaData::addMapping",name,er.what());
47  }
48  return true;
49 }
Definition: OId.h:8
cond::DbSession m_userSession
Definition: MetaData.h:48
bool fromString(const std::string &s)
Definition: OId.cc:64
ora::Database & storage()
Definition: DbSession.cc:215
void setObjectName(const std::string &name, const OId &oid)
Definition: Database.cc:332
void MetaData::deleteAllEntries ( )

Definition at line 89 of file MetaData.cc.

References cppFunctionSkipper::exception, edm::hlt::Exception, and AlCaHLTBitMon_QueryRunRegistry::string.

89  {
90  try{
92  }catch(const std::exception& er){
93  throw cond::Exception( std::string("MetaData::deleteAllEntries: " )+er.what() );
94  }
95 }
cond::DbSession m_userSession
Definition: MetaData.h:48
bool eraseAllNames()
Definition: Database.cc:342
ora::Database & storage()
Definition: DbSession.cc:215
void MetaData::deleteEntryByTag ( const std::string &  tag)

Definition at line 97 of file MetaData.cc.

References cppFunctionSkipper::exception, edm::hlt::Exception, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by TestFunct::DropItem().

97  {
98  try{
100  }catch(const std::exception& er){
101  throw cond::Exception( std::string("MetaData::deleteEntryByTag: " )+er.what() );
102  }
103 }
cond::DbSession m_userSession
Definition: MetaData.h:48
bool eraseObjectName(const std::string &name)
Definition: Database.cc:337
ora::Database & storage()
Definition: DbSession.cc:215
const std::string MetaData::getToken ( const std::string &  tagname) const

Definition at line 52 of file MetaData.cc.

References cppFunctionSkipper::exception, convertSQLiteXML::ok, AlCaHLTBitMon_QueryRunRegistry::string, and ora::OId::toString().

Referenced by TestFunct::DropItem(), cond::ExportIOVUtilities::execute(), cond::AlignSplitIOV::execute(), HcalO2OManager::getListOfPoolIovs(), cond::persistency::IOVCache::getToken(), cond::CondDB::iovToken(), cond::BasePayloadProxy::loadTag(), TestFunct::Read(), and TestFunct::ReadWithIOV().

52  {
53  bool ok=false;
54  std::string iovtoken("");
55  try{
56  ora::OId oid;
57  ok = m_userSession.storage().getItemId( name, oid );
58  if(ok) {
59  iovtoken = oid.toString();
60  }
61  }catch(const std::exception& er){
62  mdError("MetaData::getToken", name,er.what() );
63  }
64  if (!ok) mdNoEntry("MetaData::getToken", name);
65  return iovtoken;
66 }
bool getItemId(const std::string &name, OId &destination)
Definition: Database.cc:347
Definition: OId.h:8
cond::DbSession m_userSession
Definition: MetaData.h:48
std::string toString() const
Definition: OId.cc:58
ora::Database & storage()
Definition: DbSession.cc:215
bool MetaData::hasTag ( const std::string &  name) const

Definition at line 68 of file MetaData.cc.

References cppFunctionSkipper::exception, and query::result.

Referenced by cond::ExportIOVUtilities::execute(), cond::persistency::IOVCache::existsTag(), and HcalO2OManager::getListOfPoolIovs().

68  {
69  bool result=false;
70  try{
71  ora::OId oid;
72  result = m_userSession.storage().getItemId( name, oid );
73  }catch(const std::exception& er){
74  mdError("MetaData::hasTag", name, er.what() );
75  }
76  return result;
77 }
bool getItemId(const std::string &name, OId &destination)
Definition: Database.cc:347
Definition: OId.h:8
cond::DbSession m_userSession
Definition: MetaData.h:48
tuple result
Definition: query.py:137
ora::Database & storage()
Definition: DbSession.cc:215
void MetaData::listAllTags ( std::vector< std::string > &  result) const

Definition at line 80 of file MetaData.cc.

References cppFunctionSkipper::exception, edm::hlt::Exception, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by cond::CondDB::allTags(), HcalO2OManager::getListOfPoolTags(), and TestFunct::ReadAll().

80  {
81  try{
83  }catch(const std::exception& er){
84  throw cond::Exception( std::string("MetaData::listAllTags: " )+er.what() );
85  }
86 }
cond::DbSession m_userSession
Definition: MetaData.h:48
tuple result
Definition: query.py:137
bool listObjectNames(std::vector< std::string > &destination)
Definition: Database.cc:372
ora::Database & storage()
Definition: DbSession.cc:215

Member Data Documentation

cond::DbSession cond::MetaData::m_userSession
mutableprivate

Definition at line 48 of file MetaData.h.