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 2 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 45 of file connectstrParser.py.

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

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

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

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

Definition at line 10 of file connectstrParser.py.

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

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

References connectstrParser.connectstrParser.__servlettotranslate.

Referenced by connectstrParser.connectstrParser.fullfrontierStr().

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

Member Data Documentation

connectstrParser.connectstrParser.__connectstr
private

Definition at line 4 of file connectstrParser.py.

Referenced by connectstrParser.connectstrParser.parse().

connectstrParser.connectstrParser.__pattern
private

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