Package org.apache.airavata.wsmg.client

Examples of org.apache.airavata.wsmg.client.WseMsgBrokerClient


        this.brokerURL = configuration.getBrokerURL();
        this.topic = configuration.getTopic();
        this.pullMode = configuration.isPullMode();
        this.messageBoxURL = configuration.getMessageBoxURL();

        this.wseClient = new WseMsgBrokerClient();
        this.wseClient.init(this.brokerURL.toString());
    }
View Full Code Here


    @Test
    public void WorkflowTrackingtest() throws Exception{
        logger.info("Running WorkflowTrackingTest...");
        setUp();
        Properties configurations = new Properties(getDefaults());
        WseMsgBrokerClient brokerClient = new WseMsgBrokerClient();
        String brokerLocation = "http://localhost:" + TestUtilServer.TESTING_PORT + "/axis2/services/EventingService";
        brokerClient.init(brokerLocation);
        String topic = configurations.getProperty(ConfigKeys.TOPIC);
        NotificationSender sender = null;
        sender = new NotificationSender(brokerLocation, topic);

        int consumerPort = TestUtilServer.getAvailablePort();

            String[] consumerEPRs = brokerClient.startConsumerService(consumerPort, this);
        // subscribing to the above created messsage box with configured topic
        String subscriptionID = brokerClient.subscribe(consumerEPRs[0], topic, null);

        sender.workflowStarted("Workflow Started");

        //Here we simply assume the workflow invocation is the invoke of the subscribe operation of EventingService and result
        // Is considered as the subscriptionID got from subscribe operation
        try {
            Thread.sleep(10000L);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        brokerClient.unSubscribe(subscriptionID);
        Assert.assertEquals(brokerLocation,"http://localhost:" + TestUtilServer.TESTING_PORT + "/axis2/services/EventingService");
        tearDown();
    }
View Full Code Here

        this.workflow = workflow;
        this.brokerURL = configuration.getBrokerURL();
        this.topic = configuration.getTopic();
        this.pullMode = true;
        this.messageBoxURL = configuration.getMessageBoxURL();
        this.wseClient = new WseMsgBrokerClient();
        this.wseClient.init(this.brokerURL.toString());
    }
View Full Code Here

            if (logger.isDebugEnabled())
                logger.info("\n\nStopping the Messagebox for topic" + this.topic);
        }

        try {
            WseMsgBrokerClient client = new WseMsgBrokerClient();
            client.init(this.brokerURL.toString());
            client.unSubscribe(this.subscriptionId);

            MsgboxHandler msgboxHandler = new MsgboxHandler();

            logger.info("Unsubscribing the messagebox that was destroyed," + " SubscriptionID:" + this.subscriptionId);
View Full Code Here

    public Subscription renewMessageboxSubscription(String epr, String subscriptionId, String topic, String xpath,
            boolean subscribePermanatly) throws MsgBrokerClientException {

        this.subscriptionId = subscriptionId;
        this.topic = topic;
        WseMsgBrokerClient wseClient = new WseMsgBrokerClient();
        EndpointReference endpointReference = null;
        try {
            endpointReference = EndpointReferenceHelper.fromString(epr);
        } catch (AxisFault f) {
            throw new MsgBrokerClientException("unable to convert end point reference", f);
View Full Code Here

    public Subscription renewMessageboxSubscription(EndpointReference endpointReference, String subscriptionId,
            String topic, String xpath, boolean subscribePermanatly) throws MsgBrokerClientException {

        this.subscriptionId = subscriptionId;
        this.topic = topic;
        WseMsgBrokerClient wseClient = new WseMsgBrokerClient();
        logger.info("\n\nCreate Subscription for topic" + topic + " [Messagebox]\n\n");

        subscriptionId = subscribeToBroker(endpointReference.getAddress(), topic, xpath, wseClient, subscribePermanatly);
        Subscription subscription = new Subscription(this, subscriptionId, topic, callback, this.brokerURL);
        subscription.setMessageBoxEpr(endpointReference);
View Full Code Here

    public Subscription startListeningToPreviousMessageBox(EndpointReference msgBoxAddr, String subscriptionId,
            String topic, String xpath, Callback callback, boolean subscribePermanatly) throws MsgBrokerClientException {
        this.callback = callback;
        this.subscriptionId = subscriptionId;
        this.topic = topic;
        WseMsgBrokerClient wseClient = new WseMsgBrokerClient();
        MsgboxHandler msgboxHandler = new MsgboxHandler();

        messagePuller = msgboxHandler.startPullingFromExistingMsgBox(msgBoxAddr, this, 500L, 1000L);
        if (logger.isDebugEnabled())
            logger.info("\n\nCreate Subscription for topic" + topic + " [Messagebox]\n\n");
View Full Code Here

    public Subscription createSubscription(String topic, String xpath, Callback callback, boolean subscribePermananly)
            throws Exception {
        this.topic = topic;
        this.callback = callback;

        WseMsgBrokerClient wseClient = new WseMsgBrokerClient();
        MsgboxHandler msgboxHandler = new MsgboxHandler();
        EndpointReference msgBoxAddr = msgboxHandler.createPullMsgBox(this.messageBoxUrl, 1000l);

        String messageBoxAddress = msgBoxAddr.getAddress();
        if (logger.isDebugEnabled())
View Full Code Here

            boolean subscribePermanatly) throws MsgBrokerClientException {

        this.topic = topic2;
        this.callback = callback2;

        WseMsgBrokerClient wseClient = new WseMsgBrokerClient();
        MsgboxHandler msgboxHandler = new MsgboxHandler();
        EndpointReference msgBoxAddr = msgboxHandler.createPullMsgBox(this.messageBoxUrl, 1000l);
        if (logger.isDebugEnabled())
            logger.info("\n\nCreated Messagebox at address :" + msgBoxAddr.getAddress());
View Full Code Here

            configs.load(configURL.openStream());
        } catch (IOException e1) {
            e1.printStackTrace();
        }

        WseMsgBrokerClient publisher = new WseMsgBrokerClient();
        EndpointReference endpointRef = publisher.createEndpointReference(brokerLocation, topic);
        publisher.init(endpointRef.getAddress());

        try {

            OMElement finalNotificationEl = WorkFlowUtils.reader2OMElement(new StringReader(finalNotification));

            OMElement testNotification = factory.createOMElement("Test", null);

            testNotification.setText("test event for workflow tracking sample");

            publisher.publish(null, testNotification);
            publisher.publish(null, finalNotificationEl);
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
View Full Code Here

TOP

Related Classes of org.apache.airavata.wsmg.client.WseMsgBrokerClient

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.