Package com.trendmicro.codi

Examples of com.trendmicro.codi.ZNode.create()


                return false;
            String zkPath = "/ZK_TEST_NODE";
            String zkData = "02a7e44daac8046f43de84b2546a4d63";
            try {
                ZNode node = new ZNode(zkPath);
                node.create(false, zkData.getBytes());
                String res = new String(node.getContent());
                node.delete();
                if(res.compareTo(zkData) == 0)
                    return true;
                else
View Full Code Here


        ZNode node = new ZNode("/global/graph/processor/" + name);
        ProcessorModel processor = new ProcessorModel(name);
        processor.addInput(name + ".in");
        processor.addOutput(name + ".out");
        node.create(false, new Gson().toJson(processor));
    }
   
    @Path("/{name}")
    @DELETE
    public void removeProcessor(@PathParam("name") String name) throws CODIException, JAXBException {
View Full Code Here

        brkBuilder.setBrokerType("openmq");
        brkBuilder.setVersion("4.4");
        brkBuilder.setReserved(false);

        ZNode brkNode = new ZNode("/tme2/broker/127.0.0.1");
        brkNode.create(false, brkBuilder.build().toString());

        ZNode loadingNode = new ZNode("/tme2/broker/127.0.0.1/loading");
        loadingNode.create(false, ZooKeeperInfo.Loading.newBuilder().setLoading(0).setLastUpdate(0).setFreeMemory(0).setMaxMemory(0).build().toString());
    }
}
View Full Code Here

        ZNode brkNode = new ZNode("/tme2/broker/127.0.0.1");
        brkNode.create(false, brkBuilder.build().toString());

        ZNode loadingNode = new ZNode("/tme2/broker/127.0.0.1/loading");
        loadingNode.create(false, ZooKeeperInfo.Loading.newBuilder().setLoading(0).setLastUpdate(0).setFreeMemory(0).setMaxMemory(0).build().toString());
    }
}
View Full Code Here

        ZNode node = new ZNode(path);
        if(node.exists()) {
            node.setContent(dropConfig.toString().getBytes());
        }
        else {
            node.create(false, dropConfig.toString().getBytes());
        }
       
        String broker = exchangeFarm.getCurrentExchangeHost(ex);
        if(broker != null) {
            BrokerAdmin brokerAdmin = new BrokerAdmin(broker);
View Full Code Here

        ZNode node = new ZNode(path);
        if(node.exists()) {
            node.setContent(limit.toBuilder().setSizeBytes(Long.valueOf(sizeLimit)).build().toString().getBytes());
        }
        else {
            node.create(false, limit.toBuilder().setSizeBytes(Long.valueOf(sizeLimit)).build().toString().getBytes());
        }
       
        String broker = exchangeFarm.getCurrentExchangeHost(ex);
        if(broker != null) {
            BrokerAdmin brokerAdmin = new BrokerAdmin(broker);
View Full Code Here

        ZNode node = new ZNode(path);
        if(node.exists()) {
            node.setContent(limit.toBuilder().setCount(Long.valueOf(countLimit)).build().toString().getBytes());
        }
        else {
            node.create(false, limit.toBuilder().setCount(Long.valueOf(countLimit)).build().toString().getBytes());
        }
       
        String broker = exchangeFarm.getCurrentExchangeHost(ex);
        if(broker != null) {
            BrokerAdmin brokerAdmin = new BrokerAdmin(broker);
View Full Code Here

        ZNode node = new ZNode("/global/graph/route/" + name);
        GraphModel graph = new GraphModel(name);
        if(graphEditor.isSecurityEnabled()) {
            graph.addAdmin(sc.getUserPrincipal().getName());
        }
        node.create(false, new Gson().toJson(graph));
    }

    @Path("/{name}")
    @DELETE
    public void removeGraph(@PathParam("name") String name, @Context SecurityContext sc) throws CODIException, JAXBException {
View Full Code Here

        try {
            brkNode.deleteRecursively();
        }
        catch(Exception e) {
        }
        brkNode.create(false, brkBuilder.build().toString());
       
        ZNode loadingNode = new ZNode(tmeRoot + "/broker/" + host + "/loading");
        loadingNode.create(false, ZooKeeperInfo.Loading.newBuilder().setLoading(0).setLastUpdate(0).setFreeMemory(0).setMaxMemory(0).build().toString());
        obs.start();
    }
View Full Code Here

        catch(Exception e) {
        }
        brkNode.create(false, brkBuilder.build().toString());
       
        ZNode loadingNode = new ZNode(tmeRoot + "/broker/" + host + "/loading");
        loadingNode.create(false, ZooKeeperInfo.Loading.newBuilder().setLoading(0).setLastUpdate(0).setFreeMemory(0).setMaxMemory(0).build().toString());
        obs.start();
    }
   
    public void unregisterOnZk() throws CODIException {
        obs.stop();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.