Exemplo n.º 1
0
 @Override
 public CloudNode getNode(String nodeId) throws NodeNotFoundException {
   for (CloudNode node : nodes) {
     if (nodeId.equals(node.getId())) {
       return node;
     }
   }
   throw new NoSuchElementException();
 }
Exemplo n.º 2
0
 @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;
 }