Package org.xmlBlaster.util.qos.address

Examples of org.xmlBlaster.util.qos.address.Address


      this.cbSessionId = passwd;
      this.connectQos = new ConnectQos(this.glob, loginName, passwd);
      this.connectQos.setSessionTimeout(0L);
      this.connectQos.setMaxSessions(this.glob.getProperty().get("PriorizedDispatchPlugin.session.maxSessions", 10));

      Address address = new Address(this.glob);
      address.setDispatchPlugin("undef")// To avoid recursive loading of this PRIO plugin
      address.setDelay(2000L);      // retry connecting every 2 sec
      address.setRetries(-1);       // -1 == forever
      address.setPingInterval(0L)// switched off
      this.connectQos.setAddress(address);

      CallbackAddress cbAddress = new CallbackAddress(this.glob);
      cbAddress.setDispatchPlugin("undef")// To avoid recursive loading of this PRIO plugin
      cbAddress.setSecretSessionId(this.cbSessionId); // to protect our callback server - see method update()
View Full Code Here


  
   private String getConnectQos(Global glob) {
      try {
         ConnectQos connQos = new ConnectQos(glob, "filePollerTestUser", "secret");
         connQos.setMaxSessions(100);
         Address address = connQos.getAddress();
         address.setPingInterval(0L);
         address.setCollectTime(0L);
         connQos.getClientQueueProperty().setType("RAM");
         connQos.getClientQueueProperty().setVersion("1.0");
         return connQos.toXml();
      }
      catch (XmlBlasterException ex) {
View Full Code Here

         ConnectQos connectQos = new ConnectQos(tmpGlobal, senderName, passwd); // == "<qos>...</qos>";
         connectQos.setSessionName(new SessionName(tmpGlobal, "general/1"));
         // set the persistent connection
         connectQos.setPersistent(this.persistent);
         // Setup fail save handling for connection ...
         Address addressProp = new Address(tmpGlobal);
         addressProp.setDelay(reconnectDelay); // retry connecting every 2 sec
         addressProp.setRetries(-1);       // -1 == forever
         addressProp.setPingInterval(-1L); // switched off
         con.registerConnectionListener(this);
         connectQos.setAddress(addressProp);
        
         // setup failsafe handling for callback ...
         if (this.failsafeCallback) {
            CallbackAddress cbAddress = new CallbackAddress(tmpGlobal);
            cbAddress.setRetries(-1);
            cbAddress.setPingInterval(-1);
            cbAddress.setDelay(1000L);
            cbAddress.setSecretCbSessionId("someSecredSessionId");
            connectQos.addCallbackAddress(cbAddress);
         }
         con.connect(connectQos, this);
         DisconnectQos disconnectQos = new DisconnectQos(tmpGlobal);
         con.disconnect(disconnectQos);
      }
      catch (XmlBlasterException e) {
          log.warning("setUp() - login failed: " + e.getMessage());
          fail("setUp() - login fail: " + e.getMessage());
      }
      catch (Exception e) {
          log.severe("setUp() - login failed: " + e.toString());
          e.printStackTrace();
          fail("setUp() - login fail: " + e.toString());
      }

      System.out.println("============== Connect for general/1");

      try {
         I_XmlBlasterAccess con = this.glob.getXmlBlasterAccess(); // Find orb

         String passwd = "secret";
         ConnectQos connectQos = new ConnectQos(this.glob, senderName, passwd); // == "<qos>...</qos>";
         connectQos.setSessionName(new SessionName(this.glob, "general/1"));
         // set the persistent connection
         connectQos.setPersistent(this.persistent);
         // Setup fail save handling for connection ...
         Address addressProp = new Address(glob);
         addressProp.setDelay(reconnectDelay); // retry connecting every 2 sec
         addressProp.setRetries(-1);       // -1 == forever
         addressProp.setPingInterval(-1L); // switched off
         con.registerConnectionListener(this);
         connectQos.setAddress(addressProp);
        
         // setup failsafe handling for callback ...
         if (this.failsafeCallback) {
View Full Code Here

         ConnectQos connectQos = new ConnectQos(glob); // == "<qos>...</qos>";
         connectQos.setSessionName(new SessionName(ret, sessionName));
         // set the persistent connection
         connectQos.setPersistent(isPersistent);
         // Setup fail save handling for connection ...
         Address addressProp = new Address(glob);
         addressProp.setDelay(reconnectDelay); // retry connecting every 2 sec
         addressProp.setRetries(-1);       // -1 == forever
         addressProp.setPingInterval(-1L); // switched off
         connectQos.setAddress(addressProp);
     
         // setup failsafe handling for callback ...
         if (this.failsafeCallback) {
            CallbackAddress cbAddress = new CallbackAddress(this.glob);
View Full Code Here

         String passwd = "secret";
         ConnectQos connectQos = new ConnectQos(glob, senderName, passwd); // == "<qos>...</qos>";

         // Setup fail save handling ...
         Address addressProp = new Address(glob);
         addressProp.setDelay(reconnectDelay); // retry connecting every 2 sec
         addressProp.setRetries(-1);       // -1 == forever
         addressProp.setPingInterval(-1L); // switched off
         con.registerConnectionListener(this);

         connectQos.setAddress(addressProp);

         this.updateInterceptor = new MsgInterceptor(this.glob, log, null); // Collect received msgs
View Full Code Here

  
   private String getConnectQos(Global glob) {
      try {
         ConnectQos connQos = new ConnectQos(glob, "filePollerTestUser", "secret");
         connQos.setMaxSessions(100);
         Address address = connQos.getAddress();
         address.setPingInterval(0L);
         address.setCollectTime(0L);
         connQos.getClientQueueProperty().setType("RAM");
         connQos.getClientQueueProperty().setVersion("1.0");
         return connQos.toXml();
      }
      catch (XmlBlasterException ex) {
View Full Code Here

               hostname,
               "-plugin/"+type+"/port",
               ""+port
            };
            glob.init(args);
            Address address = new Address(glob, type);
            SocketUrl s = new SocketUrl(glob, address);
            assertEquals("", hostname, s.getHostname());
            assertEquals("", port, s.getPort());
            assertEquals("", "socket://"+hostname+":"+port, s.getUrl());
            log.info("SUCCESS testAddress(): resultUrl=" + s.getUrl());
         }

         {
            String hostname = "168.99.55.2";
            int port = 6666;
            Address address = new Address(glob);
            address.setPluginProperty("hostname", hostname);
            address.setPluginProperty("port", ""+port);
            SocketUrl s = new SocketUrl(glob, address);
            assertEquals("", hostname, s.getHostname());
            assertEquals("", port, s.getPort());
            assertEquals("", "socket://"+hostname+":"+port, s.getUrl());
            log.info("SUCCESS testAddress(): resultUrl=" + s.getUrl());
View Full Code Here

         String passwd = "secret";
         ConnectQos connectQos = new ConnectQos(glob, senderName, passwd);

         // Setup fail save handling ...
         Address addressProp = new Address(glob);
         addressProp.setDelay(400L);          // retry connecting every 400 milli sec
         addressProp.setRetries(-1);          // -1 == forever
         addressProp.setPingInterval(400L);   // ping every 400 milli second
         con.registerConnectionListener(this);

         connectQos.setAddress(addressProp);
        
         this.updateInterceptor = new MsgInterceptor(this.glob, log, this); // Collect received msgs
View Full Code Here

         String xml2 = qos.toXml();
         qos = factory.readObject(xml2);
         log.info(xml2);

         assertTrue(qos.isPersistent());
         Address address = qos.getAddress();
         assertEquals(true, address.getEnv("useRemoteLoginAsTunnel", false)
               .getValue());
         // assertEquals(3412, address.getBootstrapPort());
         assertEquals("socket://:7501", address.getRawAddress());
      } catch (XmlBlasterException e) {
         fail("testParse failed: " + e.toString());
      }

      System.out.println("***ConnectQosFactoryTest: testParse [SUCCESS]");
View Full Code Here

         xmlBlasterAccess.setServerNodeId("FRISH FISH");
         assertEquals("", "/node/FRISH FISH", xmlBlasterAccess.getServerNodeId());

         try {
            ConnectQos connectQos = new ConnectQos(glob);
            Address address = new Address(glob);
            address.setBootstrapPort(8999); // a wrong port to avoid connection
            address.setRetries(0);       // switch off polling
            connectQos.setAddress(address);
            xmlBlasterAccess.connect(connectQos, null);
            fail("Not expected successful connect");
         }
         catch (XmlBlasterException e) {
View Full Code Here

TOP

Related Classes of org.xmlBlaster.util.qos.address.Address

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.