Package org.xmlBlaster.client.key

Examples of org.xmlBlaster.client.key.SubscribeKey


    * Subscribe to message.
    */
   private void doSubscribe(I_XmlBlasterAccess con) {
      if (log.isLoggable(Level.FINE)) log.fine("Subscribing using EXACT oid syntax ...");
      try {
         SubscribeKey subscribeKey = new SubscribeKey(con.getGlobal(), this.oid);
         SubscribeQos subscribeQos = new SubscribeQos(con.getGlobal());
         String subscribeOid = con.subscribe(subscribeKey, subscribeQos).getSubscriptionId();
         log.info("Success: Subscribe on " + subscribeOid + " done");
         assertTrue("returned null subscribeOid", subscribeOid != null);
      } catch(XmlBlasterException e) {
View Full Code Here


            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

                     return "";
                  }
               });

            System.err.println("->Subscribe from bilbo ...");
            SubscribeKey sk = new SubscribeKey(glob, oid);
            sk.setDomain(domain);
            SubscribeQos sq = new SubscribeQos(glob);
            SubscribeReturnQos srq = bilboCon.subscribe(sk.toXml(), sq.toXml());
         }

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

         MsgUnit[] msgs = con.get(gk, gq);

         log.info("Accessed xmlBlaster message synchronous with get() with content '" + new String(msgs[0].getContent()) + "'");


         SubscribeKey sk = new SubscribeKey(glob, "HelloWorldMime");
         SubscribeQos sq = new SubscribeQos(glob);
         sq.addAccessFilter(new AccessFilterQos(glob, "XPathFilter", "1.0", "/news[@type='fishing']"));
         SubscribeReturnQos subRet = con.subscribe(sk, sq);

View Full Code Here

   }
  
   private final SubscribeReturnQos subscribe(Destination destination, String msgSelector, boolean noLocal) throws JMSException {
      this.destination = destination;
      String oid = getOid(destination);
      SubscribeKey key = new SubscribeKey(this.global, oid);
      SubscribeQos qos = new SubscribeQos(this.global);
      qos.setWantInitialUpdate(false);
      qos.setWantLocal(!noLocal);
      // TODO add a mime plugin to handle jms conventions for the messageSelector
      // the code here exists already, but the plugin is not written yet ...
View Full Code Here


   private String subscribe(String xmlKey, String queryType)
   {
      try {
         SubscribeKey xmlKeyWr = new SubscribeKey(glob, xmlKey, queryType);
         SubscribeQos xmlQos = new SubscribeQos(glob);
         SubscribeReturnQos ret = xmlBlasterConnection.subscribe(xmlKeyWr.toXml(), xmlQos.toXml());
         String subscriptionId = ret.getSubscriptionId();
         log.info("Subscribed to [" + xmlKey + "] " + queryType + ", subscriptionId=" + subscriptionId);
         return subscriptionId;
      } catch(XmlBlasterException e) {
         log.severe("XmlBlasterException:\n" + e.getMessage());
View Full Code Here

    */
   private void unSubscribe(String subscriptionId)
   {
      if (subscriptionId == null || subscriptionId.length() < 1) return;
      try {
         SubscribeKey xmlKey = new SubscribeKey(glob, subscriptionId);
         SubscribeQos xmlQos = new SubscribeQos(glob);
         xmlBlasterConnection.unSubscribe(xmlKey.toXml(), xmlQos.toXml());
         if (log.isLoggable(Level.FINE)) log.fine("Unsubscribed from " + subscriptionId + " (GML and XML Packages)");
      } catch(XmlBlasterException e) {
         log.warning("unSubscribe(" + subscriptionId + ") failed: XmlBlasterException: " + e.getMessage());
      }
   }
View Full Code Here

               }
               return Constants.RET_OK;
            }
         })// Login to xmlBlaster, default handler for updates

         SubscribeKey sk = new SubscribeKey(this.global, Constants.OID_DEAD_LETTER);
         SubscribeQos sq = new SubscribeQos(this.global);
         sq.setWantInitialUpdate(false);
         this.connection.subscribe(sk, sq);

         log.info("Subscribed to topic '" + Constants.OID_DEAD_LETTER + "'");
View Full Code Here

         if (this.xmlBlasterAccess != null)
            jmxInterfaceAlive = true;
         log.info("Registered new xmlBlasterConnector, running on "
               + glob.getBootstrapAddress().getBootstrapUrl());
         log.info("registering new topic \"xmlBlasterMBeans\"");
         SubscribeKey subKey = new SubscribeKey(this.glob,
               "xmlBlasterMBeans_Invoke");

         SubscribeQos sQos = new SubscribeQos(this.glob);
         sQos.setWantLocal(false);
         ConnectQos qos = new ConnectQos(glob, "InternalConnector", "connector");
View Full Code Here

      if (url == null) {
         return "Please pass a valid topic oid";
      }

      log.info(ME+": Administrative subscribe() of '" + url + "' for client '" + getId() + "' qos='" + qos + "'");
      SubscribeKey uk = new SubscribeKey(glob, url);
      SubscribeQos uq;
      if (qos == null || qos.length() == 0 || qos.equalsIgnoreCase("String")) {
         uq = new SubscribeQos(glob);
      }
      else {
         uq = new SubscribeQos(glob, glob.getQueryQosFactory().readObject(qos));
      }
      SubscribeQosServer uqs = new SubscribeQosServer(glob, uq.getData());

      String ret = glob.getRequestBroker().subscribe(this, uk.getData(), uqs);

      SubscribeReturnQos tmp = new SubscribeReturnQos(glob, ret);
      ret = "Subscribe '" + tmp.getSubscriptionId() + "' state is " + tmp.getState();
      if (tmp.getStateInfo() != null)
         ret += " " + tmp.getStateInfo();
View Full Code Here

TOP

Related Classes of org.xmlBlaster.client.key.SubscribeKey

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.