Package org.springframework.xd.shell.util

Examples of org.springframework.xd.shell.util.TableHeader


  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;
    String startTimeAsString = 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

  public Table listStreams() {

    final PagedResources<StreamDefinitionResource> streams = streamOperations().list();

    final Table table = new Table()
        .addHeader(1, new TableHeader("Stream Name"))
        .addHeader(2, new TableHeader("Stream Definition"))
        .addHeader(3, new TableHeader("Status"));

    for (StreamDefinitionResource stream : streams) {
      table.newRow()
          .addValue(1, stream.getName())
          .addValue(2, stream.getDefinition())
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"));
    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"))
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() : "";
      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,
View Full Code Here

  @CliCommand(value = LIST_JOBS, help = "List all jobs")
  public Table listJobs() {

    final PagedResources<JobDefinitionResource> jobs = jobOperations().list();
    final Table table = new Table()
        .addHeader(1, new TableHeader("Job Name"))
        .addHeader(2, new TableHeader("Job Definition"))
        .addHeader(3, new TableHeader("Status"));

    for (JobDefinitionResource jobDefinitionResource : jobs) {
      table.newRow()
          .addValue(1, jobDefinitionResource.getName())
          .addValue(2, jobDefinitionResource.getDefinition())
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"))
        .addHeader(7, new TableHeader("Definition Status"));

    for (JobExecutionInfoResource jobExecutionInfoResource : jobExecutions) {
      final TableRow row = new TableRow();
      final String startTimeAsString = this.configuration.getLocalTime(jobExecutionInfoResource.getJobExecution().getStartTime());
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"));

    for (StepExecutionInfoResource stepExecutionInfoResource : stepExecutions) {

      final String localStartTime = this.configuration.getLocalTime(stepExecutionInfoResource.getStepExecution().getStartTime());
      final Date endTimeDate = stepExecutionInfoResource.getStepExecution().getEndTime();
View Full Code Here

TOP

Related Classes of org.springframework.xd.shell.util.TableHeader

Copyright © 2018 www.massapicom. 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.