Examples of WseMsgBrokerClient


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

    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

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

    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.debug("\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

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

    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.debug("\n\nCreate Subscription for topic" + topic + " [Messagebox]\n\n");
View Full Code Here

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

    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, 12000l);

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

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

            boolean subscribePermanatly) throws MsgBrokerClientException {

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

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

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

        this(10, context.isEnableAsyncPublishing(), context.getBrokerEpr());
    }

    public WSMPublisher(int capacity, boolean defaultAsync, String brokerLoc, String topic) throws IOException {
        super(capacity, defaultAsync);
        broker = new WseMsgBrokerClient();
        brokerEpr = broker.createEndpointReference(brokerLoc, topic);
        broker.init(brokerEpr.getAddress());
    }
View Full Code Here

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

    public WSMPublisher(int capacity, boolean defaultAsync, EndpointReference brokerEpr_)
            throws WorkflowTrackingException {
        super(capacity, defaultAsync);
        try {
            brokerEpr = brokerEpr_;
            broker = new WseMsgBrokerClient();
            broker.init(brokerEpr_.getAddress());
        } catch (Exception e) {
            throw new WorkflowTrackingException(e);
        }
    }
View Full Code Here

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

        } else {
            brokerEpr = EndpointReferenceHelper.fromString(brokerEpr_);
        }

        broker = new WseMsgBrokerClient();
        broker.init(brokerEpr.getAddress());
    }
View Full Code Here

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

        // that particular topic.
        // Inthis sample we emulate it by manually publishing notifications

        // created a publisher

        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

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

            int consumerPort = TestUtilServer.getAvailablePort();

            String brokerEpr = "http://localhost:" + TestUtilServer.TESTING_PORT + "/axis2/services/EventingService";

            WseMsgBrokerClient topicOnlyReceiverApi = new WseMsgBrokerClient();
            topicOnlyReceiverApi.init(brokerEpr);
            NotificationReciever topicOnlyMsgReceiver = new NotificationReciever("Topic Only");
            String[] topicConsumerEPRs = topicOnlyReceiverApi.startConsumerService(consumerPort, topicOnlyMsgReceiver);
            assertTrue("invalid consumer eprs returned", topicConsumerEPRs.length > 0);
            String topicOnlySubId = topicOnlyReceiverApi.subscribe(topicConsumerEPRs[0], topic, null);
            System.out.println("Topic only subscription ID: " + topicOnlySubId);

            WseMsgBrokerClient xpathAndTopicReceiverApi = new WseMsgBrokerClient();
            xpathAndTopicReceiverApi.init(brokerEpr);
            NotificationReciever topicAndXpathMsgReceiver = new NotificationReciever("Topic And Xpath");
            String[] topicAndXpathConsumerEPRs = xpathAndTopicReceiverApi.startConsumerService(consumerPort + 1,
                    topicAndXpathMsgReceiver);
            assertTrue("invalid consumer eprs returned", topicAndXpathConsumerEPRs.length > 0);
            String topicAndXpathSubId = xpathAndTopicReceiverApi.subscribe(topicAndXpathConsumerEPRs[0], topic,
                    xpathExpression);
            System.out.println("Xpath and Topic subscription ID: " + topicAndXpathSubId);

            WseMsgBrokerClient senderApi = new WseMsgBrokerClient();
            senderApi.init(brokerEpr);

            try {

                senderApi.publish(topic, AXIOMUtil.stringToOM(matchingMsg));
                senderApi.publish(topic, AXIOMUtil.stringToOM(unmatchingMsg));

                Thread.sleep(5000);

                assertTrue("topic only reciever should get all messages" + topicOnlyMsgReceiver.getMsgQueue().size(),
                        topicOnlyMsgReceiver.getMsgQueue().size() == 2);
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.