CollCoherence.java 1.98 KB
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*********************");
    }

}