Package org.xmlBlaster.client.qos

Examples of org.xmlBlaster.client.qos.SubscribeQos.toXml()


         // And one on another msg type but with the same xpath
         qos = new SubscribeQos(glob);
         qos.addAccessFilter(new AccessFilterQos(glob, "XPathFilter", "1.0", "/news[@type='sport' or @type='culture']"));
        
        
         subscribeOid3 = con.subscribe("<key oid='AnotherMsG'/>", qos.toXml()).getSubscriptionId();
         subscriberTable.put(subscribeOid3, new Integer(2));
         log.info("Success: Subscribe subscription-id3=" + subscribeOid3 + " done");

         // Ad with extention functions
         qos = new SubscribeQos(glob);
View Full Code Here


         // Ad with extention functions
         qos = new SubscribeQos(glob);
         qos.addAccessFilter(new AccessFilterQos(glob, "XPathFilter", "1.0", "/news[ contains-ignore-case( recursive-text(body), 'needle')]"));
        
        
         subscribeOid4 = con.subscribe("<key oid='AnotherMsG'/>", qos.toXml()).getSubscriptionId();
         subscriberTable.put(subscribeOid4, new Integer(3));
         log.info("Success: Subscribe subscription-id4=" + subscribeOid4 + " done");
        
      } catch(XmlBlasterException e) {
         log.warning("XmlBlasterException: " + e.getMessage());
View Full Code Here

      log.info("*****Subscribing using XPath syntax ...");

      try {
         SubscribeKey sk = new SubscribeKey(glob, "//key[@oid = 'command-navigation']", Constants.XPATH);
         SubscribeQos sq = new SubscribeQos(glob);
         con1.subscribe(sk.toXml(), sq.toXml()).getSubscriptionId();

         String xpath2 = "//key[starts-with(@oid,'command-radar')]";
         sk = new SubscribeKey(glob, xpath2, Constants.XPATH);
         sq = new SubscribeQos(glob);
         con2.subscribe(sk.toXml(), sq.toXml()).getSubscriptionId();
View Full Code Here

         con1.subscribe(sk.toXml(), sq.toXml()).getSubscriptionId();

         String xpath2 = "//key[starts-with(@oid,'command-radar')]";
         sk = new SubscribeKey(glob, xpath2, Constants.XPATH);
         sq = new SubscribeQos(glob);
         con2.subscribe(sk.toXml(), sq.toXml()).getSubscriptionId();

         sk = new SubscribeKey(glob, xpath2, Constants.XPATH);
         sq = new SubscribeQos(glob);
         con3.subscribe(sk.toXml(), sq.toXml()).getSubscriptionId();
      }
View Full Code Here

         sq = new SubscribeQos(glob);
         con2.subscribe(sk.toXml(), sq.toXml()).getSubscriptionId();

         sk = new SubscribeKey(glob, xpath2, Constants.XPATH);
         sq = new SubscribeQos(glob);
         con3.subscribe(sk.toXml(), sq.toXml()).getSubscriptionId();
      }
      catch (XmlBlasterException e) {
         fail("doPublish failed: " + e.toString());
      }
   }
View Full Code Here

                      "</key>";
      numReceived = 0;
      subscribeOid = null;
      SubscribeQos sk = new SubscribeQos(glob);
      sk.setWantInitialUpdate(false);
      String qos = sk.toXml(); // "<qos><initialUpdate>false</initialUpdate></qos>";
      try {
         subscribeOid = senderConnection.subscribe(xmlKey, qos).getSubscriptionId();
         log.info("Success: Subscribe subscription-id=" + subscribeOid + " done");
      } catch(XmlBlasterException e) {
         log.warning("XmlBlasterException: " + e.getMessage());
View Full Code Here

      String oid = "SomeDummySubscribe";
      SubscribeReturnQos subRet = null;
      try {
         SubscribeKey sk = new SubscribeKey(glob, oid);
         SubscribeQos sq = new SubscribeQos(glob);
         subRet = senderConnection.subscribe(sk.toXml(), sq.toXml());
         log.info("testSubscribeUnSubscribeOid() subscribed to " + subRet.getSubscriptionId());
      }
      catch (XmlBlasterException e) {
         log.severe("testSubscribeUnSubscribeOid() subscribe failed: " + e.getMessage());
         fail("testSubscribeUnSubscribeOid() subscribe failed: " + e.getMessage());
View Full Code Here

      SubscribeReturnQos subRet = null;
      try {
         SubscribeKey sk = new SubscribeKey(glob, "SomeDummySubscribe");
         SubscribeQos sq = new SubscribeQos(glob);
         subRet = senderConnection.subscribe(sk.toXml(), sq.toXml());
         log.info("testSubscribeUnSubscribeEmpty() subscribed to " + subRet.getSubscriptionId());
      }
      catch (XmlBlasterException e) {
         log.severe("testSubscribeUnSubscribeEmpty() subscribe failed: " + e.getMessage());
         fail("testSubscribeUnSubscribeEmpty() subscribe failed: " + e.getMessage());
View Full Code Here

      log.info("Subscribing message '" + publishOid + "'...");
      try {
         // Subscribe for the volatile message
         SubscribeKey sk = new SubscribeKey(glob, publishOid);
         SubscribeQos sq = new SubscribeQos(glob);
         subscribeReturnQos = con.subscribe(sk.toXml(), sq.toXml());
         log.info("Subscribing of '" + publishOid + "' done");
      } catch(XmlBlasterException e) {
         log.severe("subscribe() XmlBlasterException: " + e.getMessage());
         assertTrue("subscribe - XmlBlasterException: " + e.getMessage(), false);
      }
View Full Code Here

      subQos.setMultiSubscribe(false);
      subQos.setWantInitialUpdate(false);
      subQos.setPersistent(true);
      // this fills the client properties with the contents of the individualInfo object.
      new ClientPropertiesInfo(subQos.getData().getClientProperties(), individualInfo);
      session.subscribe(this.dataTopic, subQos.toXml());
      synchronized(this.initSync) {
         setStatus(STATUS_INITIAL);
      }
   }
  
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.