/** * @param xcomputer * @return * @author Julius Huelsmann * @version %I%, %U% * @since 1.0 */ private boolean addComputer(final ComputerRemote xcomputer) { if (xcomputer == null || computer == null) { View.print(getClass() + "Fehler."); return false; } for (int i = 0; i < computer.size(); i++) { // // In case the computer has already been added or the computer to add // is the local computer, return false. if (xcomputer.matches(computer.get(i))) { return false; } else if (xcomputer.getUid().equals(getUid())) { return false; } } Staticio.skipPort(xcomputer.getPort()); computer.add(xcomputer); setChanged(); notifyObservers(new Object[] {View.ID_UPDATE_COMPUTER, computer}); save(Constants.getConfigLocal()); return true; }
/** * Broadcast all information to specified computer. * * @param xcr the computerRemote which will receive the information. * @author Julius Huelsmann * @version %I%, %U% * @since 1.0 */ public void sendInformationTo(final ComputerRemote xcr) { Staticio.sendStringServerinfoReply(xcr.getAddress(), xcr.getPort(), this); }