Package org.xmlBlaster.util.qos.address

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


      System.out.println("***AddressBaseTest: testSet ...");
     
      try {
         {
            Global glob = new Global();
            Address a = new Address(glob);
            a.setType("SOCKET");
            a.setBootstrapHostname("oioihost");
            a.setBootstrapPort(9999);
            a.setRawAddress("127.0.0.1:7600");
            a.setCollectTime(12345L);
            a.setPingInterval(54321L);
            a.setRetries(17);
            a.setDelay(7890L);
            a.setOneway(true);
            a.setSecretSessionId("0x4546hwi89");
            System.out.println(a.toXml());
            assertEquals("", "SOCKET", a.getType());
            assertEquals("", "oioihost", a.getBootstrapHostname());
            assertEquals("", 9999, a.getBootstrapPort());
            assertEquals("", "127.0.0.1:7600", a.getRawAddress());
            assertEquals("", 12345L, a.getCollectTime());
            assertEquals("", 54321L, a.getPingInterval());
            assertEquals("", 17, a.getRetries());
            assertEquals("", 7890L, a.getDelay());
            assertEquals("", true, a.oneway());
            assertEquals("", "0x4546hwi89", a.getSecretSessionId());
         }
         {
            Global glob = new Global();
            Address a = new Address(glob);
            a.setRawAddress("127.0.0.1:7600"); // A setRawAddress() should not be modified
            a.setBootstrapHostname("oioihost");
            a.setBootstrapPort(9999);
            System.out.println(a.toXml());
            assertEquals("", "oioihost", a.getBootstrapHostname());
            assertEquals("", 9999, a.getBootstrapPort());
            assertEquals("", "127.0.0.1:7600", a.getRawAddress());
         }
         {
            Global glob = new Global();
            Address a = new Address(glob);
            a.setBootstrapHostname("oioihost");
            a.setBootstrapPort(9999);
            System.out.println(a.toXml());
            assertEquals("", "oioihost", a.getBootstrapHostname());
            assertEquals("", 9999, a.getBootstrapPort());
            assertEquals("", "", a.getRawAddress());
         }
         {
            String nodeId = "heron";
           
            java.util.Vector vec = new java.util.Vector();
            vec.addElement("-sessionId");
            vec.addElement("ERROR");
            vec.addElement("-sessionId["+nodeId+"]");
            vec.addElement("OK");
            vec.addElement("-pingInterval");
            vec.addElement("8888");
            vec.addElement("-delay["+nodeId+"]");
            vec.addElement("8888");
            String[] args = (String[])vec.toArray(new String[0]);

            Global glob = new Global(args);
            Address a = new Address(glob, "RMI", nodeId);
            System.out.println(a.toXml());
         }
      }
      catch(Throwable e) {
         e.printStackTrace();
         System.err.println("TestFailed: " + e.toString());
View Full Code Here


   }

   public void testDefault() {
      System.out.println("***AddressBaseTest: testDefault ...");
     
      Address a = new Address(glob);
      assertEquals("", "xmlBlaster://"+glob.getLocalIP()+":3412", glob.getBootstrapAddress().getRawAddress());
      assertEquals("", "", a.getRawAddress());

      System.out.println("***AddressBaseTest: testDefault [SUCCESS]");
   }
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

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

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

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

          + "</address>"
          + "</qos></connect>"
          + "   </clusternode>";
         NodeParser nodeParser = new NodeParser(serverScope, new ClusterNode(
               serverScope, new NodeId("avalon"), null), xml);
         Address address = nodeParser.getClusterNode().getNodeInfo()
               .getConnectQosData().getAddress();
         log.info("Address='" + address.getRawAddress().trim() + "'");
         assertEquals("socket://:7501", address.getRawAddress().trim());
      } catch (XmlBlasterException e) {
         e.printStackTrace();
         fail(e.toString());
      }
   }
View Full Code Here

            + "</qos></connect>"
            + "</clusternode>";
         NodeParser nodeParser = new NodeParser(serverScope, new ClusterNode(
               serverScope, new NodeId("avalon"), null), xml);
         log.info(nodeParser.getClusterNode().toXml());
         Address address = nodeParser.getClusterNode().getNodeInfo()
               .getConnectQosData().getAddress();
         log.info("Address='" + address.getRawAddress().trim() + "'");
         assertEquals("socket://:7501", address.getRawAddress().trim());
         assertEquals(true, address.getEnv("useRemoteLoginAsTunnel", false)
               .getValue());
      } catch (XmlBlasterException e) {
         e.printStackTrace();
         fail(e.toString());
      }
View Full Code Here

         NodeParser nodeParser = new NodeParser(serverScope, new ClusterNode(
               serverScope, new NodeId("avalon"), null), xml);
         ClusterNode clusterNode = nodeParser.getClusterNode();
         log.info(clusterNode.toXml());
        
         Address address = clusterNode.getNodeInfo()
               .getConnectQosData().getAddress();
         assertEquals("IOR:09456087000", address.getRawAddress().trim());
         assertEquals(false, address.getEnv("useRemoteLoginAsTunnel", false)
               .getValue());
        
         NodeMasterInfo[] masters = clusterNode.getNodeMasterInfos();
         assertEquals(2, masters.length);
        
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

      try {
         I_XmlBlasterAccess con = this.glob.getXmlBlasterAccess(); // Find orb
         String passwd = "secret";
         ConnectQos connectQos = new ConnectQos(glob, senderName, passwd); // == "<qos>...</qos>";
         // 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(500L); // switched off
         connectQos.setAddress(addressProp);
         con.connect(connectQos, null)// Login to xmlBlaster, register for updates
      }
      catch (XmlBlasterException e) {
          log.warning("setUp() - login failed: " + e.getMessage());
View Full Code Here

    * we want connect to.
    * @return never null
    */
   public Address getAddress() {
      ClientQueueProperty[] props = getClientQueuePropertyArr();
      Address adr = null;
      for (int i=0; i<props.length; i++) {
         adr = props[i].getCurrentAddress();
         if (getDefaultType().equals(adr.getType())) {
            return adr;
         }
      }
      if (adr == null) {
         log.severe("Internal error, can't access address instance in queue");
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.