CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
sessionManager.sessionManager Class Reference
Inheritance diagram for sessionManager.sessionManager:

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.

8 
9  def __init__(self,connectString,authpath=None,siteconfpath=None,debugON = False):
10  self.__connectString=connectString
11  self.__svc=None
13  usedefaultfrontierconfig = False
14  cacheconfigpath = ''
15  try:
16  self.__connectparser.parse()
17  if self.__connectparser.needsitelocalinfo():
18  if not siteconfpath:
19  cacheconfigpath = os.environ['CMS_PATH']
20  if cacheconfigpath:
21  cacheconfigpath = os.path.join (cacheconfigpath, 'SITECONF', 'local', 'JobConfig', 'site-local-config.xml')
22  else:
23  usedefaultfrontierconfig = True
24  else:
25  cacheconfigpath = siteconfpath
26  cacheconfigpath = os.path.join (cacheconfigpath, 'site-local-config.xml')
28  if usedefaultfrontierconfig:
29  ccp.parseString ( self.defaultfrontierConfigString() )
30  else:
31  ccp.parse (cacheconfigpath)
32  self.__connectString = self.__connectparser.fullfrontierStr(self.__connectparser.schemaname(), ccp.parameterdict())
33  if self.__connectparser.protocol()=='oracle':
34  if authpath:
35  os.environ['CORAL_AUTH_PATH']=authpath
36  else:
37  os.environ['CORAL_AUTH_PATH']='.'
38  if debugON :
39  msg = coral.MessageStream ('')
40  msg.setMsgVerbosity (coral.message_Level_Debug)
41  self.__svc = coral.ConnectionService()
42  except:
43  if self.__svc: del self.__svc
raise
def sessionManager.sessionManager.__del__ (   self)

Definition at line 61 of file sessionManager.py.

References sessionManager.sessionManager.__svc.

61 
62  def __del__(self):
del self.__svc

Member Function Documentation

def sessionManager.sessionManager.defaultfrontierConfigString ( )

Definition at line 5 of file sessionManager.py.

5 
7  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.

References sessionManager.sessionManager.__connectString.

44 
45  def openSession(self,isReadOnly=True,cpp2sqltype=[],sql2cpptype=[] ):
46  try:
47  session=None
48  if self.__connectparser.protocol()=='frontier' or isReadOnly:
49  session = self.__svc.connect(self.__connectString, accessMode = coral.access_ReadOnly)
50  else:
51  session = self.__svc.connect(self.__connectString, accessMode = coral.access_Update)
52  for (cpptype,sqltype) in cpp2sqltype:
53  session.typeConverter().setCppTypeForSqlType(cpptype,sqltype)
54  for (sqltype,cpptype) in sql2cpptype:
55  session.typeConverter().setSqlTypeForCppType(sqltype,cpptype)
56  return session
57  except:
58  if session: del session
raise
def sessionManager.sessionManager.realConnectString (   self)

Definition at line 59 of file sessionManager.py.

References sessionManager.sessionManager.__connectString.

59 
60  def realConnectString(self):
return self.__connectString
def sessionManager.sessionManager.svcHandle (   self)

Definition at line 63 of file sessionManager.py.

References sessionManager.sessionManager.__svc.

63 
64  def svcHandle(self):
65  return self.__svc

Member Data Documentation

sessionManager.sessionManager.__connectparser
private

Definition at line 11 of file sessionManager.py.

sessionManager.sessionManager.__connectString
private

Definition at line 9 of file sessionManager.py.

Referenced by sessionManager.sessionManager.openSession(), and sessionManager.sessionManager.realConnectString().

sessionManager.sessionManager.__svc
private

Definition at line 10 of file sessionManager.py.

Referenced by sessionManager.sessionManager.__del__(), and sessionManager.sessionManager.svcHandle().