Examples of UnSubscribeKey


Examples of org.xmlBlaster.client.key.UnSubscribeKey

      }
   }
   private void doUnSubscribe(String oid) {
      try {
         UnSubscribeKey key = new UnSubscribeKey(this.glob, oid);

         UnSubscribeQos qos = new UnSubscribeQos(this.glob);
         this.glob.getXmlBlasterAccess().unSubscribe(key, qos);
      }
      catch(XmlBlasterException e) {
View Full Code Here

Examples of org.xmlBlaster.client.key.UnSubscribeKey

      String text = jTextField1.getText();
      this.setTitle(ME + "  " + xmlBlaster.getSessionName().getNodeIdStr() + "  " + text);

      if (this.subscribeReturnQos != null) {
         try {
            UnSubscribeKey key = new UnSubscribeKey(xmlBlaster.getGlobal(), this.subscribeReturnQos.getSubscriptionId());
            UnSubscribeQos qos = new UnSubscribeQos(xmlBlaster.getGlobal() );
            xmlBlaster.unSubscribe(key.toXml(), qos.toXml());
            System.out.println(ME + " unSubscribe from " + this.subscribeReturnQos.getSubscriptionId());
            this.subscribeReturnQos = null;
         }
         catch( Throwable ex ) {
            System.err.println("error-error-error-error >>>"+ex.toString());
            System.out.println(ME + " " + ex.getMessage());
            ex.printStackTrace();
         }
      }

      try {
         SubscribeKey key = new SubscribeKey(xmlBlaster.getGlobal(), text, "XPATH");
         SubscribeQos qos = new SubscribeQos(xmlBlaster.getGlobal() );
         this.subscribeReturnQos = xmlBlaster.subscribe(key.toXml(), qos.toXml());
         System.out.println(ME + " subscribe on " + text + "  ->  " + this.subscribeReturnQos.getSubscriptionId());
      }
      catch( Exception ex ) {
         System.err.println("error-error-error-error >>>"+ex.toString());
         System.out.println(ME + " " + ex.getMessage());
View Full Code Here

Examples of org.xmlBlaster.client.key.UnSubscribeKey

         try { Thread.currentThread().sleep(1000); }
         catch( InterruptedException i) {} // wait a second to receive update()


         UnSubscribeKey uk = new UnSubscribeKey(glob, subRet.getSubscriptionId());
         UnSubscribeQos uq = new UnSubscribeQos(glob);
         con.unSubscribe(uk, uq);

         EraseKey ek = new EraseKey(glob, "HelloWorldMime");
         EraseQos eq = new EraseQos(glob);
View Full Code Here

Examples of org.xmlBlaster.client.key.UnSubscribeKey

      if (!this.open) return;
      try {
         if (log.isLoggable(Level.FINER))
            log.finer("close");
         String subId = this.subscribeReturnQos.getSubscriptionId();
         UnSubscribeKey key = new UnSubscribeKey(this.global, subId);
         UnSubscribeQos qos = new UnSubscribeQos(this.global);
         this.global.getXmlBlasterAccess().unSubscribe(key, qos);
         this.session.consumerMap.remove(subId);
         this.msgListener = null;
      }
View Full Code Here

Examples of org.xmlBlaster.client.key.UnSubscribeKey

   public final String[] unSubscribe(String url, String qos) throws XmlBlasterException {
      if (url == null)
         return new String[] { "Please pass a valid topic oid" };

      log.info(ME+": Administrative unSubscribe() of '" + url + "' for client '" + getId() + "'");
      UnSubscribeKey uk = new UnSubscribeKey(glob, url);

      UnSubscribeQos uq;
      if (qos == null || qos.length() == 0 || qos.equalsIgnoreCase("String"))
         uq = new UnSubscribeQos(glob);
      else
         uq = new UnSubscribeQos(glob, glob.getQueryQosFactory().readObject(qos));
      UnSubscribeQosServer uqs = new UnSubscribeQosServer(glob, uq.getData());

      String[] ret = glob.getRequestBroker().unSubscribe(this, uk.getData(), uqs);

      if (ret.length == 0)
         return new String[] { "Unsubscribe of '" + url + "' for client '" + getId() + "' did NOT match any subscription" };

      for (int i=0; i<ret.length; i++) {
View Full Code Here

Examples of org.xmlBlaster.client.key.UnSubscribeKey

         if (!disconnectQos.isLeaveServer()) {
            String[] subscriptionIdArr = this.updateDispatcher.getSubscriptionIds();
            for (int ii=0; ii<subscriptionIdArr.length; ii++) {
               String subscriptionId = subscriptionIdArr[ii];
               UnSubscribeKey key = new UnSubscribeKey(glob, subscriptionId);
               try {
                  unSubscribe(key, null);
               }
               catch(XmlBlasterException e) {
                  if (e.isCommunication()) {
View Full Code Here

Examples of org.xmlBlaster.client.key.UnSubscribeKey

   /**
    * @see I_XmlBlasterAccess#unSubscribe(UnSubscribeKey, UnSubscribeQos)
    */
   public UnSubscribeReturnQos[] unSubscribe(java.lang.String xmlKey, java.lang.String qos) throws XmlBlasterException {
      return unSubscribe(new UnSubscribeKey(glob, glob.getQueryKeyFactory().readObject(xmlKey)),
                       new UnSubscribeQos(glob, glob.getQueryQosFactory().readObject(qos)) );
   }
View Full Code Here

Examples of org.xmlBlaster.client.key.UnSubscribeKey

   /** JMX **/
   public String[] invokeUnSubscribe(String url, String qos) throws Exception {
      qos = checkQueryKeyQos(url, qos);
      try {
         UnSubscribeKey usk = new UnSubscribeKey(glob, url);
         UnSubscribeReturnQos[] usrq = unSubscribe(usk, new UnSubscribeQos(glob, glob.getQueryQosFactory().readObject(qos)));
         if (usrq == null) return new String[0];
         String[] ret = new String[usrq.length];
         if (ret.length < 1) {
            return new String[] { "unSubscribe '"+url+"' did not match any subscription" };
View Full Code Here

Examples of org.xmlBlaster.client.key.UnSubscribeKey

               log.info("Successfully got message from xmlBlaster, msg=" + msgs[0].toXml());
            }

            log.info("Hit a key to unSubscribe on topic '" + oid + "' and '" + subRet.getSubscriptionId() + "'");
            try { System.in.read(); } catch(java.io.IOException e) {}
            UnSubscribeKey uk = new UnSubscribeKey(glob, subRet.getSubscriptionId());
            UnSubscribeQos uq = new UnSubscribeQos(glob);
            UnSubscribeReturnQos[] unSubRet = xmlBlasterAccess.unSubscribe(uk, uq);
            log.info("UnSubscribed for " + uk.toXml() + "\n" + uq.toXml() + " return:\n" + unSubRet[0].toXml());

            log.info("Hit a key to erase on topic " + oid);
            try { System.in.read(); } catch(java.io.IOException e) {}
            EraseKey ek = new EraseKey(glob, oid);
            EraseQos eq = new EraseQos(glob);
View Full Code Here

Examples of org.xmlBlaster.client.key.UnSubscribeKey

            }
            String qos = (String)obj[0];
            String key = (String)obj[1];
            return new MsgQueueUnSubscribeEntry(glob, PriorityEnum.toPriorityEnum(priority), storageId,
                       new Timestamp(timestamp), sizeInBytes,
                       new UnSubscribeKey(glob, glob.getQueryKeyFactory().readObject(key)),
                       new UnSubscribeQos(glob, glob.getQueryQosFactory().readObject(qos)) );

         }
         else if (methodName == MethodName.ERASE) {
            if (obj.length != 2) {
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.