5 self.
__pattern=re.compile(
'(^[\w]+)(://)(.+)(/)(.+)')
12 if result
is not None:
13 protocol=result.group(1)
14 if protocol!=
'frontier' and protocol!=
'oracle':
15 raise 'unsupported technology',protocol
20 if self.__servicename.find(
'(')==-1:
21 if self.__servicename.find(
'/')==-1:
23 elif self.__servicename.find(
'/') == -1:
24 self.__servlettotranslate.append(self.__servicename.split(
'(',1)[0])
25 self.__servlettotranslate.append(
'('+self.__servicename.split(
'(',1)[1])
42 """return a list, first is the servlet name, second is whatever additional parameter, if any.
46 if len(parameterDict)==0:
47 raise 'empty frontier parameters, cannot construct full connect string'
49 for k,v
in parameterDict.items():
51 if k==
'load' and v[0][0]==
'balance':
52 result+=
'(loadbalance='+v[0][1]+
')'
54 for (attrname,attrvalue)
in v:
57 fields=attrvalue.rsplit(
'/')
60 attrvalue=
'/'.
join(fields)
61 result+=
'('+k+
'url='+attrvalue+
')'
63 result+=
'('+k+
'='+attrvalue+
')'
66 result+=
'/'+schemaname
68 if __name__ ==
'__main__':
69 import cacheconfigParser
70 o=
'oracle://cms_orcoff_prep/CMS_LUMI_DEV_OFFLINE'
73 print parser.protocol(),parser.service(),parser.schemaname(),parser.needsitelocalinfo()
75 f1=
'frontier://cmsfrontier.cern.ch:8000/LumiPrep/CMS_LUMI_DEV_OFFLINE'
78 print parser.protocol(),parser.service(),parser.schemaname(),parser.needsitelocalinfo()
80 f2=
'frontier://(serverurl=cmsfrontier.cern.ch:8000/LumiPrep/CMS_LUMI_DEV_OFFLINE)'
83 print parser.protocol(),parser.service(),parser.schemaname(),parser.needsitelocalinfo()
85 f3=
'frontier://(proxyurl=http://cmst0frontier.cern.ch:3128)(proxyurl=http://cmst0frontier.cern.ch:3128)(proxyurl=http://cmst0frontier1.cern.ch:3128)(proxyurl=http://cmst0frontier2.cern.ch:3128)(serverurl=http://cmsfrontier.cern.ch:8000/LumiPrep)(serverurl=http://cmsfrontier.cern.ch:8000)/LumiPrep)(serverurl=http://cmsfrontier1.cern.ch:8000/LumiPrep)(serverurl=http://cmsfrontier2.cern.ch:8000/LumiPrep)(serverurl=http://cmsfrontier3.cern.ch:8000/LumiPrep)(serverurl=http://cmsfrontier4.cern.ch:8000/LumiPrep)/CMS_LUMI_DEV_OFFLINE'
88 print parser.protocol(),parser.service(),parser.schemaname(),parser.needsitelocalinfo()
90 f4=
'frontier://LumiPrep/CMS_LUMI_DEV_OFFLINE'
93 print parser.protocol(),parser.service(),parser.schemaname(),parser.needsitelocalinfo(),parser.servlettotranslate()
94 if parser.needsitelocalinfo():
95 sitelocalconfig=
'/afs/cern.ch/user/x/xiezhen/w1/site-local-config.xml'
97 frontierparser.parse(sitelocalconfig)
98 print 'full frontier string'
99 print parser.fullfrontierStr(parser.schemaname(),frontierparser.parameterdict())
101 f5=
'frontier://LumiPrep(otherparameter=value)/CMS_LUMI_DEV_OFFLINE'
104 print parser.protocol(),parser.service(),parser.schemaname(),parser.needsitelocalinfo(),parser.servlettotranslate()
105 print parser.fullfrontierStr(parser.schemaname(),frontierparser.parameterdict())
107 f6=
'frontier://LumiCalc/CMS_LUMI_PROD'
110 print parser.protocol(),parser.service(),parser.schemaname(),parser.needsitelocalinfo(),parser.servlettotranslate()
111 print parser.fullfrontierStr(parser.schemaname(),frontierparser.parameterdict())
static std::string join(char **cmd)