CMS 3D CMS Logo

cond::RDBMS Class Reference

#include <CondCore/Utilities/interface/CondPyInterface.h>

List of all members.

Public Member Functions

CondDB getDB (std::string const &db)
 RDBMS (std::string const &user, std::string const &pass)
 RDBMS (std::string const &authPath)
 RDBMS ()
void setLogger (std::string const &connstr)
 ~RDBMS ()

Private Attributes

boost::shared_ptr< cond::Loggerlogger
boost::shared_ptr< DBSessionsession


Detailed Description

Definition at line 62 of file CondPyInterface.h.


Constructor & Destructor Documentation

cond::RDBMS::RDBMS (  ) 

Definition at line 183 of file CondPyInterface.cc.

References cond::Error, session, and cond::XML.

00183                : session(new DBSession) {
00184     session->configuration().setAuthenticationMethod( cond::XML );
00185     session->configuration().setMessageLevel( cond::Error );
00186     session->open();
00187   }

cond::RDBMS::~RDBMS (  ) 

Definition at line 188 of file CondPyInterface.cc.

00188 {}

cond::RDBMS::RDBMS ( std::string const &  authPath  )  [explicit]

Definition at line 190 of file CondPyInterface.cc.

References cond::Error, session, and cond::XML.

00190                                          : session(new DBSession) {
00191     std::string authenv(std::string("CORAL_AUTH_PATH=")+authPath);
00192     ::putenv(const_cast<char*>(authenv.c_str()));
00193     session->configuration().setAuthenticationMethod( cond::XML );
00194     session->configuration().setMessageLevel( cond::Error );
00195     session->open();
00196   }

cond::RDBMS::RDBMS ( std::string const &  user,
std::string const &  pass 
)

Definition at line 198 of file CondPyInterface.cc.

References cond::Env, cond::Error, and session.

00198                                                             : session(new DBSession) {
00199     std::string userenv(std::string("CORAL_AUTH_USER=")+user);
00200     std::string passenv(std::string("CORAL_AUTH_PASSWORD=")+pass);
00201     ::putenv(const_cast<char*>(userenv.c_str()));
00202     ::putenv(const_cast<char*>(passenv.c_str()));
00203     session->configuration().setAuthenticationMethod( cond::Env );
00204     session->configuration().setMessageLevel( cond::Error );
00205     session->open();
00206   }


Member Function Documentation

CondDB cond::RDBMS::getDB ( std::string const &  db  ) 

Definition at line 217 of file CondPyInterface.cc.

References cond::Connection::connect(), cond::ConnectionHandler::getConnection(), cond::ConnectionHandler::Instance(), logger, cond::ConnectionHandler::registerConnection(), and session.

Referenced by BOOST_PYTHON_MODULE().

00217                                           {
00218     cond::ConnectionHandler::Instance().registerConnection(db,*session,-1);
00219     cond::Connection & conn = *cond::ConnectionHandler::Instance().getConnection(db);
00220     conn.connect(session.get());
00221     return CondDB(&conn,logger);
00222   }

void cond::RDBMS::setLogger ( std::string const &  connstr  ) 

Definition at line 208 of file CondPyInterface.cc.

References cond::Connection::connect(), cond::ConnectionHandler::getConnection(), cond::ConnectionHandler::Instance(), logger, cond::ConnectionHandler::registerConnection(), and session.

Referenced by BOOST_PYTHON_MODULE().

00208                                                  {
00209     cond::ConnectionHandler::Instance().registerConnection(connstr,*session,-1);
00210     cond::Connection & conn = *cond::ConnectionHandler::Instance().getConnection(connstr);
00211     conn.connect(session.get());
00212     logger.reset(new cond::Logger(&conn));
00213   }


Member Data Documentation

boost::shared_ptr<cond::Logger> cond::RDBMS::logger [private]

Definition at line 74 of file CondPyInterface.h.

Referenced by getDB(), and setLogger().

boost::shared_ptr<DBSession> cond::RDBMS::session [private]

Definition at line 73 of file CondPyInterface.h.

Referenced by getDB(), RDBMS(), and setLogger().


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