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 3 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 46 of file connectstrParser.py.

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

46  def fullfrontierStr(self,schemaname,parameterDict):
47  if len(parameterDict)==0:
48  raise 'empty frontier parameters, cannot construct full connect string'
49  result='frontier://'
50  for k,v in parameterDict.items():
51  ##if attr name=url, concatenate; if attrname=value discard
52  if k=='load' and v[0][0]=='balance':
53  result+='(loadbalance='+v[0][1]+')'
54  continue
55  for (attrname,attrvalue) in v:
56  if attrname=='url':
57  if k=='server':
58  fields=attrvalue.rsplit('/')
59  if len(fields)>3:
60  fields[-1]=self.servlettotranslate()[0]
61  attrvalue='/'.join(fields)
62  result+='('+k+'url='+attrvalue+')'
63  else:
64  result+='('+k+'='+attrvalue+')'
65  if len(self.servlettotranslate())>1:
66  result+=self.servlettotranslate()[1]
67  result+='/'+schemaname
68  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 34 of file connectstrParser.py.

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

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

Definition at line 11 of file connectstrParser.py.

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

11  def parse(self):
12  result=re.match(self.__pattern,self.__connectstr)
13  if result is not None:
14  protocol=result.group(1)
15  if protocol!='frontier' and protocol!='oracle':
16  raise RuntimeError('unsupported technology '+protocol)
17  self.__protocol=protocol
18  self.__schemaname=result.group(5)
19  self.__servicename=result.group(3)
20  if self.__protocol=='frontier':
21  if self.__servicename.find('(')==-1:
22  if self.__servicename.find('/')==-1:
23  self.__servlettotranslate.append(self.__servicename)
24  elif self.__servicename.find('/') == -1:
25  self.__servlettotranslate.append(self.__servicename.split('(',1)[0])
26  self.__servlettotranslate.append('('+self.__servicename.split('(',1)[1])
27 
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 42 of file connectstrParser.py.

References connectstrParser.connectstrParser.__servlettotranslate.

Referenced by connectstrParser.connectstrParser.fullfrontierStr().

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

Member Data Documentation

connectstrParser.connectstrParser.__connectstr
private

Definition at line 5 of file connectstrParser.py.

Referenced by connectstrParser.connectstrParser.parse().

connectstrParser.connectstrParser.__pattern
private

Definition at line 6 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