Package org.xmlBlaster.client

Examples of org.xmlBlaster.client.I_XmlBlasterAccess


            log.info("   -connect/qos/clientProperty[]   ");
         }
         log.info("For more info please read:");
         log.info("   http://www.xmlBlaster.org/xmlBlaster/doc/requirements/interface.get.html");

         I_XmlBlasterAccess con = glob.getXmlBlasterAccess();

         // ConnectQos checks -session.name and -passwd from command line
         log.info("============= CreatingConnectQos");
         ConnectQos qos = new ConnectQos(glob);
         if (connectQosClientPropertyMap != null) {
            Iterator it = connectQosClientPropertyMap.keySet().iterator();
            while (it.hasNext()) {
               String key = (String)it.next();
               qos.addClientProperty(key, connectQosClientPropertyMap.get(key).toString());
            }
         }
         log.info("ConnectQos is " + qos.toXml());
         ConnectReturnQos crq = con.connect(qos, null)// Login to xmlBlaster
         log.info("Connect success as " + crq.toXml());
        
         MsgUnit[] msgs = null;
         if (queryOid != null) {
            // http://www.xmlblaster.org/xmlBlaster/doc/requirements/engine.qos.queryspec.QueueQuery.html
            if (interactive) {
               log.info("Hit a key to get '" + queryOid + "' maxEntries=" + queryMaxEntries + " timeout=" + queryTimeout + " consumable=" + queryConsumable);
               try { System.in.read(); } catch(java.io.IOException e) {}
            }
            msgs = con.receive(queryOid, queryMaxEntries, queryTimeout, queryConsumable);
         }
         else {
            GetKey gk = (oid.length() > 0) ? new GetKey(glob, oid) : new GetKey(glob, xpath, Constants.XPATH);
            if (domain != null) gk.setDomain(domain);
            GetQos gq = new GetQos(glob);
            gq.setWantContent(content);
           
            HistoryQos historyQos = new HistoryQos(glob);
            historyQos.setNumEntries(historyNumUpdates);
            historyQos.setNewestFirst(historyNewestFirst);
            gq.setHistoryQos(historyQos);
  
            if (filterQuery.length() > 0) {
               AccessFilterQos filter = new AccessFilterQos(glob, filterType, filterVersion, filterQuery);
               gq.addAccessFilter(filter);
            }
            if (clientPropertyMap != null) {
               Iterator it = clientPropertyMap.keySet().iterator();
               while (it.hasNext()) {
                  String key = (String)it.next();
                  gq.addClientProperty(key, clientPropertyMap.get(key).toString());
               }
               //Example for a typed property:
               //pq.getData().addClientProperty("ALONG", (new Long(12)));
            }

            log.info("GetKey=\n" + gk.toXml());
            log.info("GetQos=\n" + gq.toXml());

            if (interactive) {
               log.info("Hit a key to get '" + ((oid.length() > 0) ? oid : xpath) + "'");
               try { System.in.read(); } catch(java.io.IOException e) {}
            }

            msgs = con.get(gk.toXml(), gq.toXml());
         }

         for(int imsg=0; imsg<msgs.length; imsg++) {
            GetReturnKey grk = new GetReturnKey(glob, msgs[imsg].getKey());
            GetReturnQos grq = new GetReturnQos(glob, msgs[imsg].getQos());

            System.out.println("");
            System.out.println("============= START #" + (imsg+1) + " '" + grk.getOid() + "' =======================");
            log.info("Receiving update #" + (imsg+1) + " of a message ...");
            System.out.println("<xmlBlaster>");
            System.out.println(msgs[imsg].toXml("", 100, true));
            System.out.println("</xmlBlaster>");
            System.out.println("============= END #" + (imsg+1) + " '" + grk.getOid() + "' =========================");
            System.out.println("");

            if (saveToFile) {
               String fileName = grk.getOid()+"-"+grq.getRcvTimestamp().getTimestamp();
               try {
                  FileLocator.writeFile(fileName, msgs[imsg].toXml("").getBytes());
               }
               catch (XmlBlasterException e) {
                  System.out.println("Can't dump content to file '" + fileName + "': " + e.toString());
               }
            }
           
         }
         if (msgs.length == 0) {
            log.info("Sorry, no message found for '" + ((oid.length() > 0) ? oid : xpath) + "'");
         }

         log.info("Hit a key to exit");
         try { System.in.read(); } catch(java.io.IOException e) {}

         if (disconnect) {
            DisconnectQos dq = new DisconnectQos(glob);
            con.disconnect(dq);
         }
      }
      catch (XmlBlasterException e) {
         log.severe(e.getMessage());
      }
