Examples of PublishKey


Examples of org.xmlBlaster.client.key.PublishKey

    * We publish some messages.
    */
   private void publishMessages() {
      try {

         PublishKey pk = new PublishKey(glob, "HelloWorld4", "text/plain", "1.0");
         PublishQos pq = new PublishQos(glob);
         MsgUnit msgUnit = new MsgUnit(pk, "Hi", pq);
         con.publish(msgUnit);
         log.info("Published message '" + pk.getOid() + "'");


         pk = new PublishKey(glob, "Banking", "text/plain", "1.0");
         pk.setClientTags("<Account><withdraw/></Account>"); // Add banking specific meta data
         pq = new PublishQos(glob);
         msgUnit = new MsgUnit(pk, "Ho".getBytes(), pq);
         con.publish(msgUnit);
         log.info("Published message '" + pk.getOid() + "'");

      }
      catch (XmlBlasterException e) {
         log.severe("Houston, we have a problem: " + e.getMessage());
      }
View Full Code Here

Examples of org.xmlBlaster.client.key.PublishKey

   }
  
   private void sendStatusInformation(String status) throws Exception {
      log.info("send status information '" + status + "'");
      I_XmlBlasterAccess conn = this.global.getXmlBlasterAccess();
      PublishKey pubKey = new PublishKey(this.global, this.statusTopic);
      Destination destination = new Destination(new SessionName(this.global, this.slaveSessionId));
      destination.forceQueuing(true);
      PublishQos pubQos = new PublishQos(this.global, destination);
      pubQos.setPersistent(true);
      MsgUnit msg = new MsgUnit(pubKey, status.getBytes(), pubQos);
View Full Code Here

Examples of org.xmlBlaster.client.key.PublishKey

    */
   public void requestInitialData(String dbWatcherSessionId, boolean onlyRegister) throws Exception {
      log.info(this.name + " sends now an initial update request to the Master '" + dbWatcherSessionId + "'");
      I_XmlBlasterAccess conn = this.global.getXmlBlasterAccess();
      // no oid for this ptp message
      PublishKey pubKey = new PublishKey(this.global, REQUEST_INITIAL_DATA_TOPIC);
      Destination destination = new Destination(new SessionName(this.global, dbWatcherSessionId));
      destination.forceQueuing(true);
      PublishQos pubQos = new PublishQos(this.global, destination);
      pubQos.addClientProperty(ReplicationConstants.SLAVE_NAME, this.slaveSessionId);
      pubQos.addClientProperty(ReplicationConstants.REPL_VERSION, this.ownVersion);
View Full Code Here

Examples of org.xmlBlaster.client.key.PublishKey

         // sending the cancel op to the DbWatcher
         log.info(this.name + " sends now a cancel request to the Master '" + this.dbWatcherSessionName + "'");
         I_XmlBlasterAccess conn = this.global.getXmlBlasterAccess();
         // no oid for this ptp message
         PublishKey pubKey = new PublishKey(this.global, REQUEST_CANCEL_UPDATE_TOPIC);
         Destination destination = new Destination(new SessionName(this.global, this.dbWatcherSessionName));
         destination.forceQueuing(true);
         PublishQos pubQos = new PublishQos(this.global, destination);
         pubQos.addClientProperty(ReplicationConstants.SLAVE_NAME, this.slaveSessionId);
         pubQos.setPersistent(false);
View Full Code Here

Examples of org.xmlBlaster.client.key.PublishKey

         }
         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();
   }
View Full Code Here

Examples of org.xmlBlaster.client.key.PublishKey

         String[] persistType = new String[] { ENTRY_TYPE_MSG_SERIAL, ENTRY_TYPE_MSG_XML };

         int numRuns = 4;
         for(int ii=0; ii<numRuns; ii++) {
            for(int jj=0; jj<persistType.length; jj++) {
               PublishKey publishKey = new PublishKey(glob, "HA");
               PublishQosServer publishQosServer = new PublishQosServer(glob, "<qos><persistent/></qos>");
               publishQosServer.getData().setPriority(PriorityEnum.HIGH_PRIORITY);
               MsgUnit msgUnit = new MsgUnit(publishKey.getData(), "HO".getBytes(), publishQosServer.getData());
               StorageId storageId = new StorageId(glob, "heron", "mystore", "someid");
               MsgUnitWrapper msgUnitWrapper = new MsgUnitWrapper(glob, msgUnit, null, storageId, 0, 0, persistType[jj], -1);
               msgUnitWrapper.startExpiryTimer();
               I_EntryFactory factory = glob.getEntryFactory();
View Full Code Here

Examples of org.xmlBlaster.client.key.PublishKey

            if (replPrefix == null)
               throw new XmlBlasterException(this.global, ErrorCode.USER_CONFIGURATION, ME, "at least one of the properties 'topicName', 'publishKey' or 'replication.prefix' must be defined");
            else
               topicName = "topic." + replPrefix.trim();
         }
         this.publishKey = (new PublishKey(this.global, topicName)).toXml();
      }
     
      this.publishQos = info_.get("mom.publishQos", "<qos/>");

      tmp  = info_.get("mom.connectQos", null);
View Full Code Here

Examples of org.xmlBlaster.client.key.PublishKey

            log.warning(ME+": constructor: since 'publishKey' is defined, 'topicName' will be ignored");
      }
      else {
         if (topicName == null)
            throw new XmlBlasterException(this.global, ErrorCode.USER_CONFIGURATION, ME, "at least one of the properties 'topicName' or 'publishKey' must be defined");
         this.publishKey = (new PublishKey(this.global, topicName)).toXml();
      }
     
      this.publishQos = this.global.get("publishQos", "<qos/>", null, pluginConfig);

      tmp  = this.global.get("connectQos", (String)null, null, pluginConfig);
View Full Code Here

Examples of org.xmlBlaster.client.key.PublishKey

      subscribeXPath("//demoXPath");
      assertEquals("numReceived after subscribe", 0, this.updateInterceptor.waitOnUpdate(1000L, null, null));
      this.updateInterceptor.clear();

      try {
         PublishKey pk = new PublishKey(glob, oid, "text/xml", "1.0");
         pk.setClientTags("<org.xmlBlaster><demoXPath/></org.xmlBlaster>");
         PublishQos pq = new PublishQos(glob);
         MsgUnit msgUnit = new MsgUnit(pk, "Hi", pq);
         PublishReturnQos tmp = senderConnection.publish(msgUnit);
         assertEquals("returned oid", oid, tmp.getKeyOid());
         assertEquals("numReceived after publishing", 1, this.updateInterceptor.waitOnUpdate(2000L, oid, Constants.STATE_OK));
View Full Code Here

Examples of org.xmlBlaster.client.key.PublishKey

      String oid = "gunsNroses";

      this.updateInterceptor.clear();

      try {
         PublishKey pk = new PublishKey(glob, oid, "text/xml", "1.0");
         pk.setClientTags("<rose><color id='green'></color></rose>");
         PublishQos pq = new PublishQos(glob);
         MsgUnit msgUnit = new MsgUnit(pk, "Hi", pq);
         PublishReturnQos tmp = senderConnection.publish(msgUnit);
         assertEquals("returned oid", oid, tmp.getKeyOid());
         subscribeXPath("//rose/color[@id='green']");
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.