Package org.springframework.xd.shell.util

Examples of org.springframework.xd.shell.util.TableRow.addValue()


        .addHeader(5, new TableHeader("Groups"))
        .addHeader(6, new TableHeader("Custom Attributes"));
    for (DetailedContainerResource container : containers) {
      Map<String, String> copy = new HashMap<String, String>(container.getAttributes());
      final TableRow row = table.newRow();
      row.addValue(1, copy.remove("id"))
          .addValue(2, copy.remove("host"))
          .addValue(3, copy.remove("ip"))
          .addValue(4, copy.remove("pid"));
      String groups = copy.remove("groups");
      row.addValue(5, groups == null ? "" : groups);
View Full Code Here


      row.addValue(1, copy.remove("id"))
          .addValue(2, copy.remove("host"))
          .addValue(3, copy.remove("ip"))
          .addValue(4, copy.remove("pid"));
      String groups = copy.remove("groups");
      row.addValue(5, groups == null ? "" : groups);
      row.addValue(6, copy.isEmpty() ? "" : copy.toString());
    }
    return table;
  }
View Full Code Here

          .addValue(2, copy.remove("host"))
          .addValue(3, copy.remove("ip"))
          .addValue(4, copy.remove("pid"));
      String groups = copy.remove("groups");
      row.addValue(5, groups == null ? "" : groups);
      row.addValue(6, copy.isEmpty() ? "" : copy.toString());
    }
    return table;
  }

  @CliCommand(value = LIST_MODULES, help = "List runtime modules")
View Full Code Here

        new TableHeader("Container Id")).addHeader(3, new TableHeader("Options")).addHeader(4,
        new TableHeader("Deployment Properties")).addHeader(5, new TableHeader("Unit status"));
    for (ModuleMetadataResource module : runtimeModules) {
      final TableRow row = table.newRow();
      String unitStatus = (module.getDeploymentStatus() != null) ? module.getDeploymentStatus().name() : "";
      row.addValue(1, String.format("%s.%s.%s", module.getUnitName(), module.getModuleType(), module.getName()))
          .addValue(2, module.getContainerId()).addValue(3, module.getModuleOptions().toString()).addValue(4,
              module.getDeploymentProperties().toString()).addValue(5, unitStatus);
    }
    return table;
  }
View Full Code Here

    for (JobExecutionInfoResource jobExecutionInfoResource : jobExecutions) {
      final TableRow row = new TableRow();
      final String startTimeAsString = this.configuration.getLocalTime(jobExecutionInfoResource.getJobExecution().getStartTime());

      row.addValue(1, String.valueOf(jobExecutionInfoResource.getExecutionId()))
          .addValue(2, jobExecutionInfoResource.getName())
          .addValue(3, startTimeAsString)
          .addValue(4, String.valueOf(jobExecutionInfoResource.getStepExecutionCount()))
          .addValue(5, jobExecutionInfoResource.getJobExecution().getStatus().name())
          .addValue(6, (jobExecutionInfoResource.isDeployed()) ? "Deployed" : "Undeployed")
View Full Code Here

      final String localStartTime = this.configuration.getLocalTime(stepExecutionInfoResource.getStepExecution().getStartTime());
      final Date endTimeDate = stepExecutionInfoResource.getStepExecution().getEndTime();
      final String localEndTime = (endTimeDate == null) ? "" : this.configuration.getLocalTime(endTimeDate);
      final TableRow row = new TableRow();

      row.addValue(1, String.valueOf(stepExecutionInfoResource.getStepExecution().getId()))
          .addValue(2, stepExecutionInfoResource.getStepExecution().getStepName())
          .addValue(3, String.valueOf(stepExecutionInfoResource.getJobExecutionId()))
          .addValue(4, localStartTime)
          .addValue(5, localEndTime)
          .addValue(6, stepExecutionInfoResource.getStepExecution().getStatus().name());
View Full Code Here

    table.addHeader(1, new TableHeader("Id"))
        .addHeader(2, new TableHeader("Step Name"))
        .addHeader(3, new TableHeader("Percentage Complete"))
        .addHeader(4, new TableHeader("Duration"));
    final TableRow tableRow = new TableRow();
    tableRow.addValue(1, String.valueOf(progressInfoResource.getStepExecution().getId()))
        .addValue(2, String.valueOf(progressInfoResource.getStepExecution().getStepName()))
        .addValue(3, String.format("%.0f%%", progressInfoResource.getPercentageComplete() * 100))
        .addValue(4, String.format("%.0f ms", progressInfoResource.getDuration()));
    table.getRows().add(tableRow);
    return table;
View Full Code Here

    for (String type : typeToColumn.keySet()) {
      table.addHeader(i++, new TableHeader("    " + StringUtils.capitalize(type)));
    }
    for (ModuleDefinitionResource module : modules) {
      TableRow row = rowForType(module.getType(), table, currentRowByType);
      row.addValue(typeToColumn.get(module.getType()), cellValue(module));
    }
    return table;
  }

  private String cellValue(ModuleDefinitionResource module) {
View Full Code Here

    currentRowByType.put(type, value + 1);
    TableRow result = null;
    if (value >= table.getRows().size()) {
      result = new TableRow();
      for (int i = 1; i <= typeToColumn.size(); i++) {
        result.addValue(i, "");
      }
      table.getRows().add(result);
    }
    else {
      result = table.getRows().get(value);
View Full Code Here

      for (DetailedModuleDefinitionResource.Option o : options) {
        if (!showHidden && o.isHidden()) {
          continue;
        }
        final TableRow row = new TableRow();
        row.addValue(1, o.getName())
            .addValue(2, o.getDescription())
            .addValue(3, o.getDefaultValue() == null ? "<none>" : o.getDefaultValue())
            .addValue(4, o.getType() == null ? "<unknown>" : o.getType());
        table.getRows().add(row);
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.