private final List<CoreListener> coreListeners = new ArrayList<CoreListener>();
/** The node list. */
- private List<Node> nodeList = new ArrayList<Node>();
+ private List<Node> configuredNodes = new ArrayList<Node>();
+
+ /** List of currently connected nodes. */
+ private List<Node> connectedNodes = new ArrayList<Node>();
/**
* Creates a new core.
*
* @return All configured nodes
*/
- public List<Node> getNodeList() {
- return nodeList;
+ public List<Node> getNodes() {
+ return configuredNodes;
+ }
+
+ /**
+ * Returns whether the core is currently connected to the given node.
+ *
+ * @param node
+ * The node to check
+ * @return <code>true</code> if the core is currently connected to the
+ * node, <code>false</code> otherwise
+ */
+ public boolean isNodeConnected(Node node) {
+ return connectedNodes.contains(node);
}
//