View Full Code Here


   public HelloWorldVolatile2(Global glob) {
      this.glob = glob;

      try {
         I_XmlBlasterAccess con = glob.getXmlBlasterAccess();

         // Check if other name or password was given on command line:
         String name = glob.getProperty().get("session.name", "HelloWorldVolatile2");
         String passwd = glob.getProperty().get("passwd", "secret");

         ConnectQos connectQos = new ConnectQos(glob, name, passwd);
         con.connect(connectQos, this)// Login to xmlBlaster, register for updates

         // Subscribe for the volatile message
         SubscribeKey sk = new SubscribeKey(glob, "HelloWorldVolatile2");
         SubscribeQos sq = new SubscribeQos(glob);
         SubscribeReturnQos subRet = con.subscribe(sk, sq);

         // Publish a volatile message
         PublishKey pk = new PublishKey(glob, "HelloWorldVolatile2", "text/xml", "1.0");
         PublishQos pq = new PublishQos(glob);
         pq.setVolatile(true);
         // Configure the topic to our needs
         TopicProperty topicProperty = new TopicProperty(glob);
         topicProperty.setDestroyDelay(4000L);
         topicProperty.setCreateDomEntry(false);
         pq.setTopicProperty(topicProperty);
         MsgUnit msgUnit = new MsgUnit(pk, "Hi", pq);
         con.publish(msgUnit);

         // This should not be possible as the message was volatile
         try {
            GetKey gk = new GetKey(glob, "HelloWorldVolatile2");
            GetQos gq = new GetQos(glob);
            MsgUnit[] msgs = con.get(gk, gq);
            if (msgs.length > 0) {
               GetReturnQos grq = new GetReturnQos(glob, msgs[0].getQos());
               log.severe("Did not expect any message as it was volatile");
            }
         }
         catch (XmlBlasterException e) {
            log.severe("Didn't expect an exception in get(): " + e.getMessage());
         }

         DisconnectQos dq = new DisconnectQos(glob);
         con.disconnect(dq);
      }
      catch (XmlBlasterException e) {
         log.severe(e.getMessage());
      }
   }
View Full Code Here

   /**
    * Do an administrative command to the server with a temporaty login session.
    * @param command "__sys__UserList" or "__cmd:/node/heron/?clientList"
    */
   public static MsgUnit[] adminGet(Global glob, String command) throws XmlBlasterException {
      I_XmlBlasterAccess connAdmin = null;
      String user="ADMIN/1";
      String passwd="secret";
      try {
         Global gAdmin = glob.getClone(null);
         connAdmin = gAdmin.getXmlBlasterAccess();
         connAdmin.connect(new ConnectQos(gAdmin, user, passwd), null);
         GetKey gk = new GetKey(glob, command);
         GetQos gq = new GetQos(glob);
         MsgUnit[] msgs = connAdmin.get(gk, gq);
         return msgs;
      }
      finally {
         if (connAdmin != null) { try { connAdmin.disconnect(null); } catch (Throwable et) {} }
      }
   }
View Full Code Here

   /**
    * We login to xmlBlaster and check the free memory
    */
   private final void doSomething() {
      try {
         I_XmlBlasterAccess con = new XmlBlasterAccess(new String[0]);

         con.connect(null, null);    // Login to xmlBlaster

         MsgUnit[] msgs = con.get("<key oid='__cmd:?freeMem'/>", null);

         System.out.println("\n###ClientPlugin###: xmlBlaster has currently " +
                new String(msgs[0].getContent()) + " bytes of free memory\n");

         con.disconnect(null);
      }
      catch (Exception e) {
         System.err.println("ClientPlugin: We have a problem: " + e.toString());
      }
   }
