Package org.xmlBlaster.client.qos

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


            System.err.println("->Subscribe from bilbo 2 ...");
            SubscribeKey sk = new SubscribeKey(glob, oid);
            sk.setDomain(domain);
            SubscribeQos sq = new SubscribeQos(glob);
            bilboCon2.subscribe(sk.toXml(), sq.toXml());
         }

         // First test subscribe ...
         {
            System.err.println("->Publish to avalon ...");
View Full Code Here


           
            System.err.println("->Subscribe from bilbo #" + ii + ", the message from avalon should arrive ...");
            SubscribeKey sk = new SubscribeKey(glob, oid);
            sk.setDomain(domain);
            SubscribeQos sq = new SubscribeQos(glob);
            bilboCons[ii].subscribe(sk.toXml(), sq.toXml());

            waitOnUpdate(2000L, 1);
            try { Thread.sleep(1000); } catch( InterruptedException i) {} // wait longer to check if too many arrive
            if (1 != updateCounterBilbo) log.severe("Did not expect " + updateCounterBilbo + " updates");
            assertEquals("message from avalon", 1, updateCounterBilbo);
View Full Code Here

         System.err.println("->Subscribe from bilbo ...");
         SubscribeKey sk = new SubscribeKey(glob, "/xmlBlaster/key[@oid='SubscribeToBilbo']", Constants.XPATH);
         sk.setDomain(domain)// set domain to allow cluster forwarding of subscription
         // without setting the domain the subscribe would just be handled by the slave connected to
         SubscribeQos sq = new SubscribeQos(glob);
         SubscribeReturnQos srq = bilboCon.subscribe(sk.toXml(), sq.toXml());

         System.err.println("->Publish to avalon ...");
         PublishKey avalon_pk = new PublishKey(glob, oid, "text/plain", "1.0", domain);
         PublishQos avalon_pq = new PublishQos(glob);
         MsgUnit avalon_msgUnit = new MsgUnit(avalon_pk, contentStr, avalon_pq);
View Full Code Here

   private void subscribe(String _key) {
      try {
         SubscribeKey key = new SubscribeKey(glob, _key, "XPATH");
         SubscribeQos qos = new SubscribeQos(glob);
         xmlBlaster.subscribe(key.toXml(), qos.toXml());
      }
      catch( Exception ex ) {
         System.err.println("error-error-error-error >>>"+ex.toString());
      }
   }
View Full Code Here

               sq.addClientProperty(key, clientPropertyMap.get(key).toString());
            }
         }

         log.info("SubscribeKey=\n" + sk.toXml());
         log.info("SubscribeQos=\n" + sq.toXml());

         if (firstConnect && (interactive && !autoSubscribe)) {
            Global.waitOnKeyboardHit("Hit a key to subscribe '" + qStr + "'");
         }
         firstConnect = false;
View Full Code Here

         subscribeServerId = con.getConnectReturnQos().getSecretSessionId() + con.getConnectReturnQos().getServerInstanceId();

         log.info("Subscribed on topic '" + ((oid.length() > 0) ? oid : xpath) +
                        "', got subscription id='" + this.srq.getSubscriptionId() + "'\n" + this.srq.toXml());
         if (log.isLoggable(Level.FINEST)) log.finest("Subscribed: " + sk.toXml() + sq.toXml() + srq.toXml());
      }
      catch (XmlBlasterException e) {
         log.severe(e.getMessage());
      }
   }
View Full Code Here

      }

      try {
         SubscribeKey key = new SubscribeKey(xmlBlaster.getGlobal(), text, "XPATH");
         SubscribeQos qos = new SubscribeQos(xmlBlaster.getGlobal() );
         this.subscribeReturnQos = xmlBlaster.subscribe(key.toXml(), qos.toXml());
         System.out.println(ME + " subscribe on " + text + "  ->  " + this.subscribeReturnQos.getSubscriptionId());
      }
      catch( Exception ex ) {
         System.err.println("error-error-error-error >>>"+ex.toString());
         System.out.println(ME + " " + ex.getMessage());
View Full Code Here

            System.err.println("->Subscribe from bilbo ...");
            SubscribeKey sk = new SubscribeKey(glob, oid);
            sk.setDomain(domain);
            SubscribeQos sq = new SubscribeQos(glob);
            SubscribeReturnQos srq = bilboCon.subscribe(sk.toXml(), sq.toXml());
         }

         System.err.println("->Publish to avalon ...");
         PublishKey avalon_pk = new PublishKey(glob, oid, "text/plain", "1.0", domain);
         PublishQos avalon_pq = new PublishQos(glob);
View Full Code Here

   private String subscribe(String xmlKey, String queryType)
   {
      try {
         SubscribeKey xmlKeyWr = new SubscribeKey(glob, xmlKey, queryType);
         SubscribeQos xmlQos = new SubscribeQos(glob);
         SubscribeReturnQos ret = xmlBlasterConnection.subscribe(xmlKeyWr.toXml(), xmlQos.toXml());
         String subscriptionId = ret.getSubscriptionId();
         log.info("Subscribed to [" + xmlKey + "] " + queryType + ", subscriptionId=" + subscriptionId);
         return subscriptionId;
      } catch(XmlBlasterException e) {
         log.severe("XmlBlasterException:\n" + e.getMessage());
View Full Code Here

   {
      if (subscriptionId == null || subscriptionId.length() < 1) return;
      try {
         SubscribeKey xmlKey = new SubscribeKey(glob, subscriptionId);
         SubscribeQos xmlQos = new SubscribeQos(glob);
         xmlBlasterConnection.unSubscribe(xmlKey.toXml(), xmlQos.toXml());
         if (log.isLoggable(Level.FINE)) log.fine("Unsubscribed from " + subscriptionId + " (GML and XML Packages)");
      } catch(XmlBlasterException e) {
         log.warning("unSubscribe(" + subscriptionId + ") failed: 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.