public Matrix get(Object key) { Matrix matrix = super.get(key); if (matrix == null && key != null) { String address = key.toString(); if (!address.isEmpty()) { matrix = new RemoteHostMatrix(address); super.put(String.valueOf(key), matrix); } } return matrix; }
put("JDMP", null); fireValueChanged(); socket.close(); if (portAvailable) { put("HTTP", new HttpMatrix("http://" + getObject(0))); fireValueChanged(); socket.close(); if (portAvailable) { put("HTTPS", new HttpMatrix("https://" + getObject(0))); fireValueChanged(); put("MySQL", null); fireValueChanged(); socket.close(); if (portAvailable) { put("SSH", null); fireValueChanged(); socket.close(); if (portAvailable) { put("FTP", null); fireValueChanged(); socket.close(); if (portAvailable) { put("Telnet", null);
public RemoteHostMatrix(final String address) { super(new TreeMap<String, Matrix>()); setLabel(NetworkUtil.getHostName(address));
@Override public void step(int i) { byte[] tmpip = Arrays.copyOf(ip, ip.length); tmpip[3] = (byte) i; try { InetAddress tmpaddress = InetAddress.getByAddress(tmpip); if (tmpaddress.isReachable(3000) && !containsKey(tmpaddress.getHostAddress())) { put(tmpaddress.getHostAddress(), new RemoteHostMatrix(tmpaddress.getHostAddress())); } } catch (Exception e) { e.printStackTrace(); } } };
public SubnetMatrix(InterfaceAddress address) throws SocketException { super(new TreeMap<String, Matrix>()); this.address = address; setLabel(address.getAddress() + "/" + address.getNetworkPrefixLength()); put(address.getAddress().getHostAddress(), new RemoteHostMatrix(address.getAddress() .getHostAddress())); new BackgroundTask() { @Override public Object run() { search(); return null; } }; }