View Full Code Here

         if (queryString != null)
            queryType = "XPATH";
         else
            usage("Please enter a query string");

         I_XmlBlasterAccess con = glob.getXmlBlasterAccess();
         con.connect(null, null);


         String xmlKey = "<key oid='' queryType='" + queryType + "'>\n" +
                            queryString +
                         "</key>";
         MsgUnit[] msgArr = null;
         try {
            msgArr = con.get(xmlKey, "<qos></qos>");
            log.info("Got " + msgArr.length + " messages for query '" + queryString + "':");
            for (int ii=0; ii<msgArr.length; ii++) {
               UpdateKey updateKey = new UpdateKey(glob, msgArr[ii].getKey());
               log.info("\n" + updateKey.toXml());
               log.info("\n" + new String(msgArr[ii].getContent()) + "\n");
            }
         } catch(XmlBlasterException e) {
            log.severe("XmlBlasterException: " + e.getMessage());
         }

         con.disconnect(null);
      }
      catch (XmlBlasterException e) {
          log.severe("Error occurred: " + e.toString());
          e.printStackTrace();
      }
View Full Code Here

   }

   /** Stop xmlBlaster server (invoked by junit automatically as name starts with 'test') */
   public void testStop() {
      try {
         I_XmlBlasterAccess con = this.glob.getXmlBlasterAccess();

         ConnectQos qos = new ConnectQos(glob, "joe", "secret");
         con.connect(qos, null);

         con.publish(new MsgUnit("<key oid='__cmd:?exit=0'/>", "".getBytes(), "<qos/>"));

         con.disconnect(null);

         // xmlBlaster shuts down 2 sec later + time to process shutdown
         try { Thread.sleep(4000L); } catch( InterruptedException i) {}

         try {
            Global glob2 = this.glob.getClone(null);
            I_XmlBlasterAccess con2 = glob2.getXmlBlasterAccess();
            ConnectQos connectQos = new ConnectQos(glob2, "joe", "secret");
            con2.connect(connectQos, null);
            fail("No connection expected");
         }
         catch(org.xmlBlaster.util.XmlBlasterException e) {
            System.err.println("Success, connection not possible any more");
         }
View Full Code Here

            log.info("   -connect/qos/clientProperty[]   ");
         }
         log.info("For more info please read:");
         log.info("   http://www.xmlBlaster.org/xmlBlaster/doc/requirements/interface.publish.html");

         I_XmlBlasterAccess con = glob.getXmlBlasterAccess();

         // Handle lost server explicitly
         con.registerConnectionListener(new I_ConnectionStateListener() {

               public void reachedAlive(ConnectionStateEnum oldState,
                                        I_XmlBlasterAccess connection) {
                  /*
                  ConnectReturnQos conRetQos = connection.getConnectReturnQos();
                  log.info("I_ConnectionStateListener: We were lucky, connected to " +
                     connection.getGlobal().getId() + " as " + conRetQos.getSessionName());
                     */
                  if (eraseTailback) {
                     log.info("Destroying " + connection.getQueue().getNumOfEntries() +
                                  " client side tailback messages");
                     connection.getQueue().clear();
                  }
               }
               public void reachedPolling(ConnectionStateEnum oldState,
                                          I_XmlBlasterAccess connection) {
                  log.warning("I_ConnectionStateListener: No connection to xmlBlaster server, we are polling ...");
               }
               public void reachedDead(ConnectionStateEnum oldState,
                                       I_XmlBlasterAccess connection) {
                  log.warning("I_ConnectionStateListener: Connection from " +
                          connection.getGlobal().getId() + " to xmlBlaster is DEAD.");
                  //System.exit(1);
               }
               public void reachedAliveSync(ConnectionStateEnum oldState, I_XmlBlasterAccess connection) {
               }

            });

         // This listener receives only events from asynchronously send messages from queue.
         // e.g. after a reconnect when client side queued messages are delivered
         con.registerPostSendListener(new I_PostSendListener() {
            /**
             * @see I_PostSendListener#postSend(MsgQueueEntry[])
             */
            public void postSend(MsgQueueEntry[] entries) {
               try {
                  for (int i=0; i<entries.length; i++) {
                     if (MethodName.PUBLISH.equals(entries[i].getMethodName())) {
                        MsgUnit msg = entries[i].getMsgUnit();
                        PublishReturnQos retQos = (PublishReturnQos)entries[i].getReturnObj();
                        log.info("Send asynchronously message '" + msg.getKeyOid() + "' from queue: " + retQos.toXml());
                     }
                     else
                        log.info("Send asynchronously " + entries[i].getMethodName() + " message from queue");
                  }
               } catch (Throwable e) {
                  e.printStackTrace();
               }
            }

            /**
             * @see I_PostSendListener#sendingFailed(MsgQueueEntry[], XmlBlasterException)
             */
            public boolean sendingFailed(MsgQueueEntry[] entries, XmlBlasterException ex) {
               try {
                  for (int i=0; i<entries.length; i++) {
                     if (MethodName.PUBLISH.equals(entries[i].getMethodName())) {
                        MsgUnit msg = entries[i].getMsgUnit();
                        log.info("Send asynchronously message '" + msg.getKeyOid() + "' from queue failed: " + ex.getMessage());
                     }
                     else
                        log.info("Send asynchronously " + entries[i].getMethodName() + " message from queue");
                  }
               } catch (Throwable e) {
                  e.printStackTrace();
               }
               //return true; // true: We have handled the case (safely stored the message) and it may be removed from connection queue
               return false; // false: Default error handling: message remains in queue and we go to dead
            }
         });

         // ConnectQos checks -session.name and -passwd from command line
         log.info("============= CreatingConnectQos");
         ConnectQos qos = new ConnectQos(glob);
         if (connectPersistent) {
            qos.setPersistent(connectPersistent);
         }
         // "__remoteProperties"
         qos.getData().addClientProperty(Constants.CLIENTPROPERTY_REMOTEPROPERTIES, true);
         if (connectQosClientPropertyMap != null) {
            Iterator it = connectQosClientPropertyMap.keySet().iterator();
            while (it.hasNext()) {
               String key = (String)it.next();
               qos.addClientProperty(key, connectQosClientPropertyMap.get(key).toString());
            }
         }
         log.info("ConnectQos is " + qos.toXml());
         ConnectReturnQos crq = con.connect(qos, new I_Callback() {
      public String update(String cbSessionId, UpdateKey updateKey, byte[] content, UpdateQos updateQos) throws XmlBlasterException {
        try {
          log.info("Received '" + updateKey.getOid() + "':" + new String(content, "UTF-8"));
        } catch (UnsupportedEncodingException e) {
          log.severe("Update failed: " + e.toString());
        }
        return "";
      }
         })// Login to xmlBlaster, register for updates
         log.info("Connect success as " + crq.toXml());

         org.xmlBlaster.util.StopWatch stopWatch = new org.xmlBlaster.util.StopWatch();
         for(int i=0; true; i++) {
            if (numPublish != -1)
               if (i>=numPublish)
                  break;

            String currCounter = ""+(i+1);
            if (numPublish > 0) { // Add leading zeros to have nice justified numbers in dump
               String tmp = ""+numPublish;
               int curLen = currCounter.length();
               currCounter = "";
               for (int j=curLen; j<tmp.length(); j++) {
                  currCounter += "0";
               }
               currCounter += (i+1);
            }

            String currOid = org.xmlBlaster.util.ReplaceVariable.replaceAll(oid, "%counter", currCounter);

            if (interactive) {
               char ret = (char)Global.waitOnKeyboardHit("Hit 'b' to break, hit other key to publish '" + currOid + "' #" + currCounter + "/" + numPublish);
               if (ret == 'b')
                  break;
            }
            else {
               if (sleep > 0 && i > 0) {
                  try { Thread.sleep(sleep); } catch( InterruptedException e) {}
               }
               log.info("Publish '" + currOid + "' #" + currCounter + "/" + numPublish);
            }

            PublishKey pk = new PublishKey(glob, currOid, "text/xml", "1.0");
            if (domain != null) pk.setDomain(domain);
            pk.setClientTags(org.xmlBlaster.util.ReplaceVariable.replaceAll(clientTags, "%counter", currCounter));
            PublishQos pq = new PublishQos(glob);
            pq.setPriority(priority);
            pq.setPersistent(persistent);
            pq.setLifeTime(lifeTime);
            pq.setForceUpdate(forceUpdate);
            pq.setForceDestroy(forceDestroy);
            pq.setSubscribable(subscribable);
            if (clientPropertyMap != null) {
               Iterator it = clientPropertyMap.keySet().iterator();
               while (it.hasNext()) {
                  String key = (String)it.next();
                  pq.addClientProperty(key, clientPropertyMap.get(key).toString());
               }
               //Example for a typed property:
               //pq.getData().addClientProperty("ALONG", (new Long(12)));
            }

            if (i == 0) {
               TopicProperty topicProperty = new TopicProperty(glob);
               topicProperty.setDestroyDelay(destroyDelay);
               topicProperty.setCreateDomEntry(createDomEntry);
               topicProperty.setReadonly(readonly);
               if (historyMaxMsg >= 0L) {
                  HistoryQueueProperty prop = new HistoryQueueProperty(this.glob, null);
                  prop.setMaxEntries(historyMaxMsg);
                  topicProperty.setHistoryQueueProperty(prop);
               }
               if (consumableQueue)
                  topicProperty.setMsgDistributor("ConsumableQueue,1.0");
               pq.setTopicProperty(topicProperty);
               log.info("Added TopicProperty on first publish: " + topicProperty.toXml());
            }

            if (destination != null) {
               log.fine("Using destination: '" + destination + "'");
               Destination dest = new Destination(glob, new SessionName(glob, destination));
               dest.forceQueuing(forceQueuing);
               pq.addDestination(dest);
            }

            byte[] content;
            if (contentSize >= 0) {
               content = new byte[contentSize];
               Random random = new Random();
               for (int j=0; j<content.length; j++) {
                  content[j] = (byte)(random.nextInt(96)+32);
                  //content[j] = (byte)('X');
                  //content[j] = (byte)(j % 255);
               }
            }
            else if (contentFile != null && contentFile.length() > 0) {
               content = FileLocator.readFile(contentFile);
            }
            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 };
               con.publishOneway(msgUnitArr);
               log.info("#" + (i+1) + "/" + numPublish +
                         ": Published oneway message '" + msgUnit.getKeyOid() + "'");
            }
            else {
               PublishReturnQos prq = con.publish(msgUnit);
               if (log.isLoggable(Level.FINEST)) log.finest("Returned: " + prq.toXml());

               log.info("#" + currCounter + "/" + numPublish +
                         ": Got status='" + prq.getState() +
                         (prq.getData().hasStateInfo()?"' '" + prq.getStateInfo():"") +
                         "' rcvTimestamp=" + prq.getRcvTimestamp() +
                         " for published message '" + prq.getKeyOid() + "'");
            }
         }
         log.info("Elapsed since starting to publish: " + stopWatch.nice(numPublish));

         if (erase) {
            char ret = 0;
            if (interactive) {
               ret = (char)Global.waitOnKeyboardHit("Hit 'e' to erase topic '"+oid+"', or any other key to keep the topic");
            }

            if (ret == 0 || ret == 'e') {
               EraseKey ek = new EraseKey(glob, oid);
               if (domain != null) ek.setDomain(domain);
               EraseQos eq = new EraseQos(glob);
               eq.setForceDestroy(eraseForceDestroy);
               if (log.isLoggable(Level.FINEST)) log.finest("Going to erase the topic: " + ek.toXml() + eq.toXml());
               /*EraseReturnQos[] eraseArr =*/con.erase(ek, eq);
               log.info("Erase success");
            }
         }

         char ret = 0;
         if (interactive) {
            boolean hasQueued = con.getQueue().getNumOfEntries() > 0;
            while (ret != 'l' && ret != 'd')
               ret = (char)Global.waitOnKeyboardHit("Hit 'l' to leave server, 'd' to disconnect" + (hasQueued ? "(and destroy client side entries)" : ""));
         }


         if (ret == 0 || ret == 'd') {
            DisconnectQos dq = new DisconnectQos(glob);
            dq.clearClientQueue(true);
            con.disconnect(dq);
            log.info("Disconnected from server, all resources released");
         }
         else {
            con.leaveServer(null);
            ret = 0;
            if (interactive) {
               while (ret != 'q')
                  ret = (char)Global.waitOnKeyboardHit("Hit 'q' to quit");
            }
View Full Code Here

              "Rejecting cluster message from '" + msgUnit.getQosData().getSender().getAbsoluteName()
              + "' as destination cluster '" + destination.getDestination().getAbsoluteName()
              + "' is sender cluster (circular loop)");
      }

      I_XmlBlasterAccess con = clusterNode.getXmlBlasterAccess();
      if (con == null) {
         String text = "Cluster node '" + destination.getDestination() + "' is known but not reachable, message '" + msgUnit.getLogId() + "' is lost";
         log.warning(text);
         throw new XmlBlasterException(this.glob, ErrorCode.RESOURCE_CLUSTER_NOTAVAILABLE, ME, text);
      }

      if (log.isLoggable(Level.FINE)) log.fine("PtP message '" + msgUnit.getLogId() + "' destination " + destination.getDestination() +
                   " is now forwarded to node " + clusterNode.getId());

      // To be on the save side we clone the message
      return con.publish(msgUnit.getClone());
   }
