Package com.trendmicro.tme.mfr

Examples of com.trendmicro.tme.mfr.Exchange


   
    @Path("/{name}/drop")
    @PUT
    @Consumes(MediaType.TEXT_PLAIN)
    public void setDrop(@PathParam("name") String name, String policy) throws Exception {
        Exchange ex = new Exchange(name);
        String path = "/global/drop_exchange/" + ex.getName();
        ZooKeeperInfo.DropConfig dropConfig = ZooKeeperInfo.DropConfig.newBuilder().setPolicy(policy.equals("newest") ? DropConfig.Policy.NEWEST: DropConfig.Policy.OLDEST).build();
       
        ZNode node = new ZNode(path);
        if(node.exists()) {
            node.setContent(dropConfig.toString().getBytes());
View Full Code Here


    }
   
    @Path("/{name}/drop")
    @DELETE
    public void setBlock(@PathParam("name") String name) throws Exception {
        Exchange ex = new Exchange(name);
        String path = "/global/drop_exchange/" + ex.getName();
       
        new ZNode(path).delete();
        String broker = exchangeFarm.getCurrentExchangeHost(ex);
        if(broker != null) {
            BrokerAdmin brokerAdmin = new BrokerAdmin(broker);
View Full Code Here

   
    @Path("/{name}/size_limit")
    @PUT
    @Consumes(MediaType.TEXT_PLAIN)
    public void setSizeLimit(@PathParam("name") String name, String sizeLimit) throws Exception {
        Exchange ex = new Exchange(name);
        String path = "/global/limit_exchange/" + ex.getName();
       
        ZooKeeperInfo.TotalLimit limit = exchangeFarm.getTotalLimit(ex);
        ZNode node = new ZNode(path);
        if(node.exists()) {
            node.setContent(limit.toBuilder().setSizeBytes(Long.valueOf(sizeLimit)).build().toString().getBytes());
View Full Code Here

   
    @Path("/{name}/count_limit")
    @PUT
    @Consumes(MediaType.TEXT_PLAIN)
    public void setCountLimit(@PathParam("name") String name, String countLimit) throws Exception {
        Exchange ex = new Exchange(name);
        String path = "/global/limit_exchange/" + ex.getName();
       
        ZooKeeperInfo.TotalLimit limit = exchangeFarm.getTotalLimit(ex);
        ZNode node = new ZNode(path);
        if(node.exists()) {
            node.setContent(limit.toBuilder().setCount(Long.valueOf(countLimit)).build().toString().getBytes());
View Full Code Here

        String exchangeName = m.group(1);
        if(exchangeName.equals("mq.sys.dmq")) {
            return;
        }

        String currentBroker = exchangeFarm.getCurrentExchangeHost(new Exchange(exchangeName));
        if(!q.getServer().getHost().equals(currentBroker)){
            logger.warn(String.format("current broker of %s is %s instead of %s, ignore", exchangeName, currentBroker, q.getServer().getHost()));
            return;
        }
View Full Code Here

            jmxConnectServer();
            ArrayList<Exchange> result = new ArrayList<Exchange>();

            ObjectName objname = new ObjectName("com.sun.messaging.jms.server:type=Destination,subtype=Monitor,desttype=q,name=*");
            for(ObjectName n : connection.queryNames(objname, null)) {
                Exchange excQ = new Exchange(connection.getAttribute(n, "Name").toString());
                excQ.setQueue();
                result.add(excQ);
            }
            objname = new ObjectName("com.sun.messaging.jms.server:type=Destination,subtype=Monitor,desttype=t,name=*");
            for(ObjectName n : connection.queryNames(objname, null)) {
                Exchange excT = new Exchange(connection.getAttribute(n, "Name").toString());
                excT.setTopic();
                result.add(excT);
            }
            Exchange excAdmin = new Exchange("mq.sys.dmq");
            excAdmin.setQueue();
            result.remove(excAdmin);
            return result;
        }
        catch(Exception e) {
            throw new Exception(e.getMessage());
View Full Code Here

TOP

Related Classes of com.trendmicro.tme.mfr.Exchange

Copyright © 2018 www.massapicom. 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.