Package org.xmlBlaster.client.qos

Examples of org.xmlBlaster.client.qos.ConnectQos


    */
   protected void setUp() {
      this.subscribeId = null;
      try {
         connection = glob.getXmlBlasterAccess(); // Find orb
         ConnectQos qos = new ConnectQos(glob);
         this.updateInterceptor = new MsgInterceptor(glob,log, null);
         connection.connect(qos, this.updateInterceptor);
      }
      catch (Exception e) {
          log.severe("Login failed: " + e.toString());
View Full Code Here


      final Global glob2 = glob.getClone(null);
      String name1 = "NUMBER_ONE";
      try {
         log.info("Connecting ...");
         con1 = glob1.getXmlBlasterAccess();
         ConnectQos qos = new ConnectQos(glob1, name1, "secret");
         assertInUpdate = null;
         con1.connect(qos, new I_Callback() {  // Login to xmlBlaster, register for updates
               public String update(String cbSessionId, UpdateKey updateKey, byte[] content, UpdateQos updateQos) {
                  log.info("****** Con1 update arrived" + updateKey.toXml() + updateQos.toXml());
                  assertInUpdate = glob1.getId() + ": Did not expect message update in first handler";
                  fail(assertInUpdate); // This is routed to server, not to junit
                  return "";
               }
            });

         SubscribeKey sk = new SubscribeKey(glob1, oid);
         SubscribeQos sq = new SubscribeQos(glob1);
         con1.subscribe(sk.toXml(), sq.toXml());

         try { Thread.sleep(1000); } catch( InterruptedException i) {} // Wait some time
         assertTrue(assertInUpdate, assertInUpdate == null);

         Client.shutdownCb(con1, Client.Shutdown.LEAVE_SERVER);
         log.info("############ Con1 is down");

         assertInUpdate = null;
         con2 = glob2.getXmlBlasterAccess();
         qos = new ConnectQos(glob2)// force a new session
         con2.connect(qos, new I_Callback() {  // Login to xmlBlaster, register for updates
               public String update(String cbSessionId, UpdateKey updateKey, byte[] content, UpdateQos updateQos) {
                  log.info("****** Con2 update arrived" + updateKey.toXml() + updateQos.toXml());
                  assertInUpdate = glob2.getId() + "Reveiving asynchronous message '" + updateKey.getOid() + "' in second handler";
                  log.info(assertInUpdate);
View Full Code Here

         passwd
         };
     
      try {
         Global g = glob.getClone(args);
         ConnectQos qos = new ConnectQos(g);
         qos.setUserId(g.getId());
         assertEquals("Wrong user id", loginName, qos.getSecurityQos().getUserId());
         assertTrue("Wrong password, expected '" + passwd + "': " + qos.toXml(), qos.toXml().indexOf(passwd) > 0);
         //System.out.println("ConnectQos=" + qos.toXml(""));
      }
      catch (XmlBlasterException e) {
         fail("testCredential failed: " + e.toString());
      }
View Full Code Here

               public void lostConnection() {
                  log.warning("I_ConnectionStateListener: Lost connection to " + glob.getId());
               }
            });
         */
         ConnectQos qos = new ConnectQos(glob, ME, "secret");
         con.connect(qos, this); // Login to xmlBlaster
         log.info("Successful login");
      }
      catch (XmlBlasterException e) {
         log.severe(e.toString());
View Full Code Here

   protected void setUp()
   {
      try {
         senderConnection = glob.getXmlBlasterAccess(); // Find orb
         String passwd = "secret";
         ConnectQos qos = new ConnectQos(glob, senderName, passwd); // == "<qos></qos>";
         senderConnection.connect(qos, this); // Login to xmlBlaster
      }
      catch (Exception e) {
          log.severe("Login failed: " + e.toString());
          e.printStackTrace();
View Full Code Here

    */
   private Client doConnect(String loginName, I_Callback cb) {
      try {
         Client client = new Client();
         Global gg = this.glob.getClone(null);
         ConnectQos connectQos = new ConnectQos(gg, loginName, "secret");
         CallbackAddress cbAddress = new CallbackAddress(glob);
         cbAddress.setRetries(-1);       // -1 == forever to avoid server side clearing of queue
         connectQos.addCallbackAddress(cbAddress);
         client.con = gg.getXmlBlasterAccess();
         client.con.registerConnectionListener(this);
         client.updateInterceptor = new MsgInterceptor(gg, log, cb); // Collect received msgs
         client.con.connect(connectQos, client.updateInterceptor); // Login to xmlBlaster
         return client;
View Full Code Here

   protected void setUp()
   {
      try {
         senderConnection = glob.getXmlBlasterAccess(); // Find orb
         String passwd = "secret";
         ConnectQos connectQos = new ConnectQos(glob, senderName, passwd);
         senderConnection.connect(connectQos, this); // Login to xmlBlaster
      }
      catch (Exception e) {
          log.severe(e.toString());
          e.printStackTrace();
View Full Code Here

    */
   private Client doConnect(String loginName, I_Callback cb) {
      try {
         Client client = new Client();
         Global gg = this.glob.getClone(null);
         ConnectQos connectQos = new ConnectQos(gg, loginName, "secret");
         CallbackAddress cbAddress = new CallbackAddress(glob);
         cbAddress.setRetries(-1);       // -1 == forever to avoid server side clearing of queue
         connectQos.addCallbackAddress(cbAddress);
         client.con = gg.getXmlBlasterAccess();
         client.con.registerConnectionListener(this);
         client.updateInterceptor = new MsgInterceptor(gg, log, cb); // Collect received msgs
         client.con.connect(connectQos, client.updateInterceptor); // Login to xmlBlaster
         return client;
View Full Code Here

      log.info("XmlBlaster is ready for testing subscribe MIME filter");

      try {
         log.info("Connecting ...");
         con = glob.getXmlBlasterAccess();
         ConnectQos qos = new ConnectQos(glob, name, passwd);
         con.connect(qos, null); // Login to xmlBlaster
      }
      catch (Exception e) {
         Thread.currentThread().dumpStack();
         log.severe("Can't connect to xmlBlaster: " + e.toString());
View Full Code Here

   }

   private void connect() {
      try {
         connection = glob.getXmlBlasterAccess(); // Find orb
         ConnectQos qos = new ConnectQos(glob);
         connection.connect(qos, this);
      }
      catch (Exception e) {
          log.severe("Login failed: " + e.toString());
          e.printStackTrace();
View Full Code Here

TOP

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

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.