forked from infinite-Joy/websphere
-
Notifications
You must be signed in to change notification settings - Fork 0
/
activation_spec.py
69 lines (58 loc) · 2.46 KB
/
activation_spec.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import sys
import java
import time
global AdminConfig
# Setting local time here
t = time.localtime()
asctime = time.asctime(t)
transType = ""
destType = ""
description = "this is for my application, created by jython script on" + asctime
#################################
cellName = ""
nodeName = ""
serverName = ""
queue_manager_host1 = ""
queue_manager_host2 = ""
queue_manager_nam1 = ""
queue_manager_nam2 = ""
resource_name1 = ""
resource_name2 = ""
queue_manager_port = ""
queue_serv_channel = "" # given as a string
destination_jndi_channel = ""
#####################################
def createActivationSpecifications(cell, node, server, provider, resource_name,
res_jndi, queue_manager_name, queue_manager_host):
serverId = AdminConfig.getid("/Cell:" + cell + "/Node:" + node +
"/Server:" + server + "/")
print("Creating activation specification resource for JVM " + serverId)
# Creating the websphere MQ JMS Provider to create JMS activation spec
jmsId = AdminConfig.getid("/Cell:" + cell + "/Node:" + node + "/Server:" +
server + "/JMSProvider:" + provider + "/")
print jmsId
jmscreateId = AdminTask.createWMQActivationSpec(jmsId, "[-name ]" +
resource_name + "-jndiName " + res_jndi + " -description " +
destination + " -destinationJNDIName " + destinationJNDIName +
" -destinationType " + destinationType + " -qMgrName" +
queue_manager_name + " -wmqTransportType " + transportType +
" -qmgrHostname " + queue_manager_host + " -qmgrPortNumber "
+ queue_manager_port + " -qmgrSvrconnChannel " +
queue_serv_channel + " ]")
AdminTask.createSSLConfigGroup("[-name " + serverName +
" -direction outbound -certificateAlias default =scopeName (cell):" +
cellName + ":(node):" + nodeName + ":(server):" + serverName +
" -sslConfigAliasName " + SSL_ConfigName + " -sslConfigScopeName " +
"(cell):" + cellName + ":(node):" + nodeName + ":(server):" +
serverName + " ]")
statement = " JMS activation specification has been successfully created ==>"
print statement + jmscreateId
def main():
createActivationSpecifications(cellName, nodeName, serverName,
"Websphere MQ JMS Provider", resource_name, res_jndi,
queue_manager_name, queue_manager_host)
# createWMQActivationSpec for other queue managers
AdminConfig.save()
print " ==> AdminConfig.save() successfull!!"
if __name__ == "__main__" or __name__ == "main":
main()