Package org.xmlBlaster.client.qos

Examples of org.xmlBlaster.client.qos.UnSubscribeQos


   /** private helper to unSubscribe */
   private String[] unSubscribe(SessionInfo sessionInfo, String qos) throws XmlBlasterException {
      String sessionName = sessionInfo.getSessionName().getAbsoluteName();
      UnSubscribeKey uk = new UnSubscribeKey(serverScope, uniqueKey);
      UnSubscribeQos uq;
      if (qos == null || qos.length() == 0 || qos.equalsIgnoreCase("String"))
         uq = new UnSubscribeQos(serverScope);
      else
         uq = new UnSubscribeQos(serverScope, serverScope.getQueryQosFactory().readObject(qos));
      UnSubscribeQosServer uqs = new UnSubscribeQosServer(serverScope, uq.getData());
      String[] ret = serverScope.getRequestBroker().unSubscribe(sessionInfo, uk.getData(), uqs);

      if (ret.length == 0)
         return new String[] { "Unsubscribe of client '" + sessionName + "' failed, the reason is not known" };

View Full Code Here


    */
   protected void tearDown() {
      log.info("Entering tearDown(), test is finished");
      cleanUpDirs();
      try {
         this.connGlobal.getXmlBlasterAccess().unSubscribe(new UnSubscribeKey(this.connGlobal, this.oid), new UnSubscribeQos(this.connGlobal));
         this.connGlobal.getXmlBlasterAccess().disconnect(new DisconnectQos(this.connGlobal));
         this.connGlobal.shutdown();
         this.connGlobal = null;
      }
      catch (XmlBlasterException ex) {
View Full Code Here

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


            UnSubscribeKey uk = new UnSubscribeKey(con.getGlobal(), subRet.getSubscriptionId());
            UnSubscribeQos uq = new UnSubscribeQos(con.getGlobal());
            UnSubscribeReturnQos[] urq = con.unSubscribe(uk.toXml(), uq.toXml());

            EraseKey ek = new EraseKey(con.getGlobal(), "AllProtocols");
            EraseQos eq = new EraseQos(con.getGlobal());
            EraseReturnQos[] eraseArr = con.erase(ek.toXml(), eq.toXml());
View Full Code Here

    */
   protected void tearDown() {
      log.info("Entering tearDown(), test is finished");
      try {
         Thread.sleep(1000L); // since the cb could be too fast
         this.connGlobal.getXmlBlasterAccess().unSubscribe(new UnSubscribeKey(this.connGlobal, this.oid), new UnSubscribeQos(this.connGlobal));
         this.connGlobal.getXmlBlasterAccess().disconnect(new DisconnectQos(this.connGlobal));
         this.connGlobal.shutdown();
         this.connGlobal = null;
         // this.publisherGlobal.getXmlBlasterAccess().disconnect(new DisconnectQos(this.publisherGlobal));
         // this.publisherGlobal.shutdown();
View Full Code Here


   public void testUnSubscribeQos()
   {
      if (log.isLoggable(Level.FINE)) log.fine("TestUnSubscribeQos");
      UnSubscribeQos qos = new UnSubscribeQos(this.glob);
      qos.addClientProperty("oneKey", "oneValue");
      qos.addClientProperty("twoKey", "twoValue");
      qos.addClientProperty("threeKey", new Integer(55));
      String literal = qos.toXml();
     
      ConnectQosSaxFactory factory = new ConnectQosSaxFactory(this.glob);
      try {
         ConnectQosData data = factory.readObject(literal);
         checkValues(data.getClientProperties());
View Full Code Here

         updateCounterFrodo = 0;
         updateCounterBilbo = 0;

         System.err.println("->Check unSubscribe from client frodo ...");
         UnSubscribeKey uk = new UnSubscribeKey(glob, srq.getSubscriptionId());
         UnSubscribeQos uq = new UnSubscribeQos(glob);
         frodoCon.unSubscribe(uk.toXml(), uq.toXml());

         System.err.println("->Check publish, frodo should not get it ...");
         pk = new PublishKey(glob, oid, "text/plain", "1.0", domain);
         pq = new PublishQos(glob);
         msgUnit = new MsgUnit(pk, contentStr, pq);
View Full Code Here

         // ... and now test unSubscribe
         {
            System.err.println("->UnSubscribe from bilbo ...");
            UnSubscribeKey usk = new UnSubscribeKey(glob, oid);
            usk.setDomain(domain);
            UnSubscribeQos usq = new UnSubscribeQos(glob);
            UnSubscribeReturnQos[] usrq = bilboCon.unSubscribe(usk, usq);
            assertEquals("", 1, usrq.length);

            System.err.println("->Publish to avalon ...");
            PublishKey avalon_pk = new PublishKey(glob, oid, "text/plain", "1.0", domain);
View Full Code Here

    */
   protected void tearDown() {
      log.info("Entering tearDown(), test is finished");
      cleanUpDirs();
      try {
         this.connGlobal.getXmlBlasterAccess().unSubscribe(new UnSubscribeKey(this.connGlobal, this.oid), new UnSubscribeQos(this.connGlobal));
         this.connGlobal.getXmlBlasterAccess().disconnect(new DisconnectQos(this.connGlobal));
         this.connGlobal.shutdown();
         this.connGlobal = null;
      }
      catch (XmlBlasterException ex) {
View Full Code Here

            if (ret == 0 || ret == 'u') {
               UnSubscribeKey uk = new UnSubscribeKey(glob, srq.getSubscriptionId());
               if (domain.length() > 0// cluster routing information
                  uk.setDomain(domain);
               UnSubscribeQos uq = new UnSubscribeQos(glob);
               log.info("UnSubscribeKey=\n" + uk.toXml());
               log.info("UnSubscribeQos=\n" + uq.toXml());
               UnSubscribeReturnQos[] urqArr = con.unSubscribe(uk, uq);
               log.info("UnSubscribe on " + urqArr.length + " subscriptions done");
            }
         }
View Full Code Here

      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

TOP

Related Classes of org.xmlBlaster.client.qos.UnSubscribeQos

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.