Package ch.rakudave.jnetmap.model.IF

Examples of ch.rakudave.jnetmap.model.IF.TransparentIF


      Logger.debug("Unable to find opposite", e);
    }
    if (aSwitch == null) { // create a switch if necessary
      aSwitch = new Host(Type.Switch);
      map.addVertex(aSwitch);
      aSwitch.addInterface(new TransparentIF(aSwitch, gToS, gatewayIF));
      map.addEdge(gToS, gateway, aSwitch);
    }
    final Device gw = gateway, sw = aSwitch;
    final NetworkIF gif = gatewayIF;
    for (final InetAddress address : hosts.keySet()) {
      Scheduler.execute(new Runnable() {
        @Override
        public void run() {
          try {
            if (!address.equals(gif.getAddress())) {
              if (tryFindIP(map, address) != null) return;
              Logger.debug("Adding Interface "+address);
              Connection c = new Connection();
              Device d = new Host();
                d.setName(address.getHostName());
                PhysicalIF pif = new PhysicalIF(d, c, address.getHostAddress());
                  pif.setPingMethod(hosts.get(address));
                  pif.setSubnet(subnet.getInfo().getNetmask());
                  pif.setGateway(subnet.getInfo().getLowAddress());
                d.addInterface(pif);
                SNMP.inferProperties(d);
              sw.addInterface(new TransparentIF(sw, c, pif));
              map.addVertex(d);
              map.addEdge(c, d, sw);
            } else {
              if (gif instanceof PhysicalIF) ((PhysicalIF) gif).setPingMethod(hosts.get(address));
              gw.setName(address.getHostName());
View Full Code Here


        arg1.addInterface(new LogicalIF(arg1, arg0, ""));
      } else {
        String t = arg1.getType().toString() + "";
        NetworkIF nif;
        if (t.contains("Switch") || t.contains("Hub") || t.contains("Wireless")) {
          nif = new TransparentIF(arg1, arg0, arg2.getInterfaceFor(arg0));
        } else {
          nif = new PhysicalIF(arg1, arg0, "");
        }
        arg1.addInterface(nif);
        NetworkIF counterpart = arg2.getInterfaceFor(arg0);
View Full Code Here

                pif.setPingMethod(oldMethod);
                pif.setName(oldName);
              parent.addInterface(pif);
              parent.removeInterface(newIF);
            } else if (isTransparent && addressCheckbox.isSelected()) {
              TransparentIF tif = new TransparentIF(parent, connection, Controller.getCurrentMap().
                getOpposite(parent, i.getConnection()).getInterfaceFor(connection));
                tif.setName(oldName);
              parent.addInterface(tif);
              parent.removeInterface(newIF);
            } else {
              i.setAddress(oldAddress);
              i.setSubnet(oldSubnet);
              i.setGateway(oldGateway);
              i.setName(oldName);
              if (isPhysical) {
                ((PhysicalIF)i).setMacAddress(oldMac);
                ((PhysicalIF)i).setPingMethod(oldMethod);
              }
            }
            return null;
          }
         
          @Override
          public Object redo() {
            NetworkIF counterpart = Controller.getCurrentMap().
              getOpposite(parent, i.getConnection()).getInterfaceFor(connection);
            if (isPhysical && !addressCheckbox.isSelected()) {
              newIF = new TransparentIF(parent, connection, counterpart);
                newIF.setName(newName);
              parent.addInterface(newIF);
              parent.removeInterface(i);
            } else if (isTransparent && addressCheckbox.isSelected()) {
              PhysicalIF pif = new PhysicalIF(parent, connection, newAddress);
View Full Code Here

TOP

Related Classes of ch.rakudave.jnetmap.model.IF.TransparentIF

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.