@Override public CloudNode getNode(String nodeId) throws NodeNotFoundException { for (CloudNode node : nodes) { if (nodeId.equals(node.getId())) { return node; } } throw new NoSuchElementException(); }
@Override public CloudNode createNode(NodeSpec NodeSpec) throws NodeNotCreatedException { CloudNode n = new CloudNode(); takesALong(); String id = Integer.toString(counter.getAndIncrement()); n.setId(id); nodes.add(n); return n; }