public static Collection<PastryContact> getEclipseNeighbors() { LinkedHashSet<PastryContact> neighbors = new LinkedHashSet<PastryContact>(); for (RTPPastryNode n : RTPPastryNodeFactory.allMaliciousNodes.values()) { neighbors.add(n.getOverlayContact()); } return neighbors; }
public static RTPPastryNode getNearestMaliciousNode(PastryKey key) { RTPPastryNode nn = null; for (PastryID pid : RTPPastryNodeFactory.allMaliciousNodes.keySet()) { if (nn == null || ((key.getUniqueValue().subtract(pid.getUniqueValue())) .abs() .compareTo( (key.getUniqueValue().subtract(nn.getOverlayID().getUniqueValue())).abs())) == -1) { nn = RTPPastryNodeFactory.allMaliciousNodes.get(pid); } } return nn; }