View Full Code Here

      if (log.isLoggable(Level.FINER)) log.finer("Entering forwardPublish(" + msgUnit.getLogId() + ")");
      NodeMasterInfo nodeMasterInfo = getConnection(publisherSession, msgUnit);
      if (nodeMasterInfo == null)
         return null;
      ClusterNode clusterNode = nodeMasterInfo.getClusterNode();
      I_XmlBlasterAccess con =  clusterNode.getXmlBlasterAccess();
      if (con == null)
         return null;
     
      if (!this.allowDirectLoopback && clusterNode.getId().equals(msgUnit.getQosData().getSender().getNodeIdStr())) {
        // avoid direct loop back: send dead message or throw exception?
        // (sending back leads to dead lock from publisher->slave->master->loopback->slave in socket tunneling mode)
        log.severe("Rejecting cluster message from '" + msgUnit.getQosData().getSender().getAbsoluteName()
              + "' as destination cluster '" + clusterNode.getId()
              + "' is sender cluster (circular loop), please check your configuration: topicId=" + msgUnit.getKeyOid() + " " + msgUnit.getQosData().toXmlReadable());
          throw new XmlBlasterException(this.glob, ErrorCode.RESOURCE_CLUSTER_CIRCULARLOOP, ME,
              "Rejecting cluster message from '" + msgUnit.getQosData().getSender().getAbsoluteName()
              + "' as destination cluster '" + clusterNode.getId()
              + "' is sender cluster (circular loop)");
      }

      QosData publishQos = msgUnit.getQosData();
      if (nodeMasterInfo.isDirtyRead() == true) {
         // mark QoS of published message that we dirty read the message:
         RouteInfo[] ris = publishQos.getRouteNodes();
         if (ris == null || ris.length < 1) {
            log.severe("The route info for '" + msgUnit.getLogId() + "' is missing");
            Thread.dumpStack();
         }
         else {
            ris[ris.length-1].setDirtyRead(true);
         }
      }
      // Set the new qos ...
      MsgUnit msgUnitShallowClone = new MsgUnit(msgUnit, null, null, publishQos);

      return new PublishRetQosWrapper(nodeMasterInfo, con.publish(msgUnitShallowClone));
   }
