CollCoherence.java
1.98 KB
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
package com.sitech.ismp.coll.centercoll;
import com.sitech.util.DES3;
import java.util.HashMap;
import java.util.Vector;
/**
* Created with IntelliJ IDEA.
* User: ZhouYou
* Date: 15-7-14
* Time: 上午11:11
* To change this template use File | Settings | File Templates.
*/
public class CollCoherence implements CollCoherenceMBean {
public Vector getCluster(HashMap params) {
CollCoherenceWithJMX coherence = new CollCoherenceWithJMX();
return coherence.getCluster(params);
}
public Vector getNotes(HashMap params) {
CollCoherenceWithJMX coherence = new CollCoherenceWithJMX();
return coherence.getNotes(params);
}
public static void main(String[] args) {
System.out.println("***************CoherenceCluster Collect Test Begin*********************");
String hostIP = "10.243.29.28";
String jmxPort = "8888";
String userName = "e3base";
String userPass = "e3base!123";
String nodePath = "D:/coherence.txt";
System.out.println("HostIP=" + hostIP + ",userName = " + userName + ",userPass=" + userPass
+ ",stormPort=" + jmxPort + ",nodePath=" + nodePath);
HashMap<String, String> params = new HashMap<String, String>();
params.put("HOSTIP", hostIP);
params.put("JMXPORT", jmxPort);
params.put("DEVICENAME", "z8coherence");
params.put("USERNAME", userName);
params.put("USERPASS", DES3.encrypt(userPass));
params.put("NODEPATH", nodePath);
CollCoherence collector = new CollCoherence();
String methodStr = "1";
int method = Integer.parseInt(methodStr);
switch (method) {
case 0:
collector.getCluster(params);
break;
case 1:
collector.getNotes(params);
break;
default:
break;
}
System.out.println("***************CoherenceCluster Collect Test End*********************");
}
}