Examples of MsgQosData


Examples of org.xmlBlaster.util.qos.MsgQosData

   /**
    * Default constructor for transient messages.
    */
   public PublishQos(Global glob) {
      this.glob = (glob==null) ? Global.instance() : glob;
      this.msgQosData = new MsgQosData(this.glob, this.glob.getMsgQosFactory(), MethodName.PUBLISH);
      this.msgQosData.setMethod(MethodName.PUBLISH);
      /*
      // deprecated:
      long lt = this.glob.getProperty().get("message.lifeTime", -1L);
      if (lt != -1L) {
View Full Code Here

Examples of org.xmlBlaster.util.qos.MsgQosData

      final QosData qosData = getQosData();
      final MethodName m = qosData.getMethod();
      if (MethodName.PUBLISH.equals(m) || MethodName.PUBLISH_ARR.equals(m) || MethodName.PUBLISH_ONEWAY.equals(m)
       || MethodName.UPDATE.equals(m) || MethodName.UPDATE_ONEWAY.equals(m)) {
         if (qosData instanceof MsgQosData) {
            MsgQosData msgQosData = (MsgQosData)qosData;
            return (msgQosData.getDestinationArr().length > 0) ? msgQosData
               .getDestinationArr()[0]
               : null;
         }
      }
      return null;
View Full Code Here

Examples of org.xmlBlaster.util.qos.MsgQosData

            if (msgUnit.getQosData().getRcvTimestamp() == null)
               msgUnit.getQosData().touchRcvTimestamp();
            String clientPropertyKey = "__isErrorHandled" + msgUnit.getLogId();
            SessionName receiver = null; // !!!!! msgUnit.getQosData().getDestination();
            if (msgUnit.getQosData() instanceof MsgQosData) {
               MsgQosData mq = (MsgQosData)msgUnit.getQosData();
               if (mq.getDestinationArr().length > 0) {
                  receiver = mq.getDestinationArr()[0].getDestination();
               }
            }
            String txt = (e == null) ? "" : e.toString();
            if (e != null) {
              Throwable cause = e.getCause();
View Full Code Here

Examples of org.xmlBlaster.util.qos.MsgQosData

   }

   public void testMethods() {
      System.out.println("***MsgQosTest: testMethods ...");
     
      MsgQosData qos = new MsgQosData(this.glob, MethodName.UPDATE);

      qos.setState("AA");
      assertEquals("state", "AA", qos.getState());

      ClientProperty cp = new ClientProperty("aKey", "byte[]", Constants.ENCODING_BASE64, "bla");
      qos.addClientProperty(cp);
      Hashtable jxPath = qos.toJXPath();
      String value = (String)jxPath.get("/qos/clientProperty[@name='aKey']/text()");
      String bla = Base64.encode("bla".getBytes());
      assertEquals("JXPATH", bla, value);
      String type = (String)jxPath.get("/qos/clientProperty[@name='aKey']/@type");
      assertEquals("JXPATH", "byte[]", type);
View Full Code Here

Examples of org.xmlBlaster.util.qos.MsgQosData

   }

   public void testDestination() {
      System.out.println("***MsgQosTest: testDestination ...");

      MsgQosData qos = new MsgQosData(this.glob, MethodName.PUBLISH);
      assertEquals("", null, qos.getDestinations());
     
      Destination destination = new Destination("a@b", Constants.EXACT);

      assertNull("", qos.getDestinations());
      assertEquals("", 0, qos.getNumDestinations());
      assertEquals("", 0, qos.getDestinationArr().length);

      qos.addDestination(destination);
      assertNotNull("", qos.getDestinations());
      assertEquals("", 1, qos.getDestinations().size());
      assertEquals("", 1, qos.getNumDestinations());
      assertEquals("", 1, qos.getDestinationArr().length);

      MsgQosData qos2 = (MsgQosData)qos.clone();
      assertNotNull("", qos2.getDestinations());
      assertEquals("", 1, qos2.getDestinations().size());
      assertEquals("", 1, qos2.getNumDestinations());
      assertEquals("", 1, qos2.getDestinationArr().length);

      String xml = qos.toXml();
      MsgQosData qos3 = (MsgQosData)qos.clone();


      //dest.setDestination(new SessionName(Global.instance(), "Johann"));

      System.out.println("***MsgQosTest: testDestination [SUCCESS]");
View Full Code Here

Examples of org.xmlBlaster.util.qos.MsgQosData

            "      <node id='heron' stratum='0' timestamp='9408630564'/>\n" +
            "   </route>\n" +
            "</qos>\n";

         MsgQosSaxFactory factory = new MsgQosSaxFactory(glob);
         MsgQosData qos = factory.readObject(xml);

         assertEquals("", "AA", qos.getState());
         assertEquals("", "SOMETHING", qos.getStateInfo());
         assertEquals("", true, qos.isPtp());
         assertEquals("", true, qos.isAdministrative());
         assertEquals("", true, qos.isPersistent());
         assertEquals("", false, qos.isForceUpdate());
         assertEquals("", false, qos.isReadonly());
         assertEquals("", "Gesa", qos.getSender().getLoginName());

         assertEquals("", 0L, qos.getLifeTime()); // PtP message (because of Destination) is volatile
         assertEquals("", -1L, qos.getRemainingLifeStatic());

         assertEquals("", 3, qos.getRouteNodes().length);
         assertEquals("", 2, qos.getRouteNodes()[0].getStratum());
         assertEquals("", 0, qos.getRouteNodes()[2].getStratum());
         assertEquals("", 9408630500L, qos.getRouteNodes()[0].getTimestamp().getTimestamp());
         assertEquals("", true, qos.getRouteNodes()[0].getDirtyRead());
         assertEquals("", false, qos.getRouteNodes()[1].getDirtyRead());
         assertEquals("", false, qos.getRouteNodes()[2].getDirtyRead());

         assertEquals("", PriorityEnum.MIN_PRIORITY, qos.getPriority());
         assertEquals("", false, qos.isFromPersistenceStore());
         assertTrue("no receive timestamp expected", qos.getRcvTimestamp() == null);
         assertEquals("", true, qos.isSubscribable());
         assertEquals("", 2, qos.getDestinations().size());
         assertEquals("", true, ((Destination)qos.getDestinations().get(0)).forceQueuing());
         assertEquals("", true, ((Destination)qos.getDestinations().get(0)).isExactAddress());
         assertEquals("", false, ((Destination)qos.getDestinations().get(0)).isXPathQuery());
         // XPath is currently not supported
         //assertEquals("", false, ((Destination)qos.getDestinations().get(2)).isExactAddress());
         //assertEquals("", true, ((Destination)qos.getDestinations().get(2)).isXPathQuery());
      }
      catch (XmlBlasterException e) {
View Full Code Here

Examples of org.xmlBlaster.util.qos.MsgQosData

            "      <queue relating='history' type='HI' version='2.0' maxEntries='3' maxBytes='30' onOverflow='deadMessage'/>\n" +
            "   </topic>\n" +
            "</qos>\n";

         MsgQosSaxFactory factory = new MsgQosSaxFactory(glob);
         MsgQosData qos = factory.readObject(xml);
         String newXml = qos.toXml();
         log.info("lifeTime=" + qos.getLifeTimeProp().toXml());
         log.info("New XML=" + newXml);
         qos = factory.readObject(newXml);

         assertEquals("", "AA", qos.getState());
         assertEquals("", "SOMETHING", qos.getStateInfo());
         assertEquals("", true, qos.isPtp());
         assertEquals("", false, qos.isVolatile());
         assertEquals("", true, qos.isAdministrative());
         assertEquals("", true, qos.isPersistent());
         assertEquals("", false, qos.isForceUpdate());
         assertEquals("", true, qos.isReadonly());
         assertEquals("", "Gesa", qos.getSender().getLoginName());

         assertEquals("", 2400L, qos.getLifeTime());
         assertEquals("", 12000L, qos.getRemainingLifeStatic());
         assertEquals("", 1234L, qos.getRcvTimestamp().getTimestamp());
         assertEquals("", true, qos.isForceDestroy());
         //assertTrue("no receive timestamp expected", qos.getRcvTimestamp() == null);

         assertEquals("", 3, qos.getRouteNodes().length);
         assertEquals("", 2, qos.getRouteNodes()[0].getStratum());
         assertEquals("", 0, qos.getRouteNodes()[2].getStratum());
         assertEquals("", 9408630500L, qos.getRouteNodes()[0].getTimestamp().getTimestamp());
         assertEquals("", true, qos.getRouteNodes()[0].getDirtyRead());
         assertEquals("", false, qos.getRouteNodes()[1].getDirtyRead());
         assertEquals("", false, qos.getRouteNodes()[2].getDirtyRead());

         assertEquals("", PriorityEnum.MIN_PRIORITY, qos.getPriority());
         assertEquals("", false, qos.isFromPersistenceStore());
         assertEquals("", false, qos.isSubscribable());
         assertEquals("", 2, qos.getDestinations().size());
         assertEquals("", true, ((Destination)qos.getDestinations().get(0)).forceQueuing());
         assertEquals("", true, ((Destination)qos.getDestinations().get(0)).isExactAddress());
         assertEquals("", false, ((Destination)qos.getDestinations().get(0)).isXPathQuery());
         // XPATH is currently not supported
         //assertEquals("", false, ((Destination)qos.getDestinations().get(2)).isExactAddress());
         //assertEquals("", true, ((Destination)qos.getDestinations().get(2)).isXPathQuery());

         assertEquals("", true, qos.hasTopicProperty());
         TopicProperty topicProperty = qos.getTopicProperty();
         assertEquals("", true, topicProperty.isReadonly());
         assertEquals("", 120000, topicProperty.getDestroyDelay());
         assertEquals("", true, topicProperty.createDomEntry());

         assertEquals("", true, topicProperty.hasMsgUnitStoreProperty());
View Full Code Here

Examples of org.xmlBlaster.util.qos.MsgQosData

            "<qos>\n" +
            "   <rcvTimestamp nanos='" + timestamp.getTimestamp() + "'/>\n" + // if from persistent store
            "</qos>\n";

         MsgQosSaxFactory factory = new MsgQosSaxFactory(glob);
         MsgQosData qos = factory.readObject(xml);

         assertEquals("", timestamp.getTimestamp(), qos.getRcvTimestamp().getTimestamp());
      }
      catch (XmlBlasterException e) {
         fail("testFromPersistentStore failed: " + e.toString());
      }
View Full Code Here

Examples of org.xmlBlaster.util.qos.MsgQosData

    */
   public void testAdministrative() {
      System.out.println("***MsgQosFactoryTest: testAdministrative ...");
     
      //try {
         MsgQosData msgQosData = new MsgQosData(glob, MethodName.PUBLISH);
         msgQosData.setAdministrative(true);
         assertEquals("", PriorityEnum.MAX_PRIORITY.getInt(), msgQosData.getPriority().getInt());
         String xml = msgQosData.toXml();
         /*
            "<qos>\n" +
            "   <priority>MAX</priority>\n" +
            "   <administrative/>\n" +
            "</qos>\n";
View Full Code Here

Examples of org.xmlBlaster.util.qos.MsgQosData

   public void testDefault() {
      System.out.println("***MsgQosFactoryTest: testDefault ...");
     
      try {
         MsgQosSaxFactory factory = new MsgQosSaxFactory(glob);
         MsgQosData qos = factory.readObject((String)null);
         //qos.addRouteInfo(new RouteInfo(new NodeId("master"), 0, new Timestamp(9408630587L)));
         assertEquals("", true, qos.isSubscribable());
         assertEquals("", false, qos.isPtp());
         assertEquals("", false, qos.isVolatile());
         assertEquals("", false, qos.isAdministrative());
         assertEquals("", false, qos.isPersistent());
         assertEquals("", true, qos.isForceUpdate());
         assertEquals("", false, qos.isReadonly());
         assertEquals("", null, qos.getSender());
         assertEquals("", 0, qos.getRouteNodes().length);
         assertEquals("", PriorityEnum.NORM_PRIORITY, qos.getPriority());
         assertEquals("", false, qos.isFromPersistenceStore());
         assertTrue("", qos.getRcvTimestamp() == null);
         assertEquals("", null, qos.getDestinations());
      }
      catch (XmlBlasterException e) {
         fail("testDefault 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.