Package org.xmlBlaster.client.qos

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


      }

      SubscribeKey sk = new SubscribeKey(glob, msgOid);
      SubscribeQos sq = new SubscribeQos(glob);
      //String ret = xmlBlasterImpl.subscribe(sessionId, sk.toXml(), sq.toXml());
      SubscribeReturnQos subscribeReturnQos = xmlBlasterCon.subscribe(sk.toXml(), sq.toXml());

      // Remember subscriptions of this I_Notify instance ...
      synchronized (subscriptionsByNotifierMap) {
         Set subscriptions = (Set)subscriptionsByNotifierMap.get(callback);
         if (subscriptions == null) {
View Full Code Here


        
         HistoryQos historyQos = new HistoryQos(globSub);
         historyQos.setNumEntries(1);
         sq.setHistoryQos(historyQos);

         /*SubscribeReturnQos srq = */conSub.subscribe(sk.toXml(), sq.toXml());
         log.info("Subscription to '" + oid + "' done");

         log.info("============ STEP 2: Start publisher");
         Global globPub = glob.getClone(null);
         conPub = globPub.getXmlBlasterAccess();
View Full Code Here

         for(int i=0; i<numCreate; i++) {
            SubscribeKey sk = new SubscribeKey(glob, "XX");
            SubscribeQos sq = new SubscribeQos(glob);
            entryArr[i] = new MsgQueueSubscribeEntry(glob, storageId, sk.getData(), sq.getData());
            if (i > 0 && (i % step) == 0) {
               int loadSize = sk.toXml().length() + sq.toXml().length();
               log.info("Overall created #" + i + ": Created " + step + " new MsgQueueSubscribeEntry instances, key+qos size=" + loadSize + ", hit a key to create more ...");
               try { System.in.read(); } catch(java.io.IOException e) {}
            }
            if (log.isLoggable(Level.FINE)) log.fine("Dump meat: " + entryArr[i].toXml());
         }
View Full Code Here

            SubscribeQos qos = new SubscribeQos(glob);
            qos.setMultiSubscribe(false);
            if (aq != null) {
               qos.addAccessFilter(aq);
            }
            SubscribeReturnQos ret = this.connection.subscribe(key.toXml(), qos.toXml());
            log.info("Subscribe #" + i + " state=" + ret.getState() + " subscriptionId=" + ret.getSubscriptionId());
            if (subscribeId == null) {
               subscribeId = ret.getSubscriptionId();
               assertEquals("", Constants.STATE_OK, ret.getState());
               continue;
View Full Code Here

               }
            });

         SubscribeKey sk = new SubscribeKey(glob1, oid);
         SubscribeQos sq = new SubscribeQos(glob1);
         con1.subscribe(sk.toXml(), sq.toXml());

         try { Thread.sleep(1000); } catch( InterruptedException i) {} // Wait some time
         assertTrue(assertInUpdate, assertInUpdate == null);

         Client.shutdownCb(con1, Client.Shutdown.LEAVE_SERVER);
View Full Code Here

               }
            });

         sk = new SubscribeKey(glob2, oid);
         sq = new SubscribeQos(glob2);
         con2.subscribe(sk.toXml(), sq.toXml());

         sk = new SubscribeKey(glob2, Constants.OID_DEAD_LETTER);
         sq = new SubscribeQos(glob2);
         con2.subscribe(sk.toXml(), sq.toXml(), new I_Callback() {
            public String update(String cbSessionId, UpdateKey updateKey, byte[] content, UpdateQos updateQos) {
View Full Code Here

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

         sk = new SubscribeKey(glob2, Constants.OID_DEAD_LETTER);
         sq = new SubscribeQos(glob2);
         con2.subscribe(sk.toXml(), sq.toXml(), new I_Callback() {
            public String update(String cbSessionId, UpdateKey updateKey, byte[] content, UpdateQos updateQos) {
               deadMessageCounter++;
               log.info("****** Reveiving asynchronous message '" + updateKey.getOid() + "' in deadMessage handler, content=" + new String(content));
               assertEquals("No dead letter received", Constants.OID_DEAD_LETTER, updateKey.getOid());
               return "";
View Full Code Here

         {
            SubscribeKey key = new SubscribeKey(glob, publishOid);
            SubscribeQos qos = new SubscribeQos(glob);
            qos.setWantLocal(false);
            this.updateInterceptor1 = new MsgInterceptor(glob, log, null); // Collect received msgs
            SubscribeReturnQos ret = this.connection.subscribe(key.toXml(), qos.toXml(), this.updateInterceptor1);
            subscribeId1 = ret.getSubscriptionId();
         }
         {
            SubscribeKey key = new SubscribeKey(glob, publishOid);
            SubscribeQos qos = new SubscribeQos(glob);
View Full Code Here

      // Subscribe to a message with a supplied filter
      try {
         SubscribeQos qos = new SubscribeQos(glob);
         qos.addAccessFilter(new AccessFilterQos(glob, "ContentLenFilter", "1.0", ""+filterMessageContentBiggerAs));

         String subscribeOid = con.subscribe("<key oid='MSG'/>", qos.toXml()).getSubscriptionId();
         log.info("Success: Subscribe subscription-id=" + subscribeOid + " done");

         con.subscribe("<key oid='" + Constants.OID_DEAD_LETTER + "'/>", "<qos/>");
       
      } catch(XmlBlasterException e) {
View Full Code Here

         {
            SubscribeKey key = new SubscribeKey(glob, publishOid);
            SubscribeQos qos = new SubscribeQos(glob);
            qos.setWantLocal(true);
            this.updateInterceptor2 = new MsgInterceptor(glob, log, null); // Collect received msgs
            SubscribeReturnQos ret = connection.subscribe(key.toXml(), qos.toXml(), this.updateInterceptor2);
            subscribeId2 = ret.getSubscriptionId();
         }
      } catch(XmlBlasterException e) {
         log.warning("XmlBlasterException: " + e.getMessage());
         fail("subscribe - XmlBlasterException: " + e.getMessage());
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.