import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Properties;
+import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
}
/**
+ * Returns whether the given node is currently connected.
+ *
+ * @param node
+ * The node to check
+ * @return <code>true</code> if the node is currently connected,
+ * <code>false</code> otherwise
+ */
+ public boolean isNodeConnected(Node node) {
+ return connectedNodes.contains(node);
+ }
+
+ /**
* {@inheritDoc}
*/
public Iterator<Node> iterator() {
logger.log(Level.WARNING, "got event for unknown client");
return;
}
+ connectedNodes.add(node);
nodeListenerSupport.fireNodeConnected(node);
}
logger.log(Level.WARNING, "got event for unknown client");
return;
}
+ connectedNodes.remove(node);
nodeListenerSupport.fireNodeDisconnected(node, throwable);
}
}