Examples of SubscribeQos


Examples of org.xmlBlaster.client.qos.SubscribeQos

    */
   public void testOneway() throws Exception {
      if (log.isLoggable(Level.FINE)) log.fine("Subscribing using EXACT syntax ...");

      SubscribeKey sk = new SubscribeKey(glob, this.oidExact);
      SubscribeQos sq = new SubscribeQos(glob);
      sq.setWantUpdateOneway(true);
      this.senderConnection.subscribe(sk, sq);
      log.info("Success: Subscribe done");
     
      PublishKey pk = new PublishKey(glob, this.oidExact);
      PublishQos pq = new PublishQos(glob);
View Full Code Here

Examples of org.xmlBlaster.client.qos.SubscribeQos

      String passwd = "secret";

      SubscribeKey subKeyW = new SubscribeKey(glob, publishOid1);
      String subKey = subKeyW.toXml(); // "<key oid='" + publishOid1 + "' queryType='EXACT'></key>";

      SubscribeQos subQosW = new SubscribeQos(glob); // "<qos></qos>";
      String subQos = subQosW.toXml();

      manyClients = new Client[numClients];

      log.info("Setting up " + numClients + " subscriber clients ...");
      stopWatch = new StopWatch();
View Full Code Here

Examples of org.xmlBlaster.client.qos.SubscribeQos

      String passwd = "secret";

      SubscribeKey subKeyW = new SubscribeKey(glob, publishOid1);
      String subKey = subKeyW.toXml(); // "<key oid='" + publishOid1 + "' queryType='EXACT'></key>";

      SubscribeQos subQosW = new SubscribeQos(glob); // "<qos></qos>";
      String subQos = subQosW.toXml();

      manyClients = new Client[numClients];

      long usedBefore = getUsedServerMemory();
View Full Code Here

Examples of org.xmlBlaster.client.qos.SubscribeQos

      if (log.isLoggable(Level.FINE)) log.fine("Subscribing ...");

      SubscribeKey subKeyW = new SubscribeKey(glob, publishOid2);
      String subKey = subKeyW.toXml(); // "<key oid='" + publishOid2 + "' queryType='EXACT'></key>";

      SubscribeQos subQosW = new SubscribeQos(glob); // "<qos></qos>";
      String subQos = subQosW.toXml();

      try {
         oneConnection.subscribe(subKey, subQos);
         log.info("Client " + oneName + " subscribed to " + subKeyW.getOid());
      } catch(XmlBlasterException e) {
View Full Code Here

Examples of org.xmlBlaster.client.qos.SubscribeQos

   {
      if (log.isLoggable(Level.FINE)) log.fine("Subscribing using XPath syntax ...");

      String xmlKey = "<key oid='" + oidExact + "' queryType='EXACT'>\n" +
                      "</key>";
      SubscribeQos sq = new SubscribeQos(glob);
      int myCounter = 99;
      try {
         sentSubscribeId = Constants.SUBSCRIPTIONID_PREFIX +
                  "client/someOtherUser/session/1" +
                  "-" + myCounter;
         sq.setSubscriptionId(sentSubscribeId);
         senderConnection.subscribe(xmlKey, sq.toXml()).getSubscriptionId();
         fail("Illegal subscriptionId should throw an exception");
        
      } catch(XmlBlasterException e) {
         log.info("SUCCESS, got expected XmlBlasterException: " + e.getMessage());
      }
View Full Code Here

Examples of org.xmlBlaster.client.qos.SubscribeQos

   {
      if (log.isLoggable(Level.FINE)) log.fine("Subscribing using XPath syntax ...");

      String xmlKey = "<key oid='" + oidExact + "' queryType='EXACT'>\n" +
                      "</key>";
      SubscribeQos sq = new SubscribeQos(glob);
      int myCounter = 99;
      try {
         sentSubscribeId = Constants.SUBSCRIPTIONID_PREFIX +
                  connectReturnQos.getSessionName().getRelativeName(true) +
                  "-" + myCounter;
         sq.setSubscriptionId(sentSubscribeId);
         numReceived = 0;
         this.subscribeId = null;
         this.subscribeId = senderConnection.subscribe(xmlKey, sq.toXml()).getSubscriptionId();
         assertEquals("Sent sentSubscribeId= " + sentSubscribeId + " The returned subscriptionId=" + subscribeId + " is wrong", sentSubscribeId, subscribeId);
         log.info("Success: Subscribe on " + subscribeId + " done");
        
      } catch(XmlBlasterException e) {
         log.warning("XmlBlasterException: " + e.getMessage());
View Full Code Here

Examples of org.xmlBlaster.client.qos.SubscribeQos

   public void subscribeMsg() {
      log.info("Subscribing message '" + publishOid + "'...");
      try {
         // Subscribe for the volatile message
         SubscribeKey sk = new SubscribeKey(glob, publishOid);
         SubscribeQos sq = new SubscribeQos(glob);
         this.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

Examples of org.xmlBlaster.client.qos.SubscribeQos

      }

      // Subscribe to a message with a supplied filter
      try {
         // One sport subscriber
         SubscribeQos qos = new SubscribeQos(glob);
         qos.addAccessFilter(new AccessFilterQos(glob, "XPathFilter", "1.0", "/news[@type='sport']"));
        
         subscribeOid = con.subscribe("<key oid='MSG'/>", qos.toXml()).getSubscriptionId();
         subscriberTable.put(subscribeOid, new Integer(0));
         log.info("Success: Subscribe subscription-id=" + subscribeOid + " done");
         // One culture subscriber
         qos = new SubscribeQos(glob);
         qos.addAccessFilter(new AccessFilterQos(glob, "XPathFilter", "1.0", "/news[@type='culture']"));
        
         subscribeOid2 = con.subscribe("<key oid='MSG'/>", qos.toXml()).getSubscriptionId();
         subscriberTable.put(subscribeOid2, new Integer(1));
         log.info("Success: Subscribe subscription-id2=" + subscribeOid2 + " done");

         // 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);
         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

Examples of org.xmlBlaster.client.qos.SubscribeQos

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

Examples of org.xmlBlaster.client.qos.SubscribeQos

   public void doSubscribe() {
      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();

         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
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.