Package org.springframework.xd.shell.util

Examples of org.springframework.xd.shell.util.Table.addHeader()


  public Table constructRichGaugeDisplay(double value, double alpha, double average, double max, double min,
      long count) {
    Table t = new Table();
    NumberFormat pattern = new DecimalFormat();
    t.addHeader(1, new TableHeader("Name")).addHeader(2, new TableHeader(getName()));
    t.newRow().addValue(1, "value").addValue(2, pattern.format(value));
    t.newRow().addValue(1, "alpha").addValue(2, pattern.format(alpha));
    t.newRow().addValue(1, "average").addValue(2, pattern.format(average));
    t.newRow().addValue(1, "max").addValue(2, pattern.format(max));
    t.newRow().addValue(1, "min").addValue(2, pattern.format(min));
View Full Code Here


  }

  public static Table prepareStepExecutionTable(final StepExecutionInfoResource stepExecutionInfoResource,
      final TimeZone timeZone) {
    final Table stepExecutionTable = new Table();
    stepExecutionTable.addHeader(1, new TableHeader("Property"))
    .addHeader(2, new TableHeader("Value"));

    String stepId = CommonUtils.NOT_AVAILABLE;
    String jobExecutionIdFromData = CommonUtils.NOT_AVAILABLE;
    String stepName = CommonUtils.NOT_AVAILABLE;
View Full Code Here

  }

  private Table displayAggrCounter(AggregateCountsResource aggResource, NumberFormat pattern) {
    final SortedMap<Date, Long> values = aggResource.getValues();
    Table t = new Table();
    t.addHeader(1, new TableHeader("AggregateCounter=" + aggResource.getName())).addHeader(2, new TableHeader(""))
        .addHeader(3, new TableHeader(""));
    t.newRow().addValue(1, "TIME").addValue(2, "-").addValue(3, "COUNT");
    for (Map.Entry<Date, Long> entry : values.entrySet()) {
      t.newRow().addValue(1, entry.getKey().toString()).addValue(2, "|")
          .addValue(3, pattern.format(entry.getValue()));
View Full Code Here

  /**
   * Render a table with information about a list of metrics
   */
  protected Table displayMetrics(PagedResources<MetricResource> list) {
    Table table = new Table();
    table.addHeader(1, new TableHeader(String.format("%s name", kind)));
    for (MetricResource r : list) {
      table.newRow().addValue(1, r.getName());
    }
    return table;
  }
View Full Code Here

  @CliCommand(value = LIST_CONTAINERS, help = "List runtime containers")
  public Table listContainers() {
    final PagedResources<DetailedContainerResource> containers = runtimeOperations().listContainers();
    final Table table = new Table();
    table.addHeader(1, new TableHeader("Container Id"))
        .addHeader(2, new TableHeader("Host"))
        .addHeader(3, new TableHeader("IP Address"))
        .addHeader(4, new TableHeader("PID"))
        .addHeader(5, new TableHeader("Groups"))
        .addHeader(6, new TableHeader("Custom Attributes"));
View Full Code Here

    }
    else {
      runtimeModules = runtimeOperations().listDeployedModules();
    }
    final Table table = new Table();
    table.addHeader(1, new TableHeader("Module Id")).addHeader(2,
        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() : "";
View Full Code Here

  @CliCommand(value = LIST_JOB_EXECUTIONS, help = "List all job executions")
  public Table listJobExecutions() {

    final PagedResources<JobExecutionInfoResource> jobExecutions = jobOperations().listJobExecutions();
    final Table table = new Table();
    table.addHeader(1, new TableHeader("Id"))
        .addHeader(2, new TableHeader("Job Name"))
        .addHeader(3, new TableHeader("Start Time"))
        .addHeader(4, new TableHeader("Step Execution Count"))
        .addHeader(5, new TableHeader("Execution Status"))
        .addHeader(6, new TableHeader("Deployment Status"))
View Full Code Here

  public Table listStepExecutions(
      @CliOption(mandatory = true, key = { "", "id" }, help = "the id of the job execution") long jobExecutionId) {

    final List<StepExecutionInfoResource> stepExecutions = jobOperations().listStepExecutions(jobExecutionId);
    final Table table = new Table();
    table.addHeader(1, new TableHeader("Id"))
        .addHeader(2, new TableHeader("Step Name"))
        .addHeader(3, new TableHeader("Job Exec ID"))
        .addHeader(4, new TableHeader("Start Time"))
        .addHeader(5, new TableHeader("End Time"))
        .addHeader(6, new TableHeader("Status"));
View Full Code Here

      @CliOption(mandatory = true, key = { "", "id" }, help = "the id of the step execution") long stepExecutionId,
      @CliOption(mandatory = true, key = { "jobExecutionId" }, help = "the job execution id") long jobExecutionId) {
    StepExecutionProgressInfoResource progressInfoResource = jobOperations().stepExecutionProgress(jobExecutionId,
        stepExecutionId);
    Table table = new Table();
    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()))
View Full Code Here

      @CliOption(mandatory = true, key = { "", "id" }, help = "the id of the job execution") long jobExecutionId) {

    final JobExecutionInfoResource jobExecutionInfoResource = jobOperations().displayJobExecution(jobExecutionId);

    final Table jobExecutionTable = new Table();
    jobExecutionTable.addHeader(1, new TableHeader("Property"))
        .addHeader(2, new TableHeader("Value"));

    final StringBuilder details = new StringBuilder();

    details.append("Job Execution Details:\n");
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.