CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Attributes
ReadBase Class Referenceabstract

#include <ReadBase.h>

Public Member Functions

 ReadBase ()
 
virtual void run ()=0
 
void setVerbosityLevel (coral::MsgLevel level)
 
virtual ~ReadBase ()
 

Protected Member Functions

coral::ISessionProxy * connect (const std::string &connectionString, const std::string &user, const std::string &password)
 

Private Attributes

coral::ConnectionService m_connectionService
 

Detailed Description

Definition at line 22 of file ReadBase.h.

Constructor & Destructor Documentation

◆ ReadBase()

ReadBase::ReadBase ( )

Definition at line 12 of file ReadBase.cc.

13  //coral::Context& context = coral::Context::instance();
14  //context.loadComponent( "CORAL/RelationalPlugins/oracle" );
15  //coral::IHandle<coral::IRelationalDomain> domain = context.query<coral::IRelationalDomain>( "CORAL/RelationalPlugins/oracle" );
16  //if ( ! domain.isValid() )
17  // throw std::runtime_error( "Could not load the OracleAccess plugin" );
18 }
coral::ConnectionService m_connectionService
Definition: ReadBase.h:36

◆ ~ReadBase()

ReadBase::~ReadBase ( )
virtual

Definition at line 20 of file ReadBase.cc.

20  {
21  //if ( m_connection ) delete m_connection;
22 }

Member Function Documentation

◆ connect()

coral::ISessionProxy * ReadBase::connect ( const std::string &  connectionString,
const std::string &  user,
const std::string &  password 
)
protected

Definition at line 24 of file ReadBase.cc.

References l1RCTOmdsFedVectorProducer_cfi::connectionString, m_connectionService, AlCaHLTBitMon_QueryRunRegistry::string, and EnviromentSettings::user.

Referenced by o2o_db_cfgmap.DbManagerDAQ::update_hashmap().

26  {
27  //coral::Context& ctx = coral::Context::instance();
28  //coral::IHandle<coral::IRelationalDomain> iHandle=ctx.query<coral::IRelationalDomain>("CORAL/RelationalPlugins/oracle");
29  //if ( ! iHandle.isValid() )
30  // throw std::runtime_error( "Could not load the OracleAccess plugin" );
31  //
32  //std::pair<std::string, std::string> connectionAndSchema = iHandle->decodeUserConnectionString( connectionString );
33  //if ( ! m_connection )
34  // m_connection = iHandle->newConnection( connectionAndSchema.first );
35 
36  //if ( ! m_connection->isConnected() )
37  // m_connection->connect();
38 
39  //coral::ISession* session = m_connection->newSession( connectionAndSchema.second );
40  //if ( session )
41  // session->startUserSession( user, pass );
42  std::string userEnv("CORAL_AUTH_USER=" + user);
43  std::string passEnv("CORAL_AUTH_PASSWORD=" + pass);
44  ::putenv(const_cast<char*>(userEnv.c_str()));
45  ::putenv(const_cast<char*>(passEnv.c_str()));
46  m_connectionService.configuration().setAuthenticationService("CORAL/Services/EnvironmentAuthenticationService");
47  return m_connectionService.connect(connectionString);
48 }
coral::ConnectionService m_connectionService
Definition: ReadBase.h:36

◆ run()

virtual void ReadBase::run ( )
pure virtual

◆ setVerbosityLevel()

void ReadBase::setVerbosityLevel ( coral::MsgLevel  level)

Definition at line 50 of file ReadBase.cc.

References personalPlayback::level.

50 { coral::MessageStream::setMsgVerbosity(level); }

Member Data Documentation

◆ m_connectionService

coral::ConnectionService ReadBase::m_connectionService
private

Definition at line 36 of file ReadBase.h.

Referenced by connect().