Package org.xmlBlaster.client.key

Examples of org.xmlBlaster.client.key.PublishKey.toXml()


            return;
         }
         for (int ii=0; ii<msgArr.length; ii++) {
            PublishKey key = new PublishKey(glob, "__sys_jdbc."+ME, "text/xml", "SQLQuery");
            PublishQos qos = new PublishQos(glob, new Destination(new SessionName(glob, cust)));
            MsgUnitRaw msgUnitRaw = new MsgUnitRaw(msgArr[ii], key.toXml(), msgArr[ii].getContent(), qos.toXml());
            String  oid = callback.publish(msgUnitRaw);
            if (log.isLoggable(Level.FINEST)) log.finest("Delivered Results...\n" + new String(content));
         }
      }
      catch (XmlBlasterException e) {
View Full Code Here


   public void publishMany()
   {
      if (log.isLoggable(Level.FINE)) log.fine("Publishing a message ...");

      PublishKey pubKeyW = new PublishKey(glob, publishOid2, contentMime, contentMimeExtended);
      String pubKey = pubKeyW.toXml(); // "<key oid='" + publishOid2 + "' contentMime='" + contentMime + "' contentMimeExtended='" + contentMimeExtended + "'></key>"

      PublishQos pubQosW = new PublishQos(glob);
      String pubQos = pubQosW.toXml(); // "<qos></qos>"

      long usedBefore = getUsedServerMemory();
View Full Code Here

      log.info("*****Publishing messages ...");

      try {
         PublishKey pk = new PublishKey(glob, "command-navigation", "text/plain", "1.0");
         PublishQos pq = new PublishQos(glob);
         MsgUnit msgUnit = new MsgUnit(pk.toXml(), "Hi".getBytes(), pq.toXml());
         con1.publish(msgUnit);
         log.info("Published message '" + pk.getOid() + "'");

         pk = new PublishKey(glob, "command-radar-1", "text/plain", "1.0");
         pq = new PublishQos(glob);
View Full Code Here

         con1.publish(msgUnit);
         log.info("Published message '" + pk.getOid() + "'");

         pk = new PublishKey(glob, "command-radar-1", "text/plain", "1.0");
         pq = new PublishQos(glob);
         msgUnit = new MsgUnit(pk.toXml(), "Hi".getBytes(), pq.toXml());
         con1.publish(msgUnit);
         log.info("Published message '" + pk.getOid() + "'");

         pk = new PublishKey(glob, "dummyTestSubXPathMany", "text/plain", "1.0");
         pq = new PublishQos(glob);
View Full Code Here

         con1.publish(msgUnit);
         log.info("Published message '" + pk.getOid() + "'");

         pk = new PublishKey(glob, "dummyTestSubXPathMany", "text/plain", "1.0");
         pq = new PublishQos(glob);
         msgUnit = new MsgUnit(pk.toXml(), "Hi".getBytes(), pq.toXml());
         con1.publish(msgUnit);
         log.info("Published message '" + pk.getOid() + "'");
      }
      catch (XmlBlasterException e) {
         fail("doPublish failed: " + e.toString());
View Full Code Here

         //msgQosData.dirtyRead(null);//NodeId
         msgQosData.setPriority(PriorityEnum.LOW4_PRIORITY);
         msgQosData.setFromPersistenceStore(true);
         msgQosData.setLifeTime(4000L);
         msgQosData.setRemainingLifeStatic(6000L);
         MsgUnit msgUnit  = new MsgUnit(key.toXml(), content, msgQosData.toXml());

         log.fine("Testing" + msgQosData.toXml());

         SessionName receiver = new SessionName(glob, "receiver1");
         String subscriptionId = "subid";
View Full Code Here

         //msgQosData.dirtyRead(null);//NodeId
         msgQosData.setPriority(PriorityEnum.LOW4_PRIORITY);
         msgQosData.setFromPersistenceStore(true);
         msgQosData.setLifeTime(4000L);
         msgQosData.setRemainingLifeStatic(6000L);
         MsgUnit msgUnit  = new MsgUnit(key.toXml(), content, msgQosData.toXml());

         log.fine("Testing" + msgQosData.toXml());

         org.xmlBlaster.engine.ServerScope global = new org.xmlBlaster.engine.ServerScope();
         MsgUnitWrapper msgWrapper = new MsgUnitWrapper(glob, msgUnit, queue.getStorageId());
View Full Code Here

            }
            else {
               content = org.xmlBlaster.util.ReplaceVariable.replaceAll(contentStr, "%counter", ""+(i+1)).getBytes();
            }

            if (log.isLoggable(Level.FINEST)) log.finest("Going to parse publish message: " + pk.toXml() + " : " + content + " : " + pq.toXml());
            MsgUnit msgUnit = new MsgUnit(pk, content, pq);
            if (log.isLoggable(Level.FINEST)) log.finest("Going to publish message: " + msgUnit.toXml());

            if (oneway) {
               MsgUnit msgUnitArr[] = { msgUnit };
View Full Code Here

         // publish again ...
         pk = new PublishKey(glob, oid, "text/plain", "1.0");
         pk.setDomain(domain);
         pq = new PublishQos(glob);
         msgUnit = new MsgUnit(pk.toXml(), contentStr.getBytes(), pq.toXml());
         prq = bilboCon.publish(msgUnit);
         log.info("Published message of domain='" + pk.getDomain() + "' and content='" + contentStr +
                                    "' to xmlBlaster node bilbo with IP=" + serverHelper.getBilboGlob().getProperty().get("bootstrapPort",0) +
                                    ", the returned QoS is: " + prq.getKeyOid());
View Full Code Here

         else {
            qos = "<qos/>";
         }
      }
      PublishKey pubKey = new PublishKey(this.glob, oid);
      MsgUnit msg = new MsgUnit(this.glob, pubKey.toXml(), message, qos);
      return this.con.publish(msg).toXml();
   }

   public boolean registerAlertListener(I_Update update, Map attrs) throws Exception {
      if (this.eventHandler != null)
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.