Produced by Araxis Merge on 6/9/2017 3:50:04 PM Eastern Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | Fri Jun 9 19:50:04 2017 UTC | ||
| 2 | eHealth_Exch (eHealth Exchange Enhancements) Build 3 docs & code_May_2017.zip\VAP_CIF_CODE0502.zip\VAP_CIF_CODE0502\VAP_CIF_CODE0502\nvap-env\src\main\python\util | domainconfig.py | Fri Apr 21 20:03:26 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 0 | 0 |
| Changed | 0 | 0 |
| Inserted | 1 | 575 |
| Removed | 0 | 0 |
| Whitespace | |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
| 1 | from weblo gic.descri ptor impor t BeanAlre adyExistsE xception | |||||
| 2 | from java. lang.refle ct import Undeclared ThrowableE xception | |||||
| 3 | from java. lang impor t System, IllegalArg umentExcep tion | |||||
| 4 | import jav ax | |||||
| 5 | from javax import ma nagement | |||||
| 6 | from javax .managemen t import M BeanExcept ion | |||||
| 7 | from javax .managemen t import R untimeMBea nException | |||||
| 8 | import jav ax.managem ent.MBeanE xception | |||||
| 9 | from java. lang impor t Unsuppor tedOperati onExceptio n | |||||
| 10 | import os | |||||
| 11 | import sys | |||||
| 12 | import wl | |||||
| 13 | ||||||
| 14 | def initCo nfigToScri ptRun(doma inName, do mainDirect ory, admin Server, ov erwrite='t rue'): | |||||
| 15 | global s tartedNewS erver | |||||
| 16 | wl.hideD isplay() | |||||
| 17 | wl.hideD umpStack(" true") | |||||
| 18 | ||||||
| 19 | # try co nnecting t o a runnin g server i f it is al ready runn ing ... | |||||
| 20 | if wl.co nnected==" false": | |||||
| 21 | try: | |||||
| 22 | wl.c onnect(adm inServer[' username'] , adminSer ver['passw ord'], adm inServer[' url']) | |||||
| 23 | except wl.WLSTEx ception: | |||||
| 24 | prin t 'No serv er is runn ing at '+a dminServer ['url']+', the scrip t will sta rt a new s erver' | |||||
| 25 | ||||||
| 26 | wl.hideD umpStack(" false") | |||||
| 27 | if wl.co nnected==" false": | |||||
| 28 | print 'Starting a brand ne w server a t '+adminS erver['url ']+' with server nam e '+adminS erver['nam e'] | |||||
| 29 | print 'Please se e the serv er log fil es for sta rtup messa ges availa ble at '+d omainDirec tory | |||||
| 30 | # If a config.xm l exists i n the doma inDir, WLS T will use that conf ig.xml to bring up t he server. | |||||
| 31 | # If y ou would l ike WLST t o overwrit e this dir ectory, yo u should s pecify ove rWriteRoot Dir='true' as shown below | |||||
| 32 | # star tServer(ad minServerN ame, domNa me, URL, u serName, p assWord,do mainDir, o verWriteRo otDir='tru e') | |||||
| 33 | # If y ou want to specify a dditional JVM argume nts, set t hem using startServe rJvmArgs i n the prop erty file or below | |||||
| 34 | wl.sta rtServer(a dminServer ['name'], domainName , adminSer ver['url'] , adminSer ver['usern ame'], adm inServer[' password'] , domainDi rectory, t imeout=240 000, block ='true', o verWriteRo otDir=over write, jvm Args=" -Xm s256m -Xmx 256m -XX:M axPermSize =512m") | |||||
| 35 | starte dNewServer =1 | |||||
| 36 | ||||||
| 37 | print "Started S erver. Try ing to con nect to th e server . .. " | |||||
| 38 | wl.con nect(admin Server['us ername'], adminServe r['passwor d'], admin Server['ur l']) | |||||
| 39 | print 'Connected to server .' | |||||
| 40 | if wl. connected= ='false': | |||||
| 41 | wl.s topExecuti on('You ne ed to be c onnected.' ) | |||||
| 42 | ||||||
| 43 | def startT ransaction (): | |||||
| 44 | wl.edit( ) | |||||
| 45 | wl.start Edit() | |||||
| 46 | ||||||
| 47 | def endTra nsaction() : | |||||
| 48 | wl.start Edit() | |||||
| 49 | wl.save( ) | |||||
| 50 | wl.activ ate(block= "true") | |||||
| 51 | ||||||
| 52 | from javax .managemen t import I nstanceAlr eadyExists Exception | |||||
| 53 | from java. lang impor t Exceptio n, Class, String | |||||
| 54 | from jarra y import a rray | |||||
| 55 | ||||||
| 56 | def endOfC onfigToScr iptRun(): | |||||
| 57 | global s tartedNewS erver | |||||
| 58 | #Save th e changes you have m ade | |||||
| 59 | # shutdo wn the ser ver you ha ve started | |||||
| 60 | if start edNewServe r==1: | |||||
| 61 | print 'Shutting down the s erver that is starte d... ' | |||||
| 62 | wl.shu tdown(forc e='true', block='tru e') | |||||
| 63 | print 'D one execut ing the sc ript.' | |||||
| 64 | ||||||
| 65 | def create _Server(pa th, beanNa me, listen Port = "70 00", liste nAddress = ""): | |||||
| 66 | wl.cd(pa th) | |||||
| 67 | try: | |||||
| 68 | print "creating mbean of t ype Server ... " | |||||
| 69 | server Bean = wl. cmo.lookup Server(bea nName) | |||||
| 70 | if ser verBean == None: | |||||
| 71 | pr int "creat eing Serve r mbean: " + beanNam e | |||||
| 72 | se rverBean = wl.cmo.cr eateServer (beanName) | |||||
| 73 | ||||||
| 74 | # set the proper ties for t he server | |||||
| 75 | wl.cd( path + "Se rvers/" + beanName) | |||||
| 76 | #ls() | |||||
| 77 | print "setting a ttributes for mbean type Serve r" | |||||
| 78 | wl.set ("ListenPo rt", liste nPort) | |||||
| 79 | wl.set ("ListenAd dress", li stenAddres s) | |||||
| 80 | ||||||
| 81 | ||||||
| 82 | except j ava.lang.U nsupported OperationE xception, usoe: | |||||
| 83 | pass | |||||
| 84 | except w eblogic.de scriptor.B eanAlready ExistsExce ption,bae: | |||||
| 85 | pass | |||||
| 86 | except j ava.lang.r eflect.Und eclaredThr owableExce ption,udt: | |||||
| 87 | pass | |||||
| 88 | ||||||
| 89 | def setMan agedServer Attributes (msName, c lusterName , machineN ame): | |||||
| 90 | print "Setting a ttributes for manage d server: " + msName | |||||
| 91 | wl.cd( "/Servers/ " + msName ) | |||||
| 92 | wl.set ("JavaComp iler", "ja vac") | |||||
| 93 | wl.set ("ListenPo rtEnabled" , "true") | |||||
| 94 | wl.set ("ListenAd dress", "" ) | |||||
| 95 | wl.set ("ClientCe rtProxyEna bled", "fa lse") | |||||
| 96 | ||||||
| 97 | if clu sterName ! = None and clusterNa me != "": | |||||
| 98 | pr int "Clust er name = " + cluste rName | |||||
| 99 | be an = wl.ge tMBean("/C lusters/" + clusterN ame) | |||||
| 100 | wl .cmo.setCl uster(bean ) | |||||
| 101 | ||||||
| 102 | if mac hineName ! = None and machineNa me != "": | |||||
| 103 | be an = wl.ge tMBean("/M achines/" + machineN ame) | |||||
| 104 | wl .cmo.setMa chine(bean ) | |||||
| 105 | ||||||
| 106 | def create _Migratabl eTarget(pa th, beanNa me): | |||||
| 107 | wl.cd(pa th) | |||||
| 108 | try: | |||||
| 109 | print "creating mbean of t ype Migrat ableTarget ... " | |||||
| 110 | theBea n = wl.cmo .lookupMig ratableTar get(beanNa me) | |||||
| 111 | if the Bean == No ne: | |||||
| 112 | wl.c mo.createM igratableT arget(bean Name) | |||||
| 113 | except j ava.lang.U nsupported OperationE xception, usoe: | |||||
| 114 | pass | |||||
| 115 | except w eblogic.de scriptor.B eanAlready ExistsExce ption,bae: | |||||
| 116 | pass | |||||
| 117 | except j ava.lang.r eflect.Und eclaredThr owableExce ption,udt: | |||||
| 118 | pass | |||||
| 119 | ||||||
| 120 | def setMig ratableTag etAttribut esFor(mana gedServer, clusterNa me): | |||||
| 121 | wl.cd("/ Migratable Targets/" + managedS erver + " (migratabl e)") | |||||
| 122 | print "s etting att ributes fo r mbean ty pe Migrata bleTarget " + manage dServer | |||||
| 123 | wl.set(" Notes", "T his is a s ystem gene rated defa ult migrat able targe t for a se rver. Do n ot delete manually." ) | |||||
| 124 | bean = w l.getMBean ("/Cluster s/" + clus terName) | |||||
| 125 | wl.cmo.s etCluster( bean) | |||||
| 126 | ||||||
| 127 | bean = w l.getMBean ("/Servers /" + manag edServer) | |||||
| 128 | wl.cmo.s etUserPref erredServe r(bean) | |||||
| 129 | ||||||
| 130 | def create _FileStore (path, bea nName): | |||||
| 131 | wl.cd(pa th) | |||||
| 132 | try: | |||||
| 133 | print "creating mbean of t ype FileSt ore ... " | |||||
| 134 | theBea n = wl.cmo .lookupFil eStore(bea nName) | |||||
| 135 | if the Bean == No ne: | |||||
| 136 | wl.c mo.createF ileStore(b eanName) | |||||
| 137 | except j ava.lang.U nsupported OperationE xception, usoe: | |||||
| 138 | pass | |||||
| 139 | except w eblogic.de scriptor.B eanAlready ExistsExce ption,bae: | |||||
| 140 | pass | |||||
| 141 | except j ava.lang.r eflect.Und eclaredThr owableExce ption,udt: | |||||
| 142 | pass | |||||
| 143 | ||||||
| 144 | def setJMS FileStoreA ttributes( domainDire ctory, man agedServer Name, file StoreName ): | |||||
| 145 | wl.cd("/ FileStores /" + fileS toreName) | |||||
| 146 | print "s etting att ributes fo r mbean ty pe FileSto re " + fil eStoreName | |||||
| 147 | wl.set(" Synchronou sWritePoli cy", "Dire ct-Write") | |||||
| 148 | ||||||
| 149 | filestor eLocation = domainDi rectory + "/filestor es" | |||||
| 150 | ||||||
| 151 | wl.set(" Directory" , filestor eLocation) | |||||
| 152 | refBean0 = wl.getM Bean("/Ser vers/" + m anagedServ erName) | |||||
| 153 | theValue = array([ refBean0], Class.for Name("webl ogic.manag ement.conf iguration. TargetMBea n")) | |||||
| 154 | wl.cmo.s etTargets( theValue) | |||||
| 155 | ||||||
| 156 | def create _Realm(pat h, beanNam e): | |||||
| 157 | wl.cd(pa th) | |||||
| 158 | try: | |||||
| 159 | print "creating mbean of t ype Realm ... " | |||||
| 160 | theBea n = wl.cmo .lookupRea lm(beanNam e) | |||||
| 161 | if the Bean == No ne: | |||||
| 162 | wl.c mo.createR ealm(beanN ame) | |||||
| 163 | except j ava.lang.U nsupported OperationE xception, usoe: | |||||
| 164 | pass | |||||
| 165 | except w eblogic.de scriptor.B eanAlready ExistsExce ption,bae: | |||||
| 166 | pass | |||||
| 167 | except j ava.lang.r eflect.Und eclaredThr owableExce ption,udt: | |||||
| 168 | pass | |||||
| 169 | ||||||
| 170 | def create _Authorize r(path, be anName): | |||||
| 171 | wl.cd(pa th) | |||||
| 172 | try: | |||||
| 173 | print "creating mbean of t ype Author izer ... " | |||||
| 174 | theBea n = wl.cmo .lookupAut horizer(be anName) | |||||
| 175 | if the Bean == No ne: | |||||
| 176 | wl.c mo.createA uthorizer( beanName," weblogic.s ecurity.pr oviders.xa cml.author ization.XA CMLAuthori zer") | |||||
| 177 | except j ava.lang.U nsupported OperationE xception, usoe: | |||||
| 178 | pass | |||||
| 179 | except w eblogic.de scriptor.B eanAlready ExistsExce ption,bae: | |||||
| 180 | pass | |||||
| 181 | except j ava.lang.r eflect.Und eclaredThr owableExce ption,udt: | |||||
| 182 | pass | |||||
| 183 | ||||||
| 184 | def create _Adjudicat or(path, b eanName): | |||||
| 185 | wl.cd(pa th) | |||||
| 186 | try: | |||||
| 187 | print "creating mbean of t ype Adjudi cator ... " | |||||
| 188 | theBea n = wl.cmo .getAdjudi cator() | |||||
| 189 | if the Bean == No ne: | |||||
| 190 | wl.c mo.createA djudicator (beanName, "weblogic. security.p roviders.a uthorizati on.Default Adjudicato r") | |||||
| 191 | except j ava.lang.U nsupported OperationE xception, usoe: | |||||
| 192 | pass | |||||
| 193 | except w eblogic.de scriptor.B eanAlready ExistsExce ption,bae: | |||||
| 194 | pass | |||||
| 195 | except j ava.lang.r eflect.Und eclaredThr owableExce ption,udt: | |||||
| 196 | pass | |||||
| 197 | ||||||
| 198 | def create _Authentic ationProvi der(path, beanName): | |||||
| 199 | wl.cd(pa th) | |||||
| 200 | try: | |||||
| 201 | print "creating mbean of t ype Authen ticationPr ovider ... " | |||||
| 202 | theBea n = wl.cmo .lookupAut henticatio nProvider( beanName) | |||||
| 203 | if the Bean == No ne: | |||||
| 204 | wl.c mo.createA uthenticat ionProvide r(beanName ,"weblogic .security. providers. authentica tion.Defau ltAuthenti cator") | |||||
| 205 | except j ava.lang.U nsupported OperationE xception, usoe: | |||||
| 206 | pass | |||||
| 207 | except w eblogic.de scriptor.B eanAlready ExistsExce ption,bae: | |||||
| 208 | pass | |||||
| 209 | except j ava.lang.r eflect.Und eclaredThr owableExce ption,udt: | |||||
| 210 | pass | |||||
| 211 | ||||||
| 212 | def create _CertPathP rovider(pa th, beanNa me): | |||||
| 213 | wl.cd(pa th) | |||||
| 214 | try: | |||||
| 215 | print "creating mbean of t ype CertPa thProvider ... " | |||||
| 216 | theBea n = wl.cmo .lookupCer tPathProvi der(beanNa me) | |||||
| 217 | if the Bean == No ne: | |||||
| 218 | wl.c mo.createC ertPathPro vider(bean Name,"webl ogic.secur ity.provid ers.pk.Web LogicCertP athProvide r") | |||||
| 219 | except j ava.lang.U nsupported OperationE xception, usoe: | |||||
| 220 | pass | |||||
| 221 | except w eblogic.de scriptor.B eanAlready ExistsExce ption,bae: | |||||
| 222 | pass | |||||
| 223 | except j ava.lang.r eflect.Und eclaredThr owableExce ption,udt: | |||||
| 224 | pass | |||||
| 225 | ||||||
| 226 | def create _Credentia lMapper(pa th, beanNa me): | |||||
| 227 | wl.cd(pa th) | |||||
| 228 | try: | |||||
| 229 | print "creating mbean of t ype Creden tialMapper ... " | |||||
| 230 | theBea n = wl.cmo .lookupCre dentialMap per(beanNa me) | |||||
| 231 | if the Bean == No ne: | |||||
| 232 | wl.c mo.createC redentialM apper(bean Name,"webl ogic.secur ity.provid ers.creden tials.Defa ultCredent ialMapper" ) | |||||
| 233 | except j ava.lang.U nsupported OperationE xception, usoe: | |||||
| 234 | pass | |||||
| 235 | except w eblogic.de scriptor.B eanAlready ExistsExce ption,bae: | |||||
| 236 | pass | |||||
| 237 | except j ava.lang.r eflect.Und eclaredThr owableExce ption,udt: | |||||
| 238 | pass | |||||
| 239 | ||||||
| 240 | def create _RoleMappe r(path, be anName): | |||||
| 241 | wl.cd(pa th) | |||||
| 242 | try: | |||||
| 243 | print "creating mbean of t ype RoleMa pper ... " | |||||
| 244 | theBea n = wl.cmo .lookupRol eMapper(be anName) | |||||
| 245 | if the Bean == No ne: | |||||
| 246 | wl.c mo.createR oleMapper( beanName," weblogic.s ecurity.pr oviders.xa cml.author ization.XA CMLRoleMap per") | |||||
| 247 | except j ava.lang.U nsupported OperationE xception, usoe: | |||||
| 248 | pass | |||||
| 249 | except w eblogic.de scriptor.B eanAlready ExistsExce ption,bae: | |||||
| 250 | pass | |||||
| 251 | except j ava.lang.r eflect.Und eclaredThr owableExce ption,udt: | |||||
| 252 | pass | |||||
| 253 | ||||||
| 254 | def create _Machine(p ath, beanN ame): | |||||
| 255 | wl.cd(pa th) | |||||
| 256 | try: | |||||
| 257 | print "creating mbean of t ype Machin e ... " | |||||
| 258 | theBea n = wl.cmo .lookupMac hine(beanN ame) | |||||
| 259 | if the Bean == No ne: | |||||
| 260 | wl.c mo.createM achine(bea nName) | |||||
| 261 | except j ava.lang.U nsupported OperationE xception, usoe: | |||||
| 262 | pass | |||||
| 263 | except w eblogic.de scriptor.B eanAlready ExistsExce ption,bae: | |||||
| 264 | pass | |||||
| 265 | except j ava.lang.r eflect.Und eclaredThr owableExce ption,udt: | |||||
| 266 | pass | |||||
| 267 | ||||||
| 268 | def create _Cluster(p ath, beanN ame): | |||||
| 269 | wl.cd(pa th) | |||||
| 270 | try: | |||||
| 271 | print "creating mbean of t ype Cluste r ... " | |||||
| 272 | theBea n = wl.cmo .lookupClu ster(beanN ame) | |||||
| 273 | if the Bean == No ne: | |||||
| 274 | wl.c mo.createC luster(bea nName) | |||||
| 275 | except j ava.lang.U nsupported OperationE xception, usoe: | |||||
| 276 | pass | |||||
| 277 | except w eblogic.de scriptor.B eanAlready ExistsExce ption,bae: | |||||
| 278 | pass | |||||
| 279 | except j ava.lang.r eflect.Und eclaredThr owableExce ption,udt: | |||||
| 280 | pass | |||||
| 281 | ||||||
| 282 | def create _JMSServer (path, bea nName): | |||||
| 283 | wl.cd(pa th) | |||||
| 284 | try: | |||||
| 285 | print "creating mbean of t ype JMSSer ver ... " | |||||
| 286 | theBea n = wl.cmo .lookupJMS Server(bea nName) | |||||
| 287 | if the Bean == No ne: | |||||
| 288 | wl.c mo.createJ MSServer(b eanName) | |||||
| 289 | except j ava.lang.U nsupported OperationE xception, usoe: | |||||
| 290 | pass | |||||
| 291 | except w eblogic.de scriptor.B eanAlready ExistsExce ption,bae: | |||||
| 292 | pass | |||||
| 293 | except j ava.lang.r eflect.Und eclaredThr owableExce ption,udt: | |||||
| 294 | pass | |||||
| 295 | ||||||
| 296 | def create _JDBCSyste mResource( path, bean Name): | |||||
| 297 | wl.cd(pa th) | |||||
| 298 | try: | |||||
| 299 | print "creating mbean of t ype JDBCSy stemResour ce ... " | |||||
| 300 | theBea n = wl.cmo .lookupJDB CSystemRes ource(bean Name) | |||||
| 301 | if the Bean == No ne: | |||||
| 302 | wl.c mo.createJ DBCSystemR esource(be anName) | |||||
| 303 | except j ava.lang.U nsupported OperationE xception, usoe: | |||||
| 304 | pass | |||||
| 305 | except w eblogic.de scriptor.B eanAlready ExistsExce ption,bae: | |||||
| 306 | pass | |||||
| 307 | except j ava.lang.r eflect.Und eclaredThr owableExce ption,udt: | |||||
| 308 | pass | |||||
| 309 | ||||||
| 310 | def create _Property( path, bean Name): | |||||
| 311 | wl.cd(pa th) | |||||
| 312 | try: | |||||
| 313 | print "creating mbean of t ype Proper ty ... " | |||||
| 314 | theBea n = wl.cmo .lookupPro perty(bean Name) | |||||
| 315 | if the Bean == No ne: | |||||
| 316 | wl.c mo.createP roperty(be anName) | |||||
| 317 | except j ava.lang.U nsupported OperationE xception, usoe: | |||||
| 318 | pass | |||||
| 319 | except w eblogic.de scriptor.B eanAlready ExistsExce ption,bae: | |||||
| 320 | pass | |||||
| 321 | except j ava.lang.r eflect.Und eclaredThr owableExce ption,udt: | |||||
| 322 | pass | |||||
| 323 | except T ypeError: | |||||
| 324 | prop = cmo.creat eProperty( ) | |||||
| 325 | prop.s etName(bea nName) | |||||
| 326 | ||||||
| 327 | def create _JMSSystem Resource(p ath, beanN ame): | |||||
| 328 | wl.cd(pa th) | |||||
| 329 | try: | |||||
| 330 | print "creating mbean of t ype JMSSys temResourc e ... " | |||||
| 331 | theBea n = wl.cmo .lookupJMS SystemReso urce(beanN ame) | |||||
| 332 | if the Bean == No ne: | |||||
| 333 | wl.c mo.createJ MSSystemRe source(bea nName) | |||||
| 334 | except j ava.lang.U nsupported OperationE xception, usoe: | |||||
| 335 | pass | |||||
| 336 | except w eblogic.de scriptor.B eanAlready ExistsExce ption,bae: | |||||
| 337 | pass | |||||
| 338 | except j ava.lang.r eflect.Und eclaredThr owableExce ption,udt: | |||||
| 339 | pass | |||||
| 340 | ||||||
| 341 | def create _SubDeploy ment(path, beanName) : | |||||
| 342 | wl.cd(pa th) | |||||
| 343 | try: | |||||
| 344 | print "creating mbean of t ype SubDep loyment .. . " | |||||
| 345 | theBea n = wl.cmo .lookupSub Deployment (beanName) | |||||
| 346 | if the Bean == No ne: | |||||
| 347 | wl.c mo.createS ubDeployme nt(beanNam e) | |||||
| 348 | except j ava.lang.U nsupported OperationE xception, usoe: | |||||
| 349 | pass | |||||
| 350 | except w eblogic.de scriptor.B eanAlready ExistsExce ption,bae: | |||||
| 351 | pass | |||||
| 352 | except j ava.lang.r eflect.Und eclaredThr owableExce ption,udt: | |||||
| 353 | pass | |||||
| 354 | ||||||
| 355 | def create _Connectio nFactory(m odule, bea nName): | |||||
| 356 | path = " /JMSSystem Resources/ " +module+ "/JMSReso urce/" + m odule | |||||
| 357 | wl.cd(pa th) | |||||
| 358 | try: | |||||
| 359 | print "creating mbean of t ype Connec tionFactor y ... " | |||||
| 360 | theBea n = wl.cmo .lookupCon nectionFac tory(beanN ame) | |||||
| 361 | if the Bean == No ne: | |||||
| 362 | wl.c mo.createC onnectionF actory(bea nName) | |||||
| 363 | except j ava.lang.U nsupported OperationE xception, usoe: | |||||
| 364 | pass | |||||
| 365 | except w eblogic.de scriptor.B eanAlready ExistsExce ption,bae: | |||||
| 366 | pass | |||||
| 367 | except j ava.lang.r eflect.Und eclaredThr owableExce ption,udt: | |||||
| 368 | pass | |||||
| 369 | ||||||
| 370 | def create _UniformDi stributedQ ueue(modul e, beanNam e): | |||||
| 371 | path = " /JMSSystem Resources/ " +module+ "/JMSReso urce/" + m odule | |||||
| 372 | wl.cd(pa th) | |||||
| 373 | try: | |||||
| 374 | print "creating mbean of t ype Unifor mDistribut edQueue .. . " | |||||
| 375 | theBea n = wl.cmo .lookupUni formDistri butedQueue (beanName) | |||||
| 376 | if the Bean == No ne: | |||||
| 377 | wl.c mo.createU niformDist ributedQue ue(beanNam e) | |||||
| 378 | except j ava.lang.U nsupported OperationE xception, usoe: | |||||
| 379 | pass | |||||
| 380 | except w eblogic.de scriptor.B eanAlready ExistsExce ption,bae: | |||||
| 381 | pass | |||||
| 382 | except j ava.lang.r eflect.Und eclaredThr owableExce ption,udt: | |||||
| 383 | pass | |||||
| 384 | ||||||
| 385 | def setDef aultIdenti tyAsserter Attributes (domainNam e): | |||||
| 386 | wl.cd("/ SecurityCo nfiguratio n/" + doma inName + " /Realms/my realm/Auth entication Providers/ DefaultIde ntityAsser ter") | |||||
| 387 | print "s etting att ributes fo r mbean ty pe Default IdentityAs serter" | |||||
| 388 | wl.set(" ActiveType s", array( ["Authenti catedUser" ], String) ) | |||||
| 389 | ||||||
| 390 | def setClu sterAttrib utes(clust erName, cl usterMessa gingMode = "unicast" ): | |||||
| 391 | wl.cd("/ Clusters/" + cluster Name) | |||||
| 392 | print "s etting att ributes fo r mbean ty pe Cluster : " + clus terName | |||||
| 393 | wl.set(" ClusterMes sagingMode ", cluster MessagingM ode) | |||||
| 394 | ||||||
| 395 | def setJms ServerAttr ibutes(jms ServerName , managedS erverName, filestore Name): | |||||
| 396 | wl.cd("/ JMSServers /" + jmsSe rverName) | |||||
| 397 | print "s etting att ributes fo r mbean ty pe JMSServ er: " + jm sServerNam e | |||||
| 398 | refBean0 = wl.getM Bean("/Ser vers/" + m anagedServ erName) | |||||
| 399 | theValue = array([ refBean0], Class.for Name("webl ogic.manag ement.conf iguration. TargetMBea n")) | |||||
| 400 | wl.cmo.s etTargets( theValue) | |||||
| 401 | ||||||
| 402 | bean = w l.getMBean ("/FileSto res/" + fi lestoreNam e) | |||||
| 403 | wl.cmo.s etPersiste ntStore(be an) | |||||
| 404 | ||||||
| 405 | def setDat aSourceAtt ributes(da taSourceNa me, target Path, user Name, jndi Name, glob alTransact ionProtoco l = "TwoPh aseCommit" ): | |||||
| 406 | wl.cd("/ JDBCSystem Resources/ " + dataSo urceName) | |||||
| 407 | print "s etting att ributes fo r mbean ty pe JDBCSys temResourc e: " + dat aSourceNam e | |||||
| 408 | refBean0 = wl.getM Bean(targe tPath) | |||||
| 409 | theValue = array([ refBean0], Class.for Name("webl ogic.manag ement.conf iguration. TargetMBea n")) | |||||
| 410 | wl.cmo.s etTargets( theValue) | |||||
| 411 | ||||||
| 412 | # set us er attribu tes | |||||
| 413 | wl.cd("/ JDBCSystem Resources/ " + dataSo urceName + "/JDBCRes ource/" + dataSource Name + "/J DBCDriverP arams/" + dataSource Name + "/P roperties/ " + dataSo urceName + "/Propert ies/user") | |||||
| 414 | print "s etting att ributes fo r mbean ty pe JDBCPro perty user " | |||||
| 415 | wl.set(" Value", us erName) | |||||
| 416 | wl.set(" Name", "us er") | |||||
| 417 | ||||||
| 418 | # set da ta source name | |||||
| 419 | wl.cd("/ JDBCSystem Resources/ " + dataS ourceName + "/JDBCRe source/" + dataSourc eName) | |||||
| 420 | print "s etting att ributes fo r mbean ty pe JDBCDat aSource: " + dataSou rceName | |||||
| 421 | wl.set(" Name", dat aSourceNam e) | |||||
| 422 | ||||||
| 423 | wl.cd("/ JDBCSystem Resources/ " +dataSou rceName+ " /JDBCResou rce/" +dat aSourceNam e+ "/JDBCD ataSourceP arams/" + dataSource Name) | |||||
| 424 | print "s etting att ributes fo r mbean ty pe JDBCDat aSourcePar ams: " + d ataSourceN ame | |||||
| 425 | wl.set(" GlobalTran sactionsPr otocol", g lobalTrans actionProt ocol) | |||||
| 426 | wl.set(" JNDINames" , array([j ndiName], String)) | |||||
| 427 | ||||||
| 428 | def setJDB CConnectio nPoolParam sAttribute s(dataSour ceName, in itialCapac ity = "1", maxCapaci ty = "15", capacityI ncrement = "1", test TableName = "SQL SEL ECT 1 FROM DUAL", st atementCac heSize = " 10", state mentCacheT ype = "LR U"): | |||||
| 429 | wl.cd("/ JDBCSystem Resources/ " +dataSou rceName+ " /JDBCResou rce/" +dat aSourceNam e+ "/JDBCC onnectionP oolParams/ " + dataSo urceName) | |||||
| 430 | print "s etting att ributes fo r mbean ty pe JDBCCon nectionPoo lParams: " + dataSou rceName | |||||
| 431 | wl.set(" StatementC acheSize", statement CacheSize) | |||||
| 432 | wl.set(" TestTableN ame", test TableName) | |||||
| 433 | wl.set(" MaxCapacit y", maxCap acity) | |||||
| 434 | wl.set(" InitialCap acity", in itialCapac ity) | |||||
| 435 | wl.set(" StatementC acheType", statement CacheType) | |||||
| 436 | wl.set(" CapacityIn crement", capacityIn crement) | |||||
| 437 | ||||||
| 438 | def setJDB CDriverPar amsAttribu te(dataSou rceName, p assword, d riverName, url): | |||||
| 439 | wl.cd("/ JDBCSystem Resources/ " +dataSou rceName+ " /JDBCResou rce/" +dat aSourceNam e+ "/JDBCD riverParam s/" + data SourceName ) | |||||
| 440 | print "s etting att ributes fo r mbean ty pe JDBCDri verParams: " + dataS ourceName | |||||
| 441 | wl.set(" Password", password) | |||||
| 442 | wl.set(" DriverName ", driverN ame) | |||||
| 443 | wl.set(" Url", url) | |||||
| 444 | ||||||
| 445 | def setJms ModuleAttr ibutes(jms ModuleName , subDeplo ymentName, targetPat h): | |||||
| 446 | wl.cd("/ JMSSystemR esources/" + jmsModu leName) | |||||
| 447 | print "s etting att ributes fo r mbean ty pe JMSSyst emResource : " + jmsM oduleName | |||||
| 448 | targetBe an = wl.ge tMBean(tar getPath) | |||||
| 449 | theValue = array([ targetBean ], Class.f orName("we blogic.man agement.co nfiguratio n.TargetMB ean")) | |||||
| 450 | wl.cmo.s etTargets( theValue) | |||||
| 451 | ||||||
| 452 | # set su b-deployme nt attribu tes | |||||
| 453 | wl.cd("/ JMSSystemR esources/" + jmsModu leName + " /SubDeploy ments/" + subDeploym entName) | |||||
| 454 | print "s etting att ributes fo r mbean ty pe SubDepl oyment: " + subDeplo ymentName | |||||
| 455 | theValue = array([ targetBean ], Class.f orName("we blogic.man agement.co nfiguratio n.TargetMB ean")) | |||||
| 456 | wl.cmo.s etTargets( theValue) | |||||
| 457 | ||||||
| 458 | def setQue ueConnecti onFactoryA ttributes( jmsModuleN ame, queue Connection FactoryNam e, jndiNam e, default Targeting = "true", attachJMSX UserId = " true", xaC onnectionF actoryEnab led = "fal se"): | |||||
| 459 | wl.cd("/ JMSSystemR esources/" + jmsModu leName + " /JMSResour ce/" + jms ModuleName + "/Conne ctionFacto ries/" + q ueueConnec tionFactor yName) | |||||
| 460 | print "s etting att ributes fo r mbean ty pe JMSConn ectionFact ory: " + q ueueConnec tionFactor yName | |||||
| 461 | wl.set(" DefaultTar getingEnab led", defa ultTargeti ng) | |||||
| 462 | wl.set(" Name", que ueConnecti onFactoryN ame) | |||||
| 463 | wl.set(" JNDIName", jndiName) | |||||
| 464 | ||||||
| 465 | if attac hJMSXUserI d != "true ": | |||||
| 466 | wl.c d("/JMSSys temResourc es/" + jms ModuleName + "/JMSRe source/" + jmsModule Name + "/C onnectionF actories/" + queueCo nnectionFa ctoryName + "/Securi tyParams/" + queueCo nnectionFa ctoryName) | |||||
| 467 | #pri nt " setti ng attachJ MSXUserId attribute for JMSCon nectionFac tory" + qu eueConnect ionFactory Name | |||||
| 468 | wl.s et("Attach JMSXUserId ", "false" ) | |||||
| 469 | ||||||
| 470 | wl.cd("/ JMSSystemR esources/" + jmsModu leName + " /JMSResour ce/" + jms ModuleName + "/Conne ctionFacto ries/" + q ueueConnec tionFactor yName + "/ Transactio nParams/" + queueCon nectionFac toryName) | |||||
| 471 | print "s etting att ributes fo r mbean ty pe Transac tionParams " | |||||
| 472 | wl.set(" XAConnecti onFactoryE nabled", x aConnectio nFactoryEn abled) | |||||
| 473 | ||||||
| 474 | wl.cd("/ JMSSystemR esources/" + jmsModu leName + " /JMSResour ce/" + jms ModuleName + "/Conne ctionFacto ries/" + q ueueConnec tionFactor yName + "/ ClientPara ms/" + que ueConnecti onFactoryN ame) | |||||
| 475 | print "s etting att ributes fo r mbean ty pe ClientP arams" | |||||
| 476 | wl.set(" MessagesMa ximum", "1 0") # TODO: Nee ds to be c onfigurabl e? | |||||
| 477 | wl.set(" Subscripti onSharingP olicy", "E xclusive") # TODO: Nee ds to be c onfigurabl e? | |||||
| 478 | wl.set(" ClientIdPo licy", "Re stricted") # TODO: Nee ds to be c onfigurabl e? | |||||
| 479 | ||||||
| 480 | ||||||
| 481 | def setQue ueAttribut es(jmsModu le, queueN ame, subDe ploymentNa me, jndiNa me, errorD estination , loadBala ncingPolic y = "Round -Robin", e xpiryPolic y = "Redir ect", rede liveryLimi t = "10"): | |||||
| 482 | wl.cd("/ JMSSystemR esources/" +jmsModul e+ "/JMSRe source/" + jmsModule+ "/Uniform Distribute dQueues/" + queueNam e) | |||||
| 483 | print "s etting att ributes fo r mbean ty pe Uniform Distribute dQueue: " + queueNam e | |||||
| 484 | wl.set(" LoadBalanc ingPolicy" , loadBala ncingPolic y) | |||||
| 485 | wl.set(" Name", que ueName) | |||||
| 486 | wl.set(" SubDeploym entName", subDeploym entName) | |||||
| 487 | wl.set(" JNDIName", jndiName) | |||||
| 488 | ||||||
| 489 | if expir yPolicy == "Redirect ": | |||||
| 490 | # set delivery f ailure par ams on que ue | |||||
| 491 | wl.cd( "/JMSSyste mResources /" +jmsMod ule+ "/JMS Resource/" +jmsModul e+ "/Unifo rmDistribu tedQueues/ " + queueN ame + "/De liveryFail ureParams/ " + queueN ame) | |||||
| 492 | print "setting a ttributes for mbean type Deliv eryFailure Params" | |||||
| 493 | ||||||
| 494 | #TODO: Come back and fix. | |||||
| 495 | #set(" Expiration Policy", e xpiryPolic y) | |||||
| 496 | #set(" Redelivery Limit", re deliveryLi mit) | |||||
| 497 | #set(" ErrorDesti nation", e rrorDestin ation) | |||||
| 498 | ||||||
| 499 | wl.cd("/ JMSSystemR esources/" +jmsModul e+ "/JMSRe source/" + jmsModule+ "/Uniform Distribute dQueues/" + queueNam e + "/Deli veryParams Overrides/ " + queueN ame) | |||||
| 500 | wl.set(" Redelivery Delay", "5 00") | |||||
| 501 | ||||||
| 502 | ||||||
| 503 | def setSer verSSLAttr ibutes(ser verName, l istenPort, enabled = "true"): | |||||
| 504 | wl.cd("/ Servers/" +serverNam e+ "/SSL/" + serverN ame) | |||||
| 505 | print "s etting att ributes fo r mbean ty pe SSL: " + serverNa me + " Lis ten Port: " + listen Port + " E nabled: " + enabled | |||||
| 506 | wl.set(" Enabled", enabled) | |||||
| 507 | wl.set(" ListenPort ", listenP ort) | |||||
| 508 | ||||||
| 509 | def setEmb eddedLDAPA ttributes( domainName ): | |||||
| 510 | wl.cd("/ EmbeddedLD AP/" + dom ainName) | |||||
| 511 | print "s etting att ributes fo r mbean ty pe Embedde dLDAP" | |||||
| 512 | ||||||
| 513 | # what a re these c redentials ? | |||||
| 514 | #setEncr ypted("Cre dential", "c2s67", " /u01/app/d omains/vap _dev/./con fig/c2sCon figvap_dev ", "/u01/a pp/domains /vap_dev/. /config/c2 sSecretvap _dev") | |||||
| 515 | #setEncr ypted("Cre dential", "c2s68", " /u01/app/d omains/vap _dev/./con fig/c2sCon figvap_dev ", "/u01/a pp/domains /vap_dev/. /config/c2 sSecretvap _dev") | |||||
| 516 | ||||||
| 517 | ||||||
| 518 | def setSec urityConfi gurationAt tributes(d omainName) : | |||||
| 519 | wl.cd("/ SecurityCo nfiguratio n/" + doma inName) | |||||
| 520 | print "s etting att ributes fo r mbean ty pe Securit yConfigura tion" | |||||
| 521 | #setEncr ypted("Cre dential", "c2s78", " /u01/app/d omains/vap _dev/./con fig/c2sCon figvap_dev ", "/u01/a pp/domains /vap_dev/. /config/c2 sSecretvap _dev") | |||||
| 522 | #setEncr ypted("Nod eManagerPa ssword", " c2s79", "/ u01/app/do mains/vap_ dev/./conf ig/c2sConf igvap_dev" , "/u01/ap p/domains/ vap_dev/./ config/c2s Secretvap_ dev") | |||||
| 523 | #setEncr ypted("Nod eManagerPa ssword", " c2s80", "/ u01/app/do mains/vap_ dev/./conf ig/c2sConf igvap_dev" , "/u01/ap p/domains/ vap_dev/./ config/c2s Secretvap_ dev") | |||||
| 524 | #set("No deManagerU sername", "zKU83Cn3x Z") | |||||
| 525 | #setEncr ypted("Cre dential", "c2s81", " /u01/app/d omains/vap _dev/./con fig/c2sCon figvap_dev ", "/u01/a pp/domains /vap_dev/. /config/c2 sSecretvap _dev") | |||||
| 526 | ||||||
| 527 | def setNod eManagerAt tributes(m achineName , listenAd dress = "l ocalhost", nmType="p lain"): | |||||
| 528 | wl.cd("/ Machines/" +machineN ame+ "/Nod eManager/" + machine Name) | |||||
| 529 | print "s etting att ributes fo r mbean ty pe NodeMan ager: " + machineNam e | |||||
| 530 | wl.set(" ListenAddr ess", list enAddress) | |||||
| 531 | wl.set(" NMType", n mType) | |||||
| 532 | ||||||
| 533 | def setJTA Migratable TargetAttr ibutes(ser verName, c lusterName ): | |||||
| 534 | print se rverName + ' ' + clu sterName | |||||
| 535 | wl.cd("/ Servers/" +serverNam e+ "/JTAMi gratableTa rget/" + s erverName) | |||||
| 536 | print "s etting att ributes fo r mbean ty pe JTAMigr atableTarg et: " + se rverName | |||||
| 537 | bean = w l.getMBean ("/Cluster s/" + clus terName) | |||||
| 538 | wl.cmo.s etCluster( bean) | |||||
| 539 | ||||||
| 540 | bean = w l.getMBean ("/Servers /" + serve rName) | |||||
| 541 | wl.cmo.s etUserPref erredServe r(bean) | |||||
| 542 | ||||||
| 543 | def setDom ainAttribu tes(domain Name, admi nServerNam e, domainV ersion="10 .3.5.0", c onfigurati onVersion= "10.3.5.0" , producti onMode="fa lse"): | |||||
| 544 | wl.cd("/ ") | |||||
| 545 | print "s etting att ributes fo r mbean ty pe Domain" | |||||
| 546 | wl.set(" DomainVers ion", doma inVersion) | |||||
| 547 | wl.set(" Production ModeEnable d", produc tionMode) | |||||
| 548 | wl.set(" Configurat ionVersion ", configu rationVers ion) | |||||
| 549 | wl.set(" AdminServe rName", ad minServerN ame) | |||||
| 550 | ||||||
| 551 | wl.cd("/ JTA/" + do mainName) | |||||
| 552 | # standa rd JTA set tings | |||||
| 553 | print "s etting att ributes fo r mbean ty pe JTA" | |||||
| 554 | wl.set(" BeforeComp letionIter ationLimit ", "10") | |||||
| 555 | wl.set(" Unregister ResourceGr acePeriod" , "30") | |||||
| 556 | wl.set(" MaxUniqueN ameStatist ics", "100 0") | |||||
| 557 | wl.set(" ForgetHeur istics", " true") | |||||
| 558 | wl.set(" SecurityIn teropMode" , "default ") | |||||
| 559 | wl.set(" AbandonTim eoutSecond s", "86400 ") | |||||
| 560 | wl.set(" MaxResourc eRequestsO nServer", "50") | |||||
| 561 | wl.set(" MaxXACallM illis", "1 20000") | |||||
| 562 | wl.set(" Checkpoint IntervalSe conds", "3 00") | |||||
| 563 | wl.set(" TimeoutSec onds", "30 00") | |||||
| 564 | wl.set(" MaxTransac tions", "1 0000") | |||||
| 565 | wl.set(" MaxResourc eUnavailab leMillis", "1800000" ) | |||||
| 566 | ||||||
| 567 | def setSer verStartAt tributes(s erverName, arguments , javaVend or = "Sun" ): | |||||
| 568 | wl.cd("/ Servers/" + serverNa me + "/Ser verStart/" + serverN ame) | |||||
| 569 | print "s etting att ributes fo r mbean ty pe ServerS tart: " + serverName | |||||
| 570 | wl.set(" Arguments" , argument s) | |||||
| 571 | wl.set(" JavaVendor ", javaVen dor) | |||||
| 572 | ||||||
| 573 | def deploy Applicatio n(appName, path, tar gets, sm, lm, b): | |||||
| 574 | wl.deplo y(appName, path,targe ts,securit yModel=sm, lm=library Module,blo ck=b) | |||||
| 575 | print 'D one deploy ing: ', ap pName |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.