test
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
python.connectstrParser.connectstrParser Class Reference
Inheritance diagram for python.connectstrParser.connectstrParser:

Public Member Functions

def __init__
 
def fullfrontierStr
 
def needsitelocalinfo
 
def parse
 
def protocol
 
def schemaname
 
def service
 
def servlettotranslate
 

Private Attributes

 __connectstr
 
 __pattern
 
 __protocol
 
 __schemaname
 
 __servicename
 
 __servlettotranslate
 

Detailed Description

Definition at line 2 of file connectstrParser.py.

Constructor & Destructor Documentation

def python.connectstrParser.connectstrParser.__init__ (   self,
  connectstr 
)

Member Function Documentation

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

Definition at line 45 of file connectstrParser.py.

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

45 
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
return result
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def python.connectstrParser.connectstrParser.needsitelocalinfo (   self)

Definition at line 33 of file connectstrParser.py.

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

33 
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:
return False
def python.connectstrParser.connectstrParser.parse (   self)

Definition at line 10 of file connectstrParser.py.

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

10 
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 '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])
def python.connectstrParser.connectstrParser.protocol (   self)

Definition at line 27 of file connectstrParser.py.

References python.connectstrParser.connectstrParser.__protocol.

27 
28  def protocol(self):
return self.__protocol
def python.connectstrParser.connectstrParser.schemaname (   self)

Definition at line 29 of file connectstrParser.py.

References python.connectstrParser.connectstrParser.__schemaname.

29 
30  def schemaname(self):
return self.__schemaname
def python.connectstrParser.connectstrParser.service (   self)

Definition at line 31 of file connectstrParser.py.

References python.connectstrParser.connectstrParser.__servicename.

31 
32  def service(self):
return self.__servicename
def python.connectstrParser.connectstrParser.servlettotranslate (   self)
return a list, first is the servlet name, second is whatever additional parameter, if any.

Definition at line 41 of file connectstrParser.py.

References python.connectstrParser.connectstrParser.__servlettotranslate.

Referenced by python.connectstrParser.connectstrParser.fullfrontierStr(), and connectstrParser.connectstrParser.fullfrontierStr().

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

Member Data Documentation

python.connectstrParser.connectstrParser.__connectstr
private

Definition at line 4 of file connectstrParser.py.

Referenced by python.connectstrParser.connectstrParser.parse(), and connectstrParser.connectstrParser.parse().

python.connectstrParser.connectstrParser.__pattern
private

Definition at line 5 of file connectstrParser.py.

Referenced by python.connectstrParser.connectstrParser.parse(), and connectstrParser.connectstrParser.parse().

python.connectstrParser.connectstrParser.__protocol
private

Definition at line 6 of file connectstrParser.py.

Referenced by python.connectstrParser.connectstrParser.needsitelocalinfo(), connectstrParser.connectstrParser.needsitelocalinfo(), connectstrParser.connectstrParser.parse(), python.connectstrParser.connectstrParser.parse(), python.connectstrParser.connectstrParser.protocol(), and connectstrParser.connectstrParser.protocol().

python.connectstrParser.connectstrParser.__schemaname
private

Definition at line 7 of file connectstrParser.py.

Referenced by python.connectstrParser.connectstrParser.parse(), connectstrParser.connectstrParser.parse(), connectstrParser.connectstrParser.schemaname(), and python.connectstrParser.connectstrParser.schemaname().

python.connectstrParser.connectstrParser.__servicename
private

Definition at line 8 of file connectstrParser.py.

Referenced by python.connectstrParser.connectstrParser.parse(), connectstrParser.connectstrParser.parse(), connectstrParser.connectstrParser.service(), and python.connectstrParser.connectstrParser.service().

python.connectstrParser.connectstrParser.__servlettotranslate
private

Definition at line 9 of file connectstrParser.py.

Referenced by python.connectstrParser.connectstrParser.needsitelocalinfo(), connectstrParser.connectstrParser.needsitelocalinfo(), connectstrParser.connectstrParser.servlettotranslate(), and python.connectstrParser.connectstrParser.servlettotranslate().