CMS 3D CMS Logo

Public Member Functions | Private Attributes

cond::MetaData Class Reference

#include <MetaData.h>

List of all members.

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.

                                                :m_userSession( userSession ){
}
MetaData::~MetaData ( )

Definition at line 33 of file MetaData.cc.

                       {
}

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 exception, and ora::OId::fromString().

Referenced by cond::service::PoolDBOutputService::createNewIOV(), cond::ExportIOVUtilities::execute(), cond::AlignSplitIOV::execute(), TestFunct::Write(), and TestFunct::WriteWithIOV().

                                         {
  try{
    if(!m_userSession.storage().exists()) return false;
    ora::OId oid;
    oid.fromString( iovtoken );
    m_userSession.storage().setObjectName( name, oid );
  }catch( const coral::DuplicateEntryInUniqueKeyException& er ){
    mdDuplicateEntryError("addMapping",name);
  }catch(std::exception& er){
    mdError("MetaData::addMapping",name,er.what());
  }
  return true;
}
void MetaData::deleteAllEntries ( )

Definition at line 92 of file MetaData.cc.

References exception, and Exception.

                              {
  try{
    m_userSession.storage().eraseAllNames();
  }catch(const std::exception& er){
    throw cond::Exception( std::string("MetaData::deleteAllEntries: " )+er.what() );
  }
}
void MetaData::deleteEntryByTag ( const std::string &  tag)

Definition at line 100 of file MetaData.cc.

References exception, and Exception.

Referenced by TestFunct::DropItem().

                                                         {
  try{
    m_userSession.storage().eraseObjectName( tag );   
  }catch(const std::exception& er){
    throw cond::Exception( std::string("MetaData::deleteEntryByTag: " )+er.what() );
  }
}
const std::string MetaData::getToken ( const std::string &  tagname) const

Definition at line 53 of file MetaData.cc.

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

Referenced by TestFunct::DropItem(), cond::ExportIOVUtilities::execute(), cond::AlignSplitIOV::execute(), HcalO2OManager::getListOfPoolIovs(), cond::CondDB::iovToken(), cond::BasePayloadProxy::loadTag(), cond::service::PoolDBOutputService::lookUpRecord(), l1t::DataWriter::payloadToken(), TestFunct::Read(), and TestFunct::ReadWithIOV().

                                                   {
  bool ok=false;
  std::string iovtoken("");
  if(!m_userSession.storage().exists()) return iovtoken;
  try{
    ora::OId oid;
    ok = m_userSession.storage().getItemId( name, oid );
    if(ok) {
      iovtoken = oid.toString();
    }
  }catch(const std::exception& er){
    mdError("MetaData::getToken", name,er.what() );
  }
  if (!ok) mdNoEntry("MetaData::getToken", name);
  return iovtoken;
}
bool MetaData::hasTag ( const std::string &  name) const

Definition at line 70 of file MetaData.cc.

References exception, and query::result.

Referenced by cond::ExportIOVUtilities::execute(), HcalO2OManager::getListOfPoolIovs(), cond::service::PoolDBOutputService::lookUpRecord(), and l1t::DataWriter::payloadToken().

                                                      {
  bool result=false;
  if(!m_userSession.storage().exists()) return result;
  try{
    ora::OId oid;
    result = m_userSession.storage().getItemId( name, oid );
  }catch(const std::exception& er){
    mdError("MetaData::hasTag", name, er.what() );
  }
  return result;
}
void MetaData::listAllTags ( std::vector< std::string > &  result) const

Definition at line 83 of file MetaData.cc.

References exception, and Exception.

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

                                                             {
  try{
    m_userSession.storage().listObjectNames( result );
  }catch(const std::exception& er){
    throw cond::Exception( std::string("MetaData::listAllTags: " )+er.what() );
  }
}

Member Data Documentation

Definition at line 48 of file MetaData.h.