Package org.wso2.carbon.event.client.broker

Examples of org.wso2.carbon.event.client.broker.BrokerClient


    }

    public byte[] getProcessImage(String processId) {

        QName qName = decode(processId);
        SVGInterface svg = createSVG(qName);
        return svg.toPNGBytes();
    }
View Full Code Here


    private SVGInterface createSVG(QName qName) {

        // generate new
        InputStream in = getBpelDescriptor(qName);

        SVGInterface svg = null;

        try {
            svg = BPEL2SVGUtil.generate(in);

            if (svg == null)
View Full Code Here

   
    protected static SVGImpl generateSVGImpl(java.io.InputStream is) throws java.io.IOException {
      byte[] b=new byte[is.available()];
      is.read(b);
   
      BPELInterface bpel = new BPELImpl();
        OMElement bpelStr = bpel.load(new String(b));
       
        bpel.processBpelString(bpelStr);

        LayoutManager layoutManager = BPEL2SVGFactory.getInstance().getLayoutManager();
        layoutManager.setVerticalLayout(true);
        layoutManager.setYSpacing(20);
        layoutManager.setYSpacing(50);
        layoutManager.layoutSVG(bpel.getRootActivity());

        SVGImpl svg = new SVGImpl();
        svg.setRootActivity(bpel.getRootActivity());
       
        return(svg);
    }
View Full Code Here

   * @param transformer The optional image transformer
   * @throws java.io.IOException Failed to generate the representation
   */
    public static void generate(java.io.InputStream is, java.io.OutputStream os,
                SVGImageTransformer transformer) throws java.io.IOException {
        SVGImpl svg = generateSVGImpl(is);
       
        if (transformer == null) {
          String str=svg.getHeaders()+svg.generateSVGString();
          os.write(str.getBytes());
        } else {
          transformer.transform(svg, os);
        }
    }
View Full Code Here

        layoutManager.setVerticalLayout(true);
        layoutManager.setYSpacing(20);
        layoutManager.setYSpacing(50);
        layoutManager.layoutSVG(bpel.getRootActivity());

        SVGImpl svg = new SVGImpl();
        svg.setRootActivity(bpel.getRootActivity());
       
        return(svg);
    }
View Full Code Here

        //backendServerURL = backendServerURL.replaceAll("9443", "9763");
        backendServerURL = backendServerURL + "EventBrokerService";
       
        //String backendServerURL = CarbonUIUtil.getServerURL(request.get, session);
        String cookie = (String) session.getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
        return new BrokerClient(backendServerURL,cookie);
    }
View Full Code Here

        String confFile = repoLocation + "/conf/axis2_client.xml";
       
        SimpleMessageReceiver messageReceiver = new SimpleMessageReceiver(repoLocation, confFile,null);
        messageReceiver.start();
       
        BrokerClient brokerClient = new BrokerClient("http://127.0.0.1:9763/services/EventBrokerService");
        //brokerClient.subscribe(topic, messageReceiver.getListenerUrl());
       
        brokerClient.subscribe(topic, "http://parakum:6666/axis2/services/MessageCollector/receive/");
       
       
       
       
        OMFactory fac = OMAbstractFactory.getOMFactory();
        OMElement ele = fac.createOMElement(new QName("http://wso2.org","foo"));
        ele.setText("hello");
        brokerClient.publish(topic, ele);
       
        Thread.sleep(3000);

    }
View Full Code Here

            });
            messageReceiver.start();
           
            //Initialize the broker
            //BrokerClient brokerClient = new BrokerClient("http://127.0.0.1:9763/services/EventBrokerService");
            BrokerClient brokerClient = new BrokerClient("https://127.0.0.1:9443/services/EventBrokerService", "admin", "admin");
           
            //subscribe, notice we set the message sink to listener
            String listenerUrl = messageReceiver.getListenerUrl();
            System.out.println("listining with "+ listenerUrl);
           
            String subscribtionId = brokerClient.subscribe(topic, listenerUrl);
           
          
            //String subscribtionId = brokerClient.subscribe(topic, "http://parakum:7777/axis2/services/MessageCollector/receive/");
            OMFactory fac = OMAbstractFactory.getOMFactory();
           
            for(int i = 0;i<2;i++){
                OMElement ele = fac.createOMElement(new QName("http://wso2.org","foo"+i));
                ele.setText("hello"+i);
                brokerClient.publish(topic+"/bar", ele);
            }
           
            for(int i = 0;i<2;i++){
                OMElement ele = fac.createOMElement(new QName("http://wso2.org","foo"+i));
                ele.setText("Should not receive"+i);
                brokerClient.publish("/bar", ele);
            }
           
           
            brokerClient.unsubscribe(subscribtionId);
           
            Thread.sleep(3000);
//       
//        BrokerClient brokerClient = new BrokerClient("http://127.0.0.1:5555/services/EventBrokerService");
//        SubscriptionDetails[] details = brokerClient.getAllSubscriptions();
View Full Code Here

    });
    messageReceiver.start();
   
    //Initialize the broker
    //BrokerClient brokerClient = new BrokerClient("http://127.0.0.1:9763/services/EventBrokerService");
    BrokerClient brokerClient = new BrokerClient("https://127.0.0.1:9443/services/EventBrokerService", "admin", "admin");
   
   
    //https://127.0.0.1:9443/services/BrokerSecurityManager
   
   
//    brokerClient.createSecureTopic(topic, null, null);
//    brokerClient.createSecureTopic(topic+"/bar", null, null);
//    brokerClient.shareATopic(topic, null, new String[]{"everyone"});
//   
//    brokerClient = new BrokerClient("https://127.0.0.1:9443/services/EventBrokerService", "test", "test1234");
//   
//    //subscribe, notice we set the message sink to listener
//    String listenerUrl = messageReceiver.getListenerUrl();
//    System.out.println("listining with "+ listenerUrl);
//   
//    String subscribtionId = brokerClient.subscribe(topic, listenerUrl);
//   
//  
    //String subscribtionId = brokerClient.subscribe(topic, "http://parakum:7777/axis2/services/MessageCollector/receive/");
    OMFactory fac = OMAbstractFactory.getOMFactory();
   
    for(int i = 0;i<2;i++){
        OMElement ele = fac.createOMElement(new QName("http://wso2.org","foo"+i));
        ele.setText("hello"+i);
        brokerClient.publish(topic+"/bar", ele);
    }
//   
//    brokerClient.unsubscribe(subscribtionId);
//    brokerClient.deleteSecureTopic(topic);
//   
//    Thread.sleep(3000);
    SubscriptionDetails[] allSubscriptions = brokerClient.getAllSubscriptions();
    for(SubscriptionDetails details:allSubscriptions){
        System.out.println(new Date(details.getCreatedTime().getTimeInMillis()));
    }

}
View Full Code Here

        return serversListCache;
    }

    public static BrokerClient getBrokerClient(String brokerURL, String userName, String password)
            throws Exception {
        return new BrokerClient(BAMUtil.getConfigurationContextService().getServerConfigContext(),
                    brokerURL, userName, password);
    }
View Full Code Here

TOP

Related Classes of org.wso2.carbon.event.client.broker.BrokerClient

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.