Example #1
0
  private void run_updateNodes() throws ExecutionProblem {

    final String[] hostnames = this.hosts.toArray(new String[this.hosts.size()]);
    final Boolean active = this.nodeActiveConfigured ? this.nodeActive : null;
    final String resourcepool = this.nodePool;
    final Integer memory = this.nodeMemoryConfigured ? this.nodeMemory : null;
    final String networks = this.nodeNetworks;

    NodeReport[] reports = null;
    try {
      final String reportJson =
          this.remoteNodeManagement.updateNodes(hostnames, active, resourcepool, memory, networks);
      reports = gson.fromJson(reportJson, NodeReport[].class);
    } catch (RemoteException e) {
      super.handleRemoteException(e);
    }

    try {
      reporter.report(nodeReportsToMaps(reports), this.outStream);
    } catch (IOException e) {
      throw new ExecutionProblem("Problem writing output: " + e.getMessage(), e);
    }
  }