#include <CondCore/Utilities/interface/CondPyInterface.h>
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::Logger > | logger |
boost::shared_ptr< DBSession > | session |
Definition at line 62 of file CondPyInterface.h.
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 | ( | ) |
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 }
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 }
boost::shared_ptr<cond::Logger> cond::RDBMS::logger [private] |
boost::shared_ptr<DBSession> cond::RDBMS::session [private] |