CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
connectstrParser.connectstrParser Class Reference
Inheritance diagram for connectstrParser.connectstrParser:

Public Member Functions

def __init__ (self, connectstr)
 
def fullfrontierStr (self, schemaname, parameterDict)
 
def needsitelocalinfo (self)
 
def parse (self)
 
def protocol (self)
 
def schemaname (self)
 
def service (self)
 
def servlettotranslate (self)
 

Private Attributes

 __connectstr
 
 __pattern
 
 __protocol
 
 __schemaname
 
 __servicename
 
 __servlettotranslate
 

Detailed Description

Definition at line 4 of file connectstrParser.py.

Constructor & Destructor Documentation

def connectstrParser.connectstrParser.__init__ (   self,
  connectstr 
)

Member Function Documentation

def connectstrParser.connectstrParser.fullfrontierStr (   self,
  schemaname,
  parameterDict 
)

Definition at line 47 of file connectstrParser.py.

References join(), and connectstrParser.connectstrParser.servlettotranslate().

47  def fullfrontierStr(self,schemaname,parameterDict):
48  if len(parameterDict)==0:
49  raise 'empty frontier parameters, cannot construct full connect string'
50  result='frontier://'
51  for k,v in parameterDict.items():
52  ##if attr name=url, concatenate; if attrname=value discard
53  if k=='load' and v[0][0]=='balance':
54  result+='(loadbalance='+v[0][1]+')'
55  continue
56  for (attrname,attrvalue) in v:
57  if attrname=='url':
58  if k=='server':
59  fields=attrvalue.rsplit('/')
60  if len(fields)>3:
61  fields[-1]=self.servlettotranslate()[0]
62  attrvalue='/'.join(fields)
63  result+='('+k+'url='+attrvalue+')'
64  else:
65  result+='('+k+'='+attrvalue+')'
66  if len(self.servlettotranslate())>1:
67  result+=self.servlettotranslate()[1]
68  result+='/'+schemaname
69  return result
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def fullfrontierStr(self, schemaname, parameterDict)
def connectstrParser.connectstrParser.needsitelocalinfo (   self)

Definition at line 35 of file connectstrParser.py.

References connectstrParser.connectstrParser.__protocol, and connectstrParser.connectstrParser.__servlettotranslate.

35  def needsitelocalinfo(self):
36  if self.__protocol=='frontier':
37  if len(self.__servlettotranslate)==0:
38  return False
39  else :
40  return True
41  else:
42  return False
def connectstrParser.connectstrParser.parse (   self)

Definition at line 12 of file connectstrParser.py.

References connectstrParser.connectstrParser.__connectstr, connectstrParser.connectstrParser.__pattern, connectstrParser.connectstrParser.__protocol, connectstrParser.connectstrParser.__schemaname, and connectstrParser.connectstrParser.__servicename.

12  def parse(self):
13  result=re.match(self.__pattern,self.__connectstr)
14  if result is not None:
15  protocol=result.group(1)
16  if protocol!='frontier' and protocol!='oracle':
17  raise RuntimeError('unsupported technology '+protocol)
18  self.__protocol=protocol
19  self.__schemaname=result.group(5)
20  self.__servicename=result.group(3)
21  if self.__protocol=='frontier':
22  if self.__servicename.find('(')==-1:
23  if self.__servicename.find('/')==-1:
24  self.__servlettotranslate.append(self.__servicename)
25  elif self.__servicename.find('/') == -1:
26  self.__servlettotranslate.append(self.__servicename.split('(',1)[0])
27  self.__servlettotranslate.append('('+self.__servicename.split('(',1)[1])
28 
def connectstrParser.connectstrParser.protocol (   self)
def connectstrParser.connectstrParser.schemaname (   self)
def connectstrParser.connectstrParser.service (   self)
def connectstrParser.connectstrParser.servlettotranslate (   self)
return a list, first is the servlet name, second is whatever additional parameter, if any.

Definition at line 43 of file connectstrParser.py.

References connectstrParser.connectstrParser.__servlettotranslate.

Referenced by connectstrParser.connectstrParser.fullfrontierStr().

43  def servlettotranslate(self):
44  """return a list, first is the servlet name, second is whatever additional parameter, if any.
45  """
46  return self.__servlettotranslate

Member Data Documentation

connectstrParser.connectstrParser.__connectstr
private

Definition at line 6 of file connectstrParser.py.

Referenced by connectstrParser.connectstrParser.parse().

connectstrParser.connectstrParser.__pattern
private

Definition at line 7 of file connectstrParser.py.

Referenced by connectstrParser.connectstrParser.parse().

connectstrParser.connectstrParser.__protocol
private
connectstrParser.connectstrParser.__schemaname
private
connectstrParser.connectstrParser.__servicename
private
connectstrParser.connectstrParser.__servlettotranslate
private