View Full Code Here

      MsgUnit msgUnit = new MsgUnit(xmlKey, (byte[])null, subscribeQos.getData());
      NodeMasterInfo nodeMasterInfo = getConnection(publisherSession, msgUnit);
      if (nodeMasterInfo == null)
         return null;
      I_XmlBlasterAccess con =  nodeMasterInfo.getClusterNode().getXmlBlasterAccess();
      if (con == null) {
         if (log.isLoggable(Level.FINE)) log.fine("forwardSubscribe - Nothing to forward");
         return null;
      }

      SubscribeQos subscribeQos2 = new SubscribeQos(this.glob, subscribeQos.getData());
      // The cluster master needs to accept our "__subId:heron-3456646466"
     
      ClientProperty clientProperty = subscribeQos2.getClientProperty(Constants.PERSISTENCE_ID);
      if (clientProperty != null) {
         // remove marker that this is from persistent store, the other node would react wrong
         subscribeQos2 = new SubscribeQos(this.glob, (QueryQosData)subscribeQos.getData().clone());
         subscribeQos2.getData().getClientProperties().remove(Constants.PERSISTENCE_ID);
      }
     
      // As we forward many subscribes probably accessing the
      // same message but only want one update.
      // We cache this update and distribute to all our clients
      // TODO: As an unSubscribe() deletes all subscribes() at once
      //       we have not yet activated the new desired use of multiSubscribe
      //       We need to add some sort of subscribe reference counting
      //       preferably in the server implementation (see RequestBroker.java)
      // TODO: As soon we have implemented it here we need to remove
      //       data.setDuplicateUpdates(false); in NodeInfo.java

      //subscribeQos2.setMultiSubscribe(false);

      return con.subscribe(new SubscribeKey(this.glob, xmlKey), subscribeQos2);
   }
View Full Code Here

TOP

Related Classes of org.xmlBlaster.client.I_XmlBlasterAccess

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.