Package org.xmlBlaster.client.qos

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


      PublishKey key = new PublishKey(glob, "", contentMime, contentMimeExtended);
      key.setClientTags("<location dest='agent-192.168.10.218' driver='PSD1'></location>");
      PublishQos qos = new PublishQos(glob);
      senderContent = "some content";
      try {
         MsgUnit msgUnit = new MsgUnit(key.toXml(), senderContent.getBytes(), qos.toXml());
         sentTimestamp = new Timestamp();
         publishOid = con.publish(msgUnit).getKeyOid();
         log.info("Success: Publishing done, returned oid=" + publishOid);
      } catch(XmlBlasterException e) {
         log.warning("XmlBlasterException: " + e.getMessage());
View Full Code Here


         // TODO TEST THE maxEntriesCache != entriesCache. First specify the required behaviour.
         historyQueueProp.setMaxEntriesCache(numHistory);
         qosWrapper.setTopicProperty(topicProp);              
      }
     
      MsgUnit msgUnit = new MsgUnit(xmlKey, content.getBytes(), qosWrapper.toXml());

      this.glob.getXmlBlasterAccess().publish(msgUnit);
      log.info("Success: Publishing of " + oid + " done");
   }
View Full Code Here

                      "   <TestPubForce-AGENT id='192.168.124.10' subId='1' type='generic'>" +
                      "   </TestPubForce-AGENT>" +
                      "</key>";
      PublishQos qosWrapper = new PublishQos(glob);
      qosWrapper.setForceUpdate(forceUpdate);
      String qos = qosWrapper.toXml(); // == "<qos><forceUpdate/></qos>"

      try {
         MsgUnit msgUnit = new MsgUnit(xmlKey, senderContent.getBytes(), qos);
         publishOid = senderConnection.publish(msgUnit).getKeyOid();
         log.info("Success: Publishing done, returned oid=" + publishOid);
View Full Code Here

      if (log.isLoggable(Level.FINE)) log.fine("TestPublishQos");
      PublishQos qos = new PublishQos(this.glob);
      qos.addClientProperty("oneKey", "oneValue");
      qos.addClientProperty("twoKey", "twoValue");
      qos.addClientProperty("threeKey", new Integer(55));
      String literal = qos.toXml();
     
      MsgQosSaxFactory factory = new MsgQosSaxFactory(this.glob);
      try {
         MsgQosData data = factory.readObject(literal);
         checkValues(data.getClientProperties());
View Full Code Here

      if (log.isLoggable(Level.FINE)) log.fine("2. Publish a message ...");
      try {
         String xmlKey = "<key oid='" + publishOid + "' contentMime='text/plain'>\n</key>";
         PublishQos qosWrapper = new PublishQos(glob); // the same as "<qos></qos>"
         MsgUnit msgUnit = new MsgUnit(xmlKey, senderContent.getBytes(), qosWrapper.toXml());
         connection.publish(msgUnit);
         log.info("Success, published a message");
      } catch(XmlBlasterException e) {
         assertTrue("publish - XmlBlasterException: " + e.getMessage(), false);
      }
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

      String xmlKey = "<key oid='" + oid + "' contentMime='" + contentMime + "'>\n" +
                      "   <TestXmlBlasterAccessMultiThreaded-AGENT id='192.168.124.10' subId='1' type='generic'>" +
                      "   </TestXmlBlasterAccessMultiThreaded-AGENT>" +
                      "</key>";
      PublishQos qosWrapper = new PublishQos(glob); // == "<qos></qos>"
      MsgUnit msgUnit = new MsgUnit(xmlKey, content.getBytes(), qosWrapper.toXml());

      con.publish(msgUnit);
      log.info("Success: Publishing of " + oid + " content='" + content + "' done");
      return msgUnit;
   }
View Full Code Here

            PublishQos pq = new PublishQos(glob);
            SessionName sessionName = heronCon.getConnectReturnQos().getSessionName(); // destination client
            Destination destination = new Destination(sessionName);
            destination.forceQueuing(true);
            pq.addDestination(destination);
            log.info("Sending PtP message '" + oid + "' from bilbo to '" + sessionName + "' :" + pq.toXml());
            MsgUnit msgUnit = new MsgUnit(pk, (contentStr+"-"+i).getBytes(), pq);
            PublishReturnQos prq = bilboCon.publish(msgUnit);
            log.info("Published message to destination='" + sessionName +
                                       "' content='" + (contentStr+"-"+i) +
                                       "' to xmlBlaster node with IP=" + serverHelper.getBilboGlob().getProperty().get("bootstrapPort",0) +
View Full Code Here

                      "   <TestFailSafePing-AGENT id='192.168.124.10' subId='1' type='generic'>" +
                      "   </TestFailSafePing-AGENT>" +
                      "</key>";
      String content = "" + counter;
      PublishQos qosWrapper = new PublishQos(glob); // == "<qos></qos>"
      MsgUnit msgUnit = new MsgUnit(xmlKey, content.getBytes(), qosWrapper.toXml());
      msgUnitArr = new MsgUnit[] { msgUnit };
      con.publish(msgUnit);
      log.info("Success: Publishing of " + oid + " done");
   }
View Full Code Here

      if (xmlQos == null) {
         xmlQos = xmlQosGiven;
      }
      if (xmlQos == null) {
         PublishQos publishQos = new PublishQos(glob);
         xmlQos = publishQos.toXml()// default qos = "<qos></qos>"
      }

      feed(xmlKey, content, xmlQos);
   }
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.