CMS 3D CMS Logo

Public Member Functions | Private Attributes

sessionManager::sessionManager Class Reference

List of all members.

Public Member Functions

def __del__
def __init__
def defaultfrontierConfigString
def openSession
def realConnectString
def svcHandle

Private Attributes

 __connectparser
 __connectString
 __svc

Detailed Description

Definition at line 4 of file sessionManager.py.


Constructor & Destructor Documentation

def sessionManager::sessionManager::__init__ (   self,
  connectString,
  authpath = None,
  siteconfpath = None,
  debugON = False 
)

Definition at line 8 of file sessionManager.py.

00009                                                                                     :
00010         self.__connectString=connectString
00011         self.__svc=None
00012         self.__connectparser=connectstrParser.connectstrParser(self.__connectString)
00013         usedefaultfrontierconfig = False
00014         cacheconfigpath = ''
00015         try:
00016             self.__connectparser.parse()
00017             if self.__connectparser.needsitelocalinfo():
00018                 if not siteconfpath:
00019                     cacheconfigpath = os.environ['CMS_PATH']
00020                     if cacheconfigpath:
00021                         cacheconfigpath = os.path.join (cacheconfigpath, 'SITECONF', 'local', 'JobConfig', 'site-local-config.xml')
00022                     else:
00023                         usedefaultfrontierconfig = True
00024                 else:
00025                     cacheconfigpath = siteconfpath
00026                     cacheconfigpath = os.path.join (cacheconfigpath, 'site-local-config.xml')
00027                 ccp = cacheconfigParser.cacheconfigParser()
00028                 if usedefaultfrontierconfig:
00029                     ccp.parseString ( self.defaultfrontierConfigString() )
00030                 else:
00031                     ccp.parse (cacheconfigpath)
00032                 self.__connectString = self.__connectparser.fullfrontierStr(self.__connectparser.schemaname(), ccp.parameterdict())
00033             if self.__connectparser.protocol()=='oracle':
00034                 if authpath:
00035                     os.environ['CORAL_AUTH_PATH']=authpath
00036                 else:
00037                     os.environ['CORAL_AUTH_PATH']='.'
00038             if debugON :
00039                 msg = coral.MessageStream ('')
00040                 msg.setMsgVerbosity (coral.message_Level_Debug)            
00041             self.__svc = coral.ConnectionService()
00042         except:
00043             if self.__svc: del self.__svc
            raise
def sessionManager::sessionManager::__del__ (   self)

Definition at line 61 of file sessionManager.py.

00062                      :
        del self.__svc

Member Function Documentation

def sessionManager::sessionManager::defaultfrontierConfigString ( )

Definition at line 5 of file sessionManager.py.

00006                                       :
00007         return '''<frontier-connect><proxy url = "http://cmst0frontier.cern.ch:3128"/><proxy url = "http://cmst0frontier.cern.ch:3128"/><proxy url = "http://cmst0frontier1.cern.ch:3128"/><proxy url = "http://cmst0frontier2.cern.ch:3128"/><server url = "http://cmsfrontier.cern.ch:8000/FrontierInt"/><server url = "http://cmsfrontier.cern.ch:8000/FrontierInt"/><server url = "http://cmsfrontier1.cern.ch:8000/FrontierInt"/><server url = "http://cmsfrontier2.cern.ch:8000/FrontierInt"/><server url = "http://cmsfrontier3.cern.ch:8000/FrontierInt"/><server url = "http://cmsfrontier4.cern.ch:8000/FrontierInt"/></frontier-connect>'''
    
def sessionManager::sessionManager::openSession (   self,
  isReadOnly = True,
  cpp2sqltype = [],
  sql2cpptype = [] 
)

Definition at line 44 of file sessionManager.py.

00045                                                                         :
00046         try:
00047             session=None
00048             if self.__connectparser.protocol()=='frontier' or isReadOnly:
00049                 session = self.__svc.connect(self.__connectString, accessMode = coral.access_ReadOnly)
00050             else:
00051                 session = self.__svc.connect(self.__connectString, accessMode = coral.access_Update)
00052             for (cpptype,sqltype) in cpp2sqltype:
00053                 session.typeConverter().setCppTypeForSqlType(cpptype,sqltype)
00054             for (sqltype,cpptype) in sql2cpptype:
00055                 session.typeConverter().setSqlTypeForCppType(sqltype,cpptype)
00056             return session
00057         except:
00058             if session: del session
            raise
def sessionManager::sessionManager::realConnectString (   self)

Definition at line 59 of file sessionManager.py.

00060                                :
        return self.__connectString
def sessionManager::sessionManager::svcHandle (   self)

Definition at line 63 of file sessionManager.py.

00064                        :
00065         return self.__svc


Member Data Documentation

Definition at line 8 of file sessionManager.py.

Definition at line 8 of file sessionManager.py.

Definition at line 8 of file sessionManager.py.