Package org.xmlBlaster.util.qos

Examples of org.xmlBlaster.util.qos.TopicProperty


      }
      return notifyList;
   }

   public void startDestroyTimer() {
      TopicProperty topicProperty = this.topicProperty;
      if (topicProperty != null && topicProperty.getDestroyDelay() > 0L) {
         if (this.timerKey == null) {
            this.timerKey = this.destroyTimer.addTimeoutListener(this, topicProperty.getDestroyDelay(), getUniqueKey());
         }
      }
   }
View Full Code Here


    */
   private void addToBigDom() throws XmlBlasterException {
      if (isRegisteredInBigXmlDom) {
         return;
      }
      TopicProperty topicProperty = this.topicProperty;
      if (topicProperty != null && !topicProperty.createDomEntry()) {
         return;
      }
      getXmlKey().mergeRootNode(requestBroker.getBigXmlKeyDOM());
      isRegisteredInBigXmlDom = true;
   }
View Full Code Here

                  if (eraseKey != null) // To have all attributes for cluster slaves getting forwarded the erase
                     pq.addClientProperty("__eraseKey", eraseKey.toXml());
                  if (eraseQos != null) // To have all attributes for cluster slaves getting forwarded the erase
                     pq.addClientProperty("__eraseQos", eraseQos.toXml());
                  if (i==0) {
                     TopicProperty topicProperty = new TopicProperty(serverScope);
                     //topicProperty.setDestroyDelay(destroyDelay);
                     topicProperty.setCreateDomEntry(false);
                     org.xmlBlaster.util.qos.storage.HistoryQueueProperty prop = new org.xmlBlaster.util.qos.storage.HistoryQueueProperty(this.serverScope, null);
                     prop.setMaxEntriesCache(0);
                     prop.setMaxEntries(0);
                     topicProperty.setHistoryQueueProperty(prop);
                     pq.setTopicProperty(topicProperty);
                     if (log.isLoggable(Level.FINE)) log.fine(ME+": Added TopicProperty to " + pk.getOid() + " on first publish: " + topicProperty.toXml());
                  }
                  MsgUnit msgUnit = new MsgUnit(pk, getId(), pq);
                  notifyList.add(msgUnit);
               }
View Full Code Here

      TopicEntry topicEntry = this.topicEntry;
      if (topicEntry != null) {
         sb.append(offset).append(" <topicEntry>").append(topicEntry.getLogId()).append("</topicEntry>");
      }

      TopicProperty topicProperty = this.topicProperty;
      if (topicProperty != null)
         sb.append(topicProperty.toXml(extraOffset+Constants.INDENT));

      I_Map msgUnitCache = this.msgUnitCache;
      if (msgUnitCache != null) {
         sb.append(msgUnitCache.toXml(extraOffset+Constants.INDENT));
      }
View Full Code Here

      }
   }

   /** JMX */
   public long getDestroyDelay() {
      TopicProperty t = this.topicProperty;
      if (t != null)
         return t.getDestroyDelay();
      return 0L;
   }
View Full Code Here

            PublishQos pq = new PublishQos(globPub);
            pq.setPriority(PriorityEnum.NORM_PRIORITY);
            pq.setPersistent(false);
            pq.setLifeTime(60000L);
            if (i == 0) {
               TopicProperty topicProperty = new TopicProperty(globPub);
               topicProperty.setDestroyDelay(60000L);
               topicProperty.setCreateDomEntry(true);
               topicProperty.setReadonly(false);
               topicProperty.getHistoryQueueProperty().setMaxEntries(numPub+5);
               pq.setTopicProperty(topicProperty);
               log.info("Added TopicProperty on first publish: " + topicProperty.toXml());
            }

            byte[] content = "Hello".getBytes();
            MsgUnit msgUnit = new MsgUnit(pk, content, pq);
            sentArr[i] = msgUnit;
View Full Code Here

         // 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());
         MsgUnitStoreProperty cache = topicProperty.getMsgUnitStoreProperty();
         assertEquals("", "msgUnitStore", cache.getRelating());
         assertEquals("", "TO", cache.getType());
         assertEquals("", "3.0", cache.getVersion());
         assertEquals("", 4L, cache.getMaxEntries());
         assertEquals("", 40L, cache.getMaxBytes());
         assertEquals("", "deadMessage", cache.getOnOverflow());

         assertEquals("", true, topicProperty.hasHistoryQueueProperty());
         HistoryQueueProperty hist = topicProperty.getHistoryQueueProperty();
         assertEquals("", "history", hist.getRelating());
         assertEquals("", "HI", hist.getType());
         assertEquals("", "2.0", hist.getVersion());
         assertEquals("", 3L, hist.getMaxEntries());
         assertEquals("", 30L, hist.getMaxBytes());
View Full Code Here

                      "   </TestHistoryZero-AGENT>" +
                      "</key>";
      String content = "" + counter;
      PublishQos qosWrapper = new PublishQos(glob); // == "<qos></qos>"
      if (numHistory > -1) {
         TopicProperty topicProp = new TopicProperty(this.glob);
         HistoryQueueProperty historyQueueProp = topicProp.getHistoryQueueProperty();
         historyQueueProp.setMaxEntries(numHistory);
         // TODO TEST THE maxEntriesCache != entriesCache. First specify the required behaviour.
         historyQueueProp.setMaxEntriesCache(numHistory);
         qosWrapper.setTopicProperty(topicProp);              
      }
View Full Code Here

         else {
            PublishQos publishQos = new PublishQos(engineGlob);
            publishQos.setLifeTime(-1L);
            publishQos.setForceUpdate(true);
            // TODO: Configure history depth to 0 only on first publish
            TopicProperty topicProperty = new TopicProperty(engineGlob);
            HistoryQueueProperty historyQueueProperty = new HistoryQueueProperty(engineGlob, engineGlob.getId());
            historyQueueProperty.setMaxEntriesCache(2);
            historyQueueProperty.setMaxEntries(2);
            topicProperty.setHistoryQueueProperty(historyQueueProperty);
            publishQos.setTopicProperty(topicProperty);
            msgQosData = publishQos.getData();
         }
         if (summary != null && summary.length() > 0)
            msgQosData.addClientProperty(Constants.EVENTPLUGIN_PROP_SUMMARY, summary); // "_summary"
View Full Code Here

    */
   public PublishReturnQos createTemporaryTopic(String uniqueTopicId, long destroyDelay, int historyMaxMsg) throws XmlBlasterException {
    if (uniqueTopicId == null) uniqueTopicId = "";
      PublishKey pk = new PublishKey(glob, uniqueTopicId);
      PublishQos pq = new PublishQos(glob);
      TopicProperty topicProperty = new TopicProperty(glob);
      topicProperty.setDestroyDelay(destroyDelay);
      topicProperty.setCreateDomEntry(false);
      topicProperty.setReadonly(false);
      pq.setAdministrative(true);
      if (historyMaxMsg >= 0L) {
         HistoryQueueProperty prop = new HistoryQueueProperty(this.glob, null);
         prop.setMaxEntries(historyMaxMsg);
         topicProperty.setHistoryQueueProperty(prop);
      }
      pq.setTopicProperty(topicProperty);
      MsgUnit msgUnit = new MsgUnit(pk, new byte[0], pq);
      PublishReturnQos prq = publish(msgUnit);
      if (log.isLoggable(Level.FINER)) log.finer(getLogId()+"Created temporary topic " + prq.getKeyOid());
View Full Code Here

TOP

Related Classes of org.xmlBlaster.util.qos.TopicProperty

Copyright © 2018 www.massapicom. 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.