Package org.springframework.xd.rest.domain

Examples of org.springframework.xd.rest.domain.StepExecutionProgressInfoResource


    return createResourceWithId(entity.getStepExecutionId(), entity, entity.getStepExecution().getJobExecutionId());
  }

  @Override
  protected StepExecutionProgressInfoResource instantiateResource(StepExecutionProgressInfo entity) {
    return new StepExecutionProgressInfoResource(entity.getStepExecution(), entity.getStepExecutionHistory(),
        entity.getEstimatedPercentComplete(), entity.isFinished(), entity.getDuration());
  }
View Full Code Here


  @Override
  public StepExecutionProgressInfoResource stepExecutionProgress(long jobExecutionId, long stepExecutionId) {
    String uriTemplate = resources.get("jobs/executions").toString()
        + "/{jobExecutionId}/steps/{stepExecutionId}/progress";
    StepExecutionProgressInfoResource progressInfoResource = restTemplate.getForObject(uriTemplate,
        StepExecutionProgressInfoResource.class, jobExecutionId, stepExecutionId);
    return progressInfoResource;
  }
View Full Code Here

  @CliCommand(value = PROGRESS_STEP_EXECUTION, help = "Get the progress info for the given step execution")
  public Table stepExecutionProgress(
      @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()))
        .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

TOP

Related Classes of org.springframework.xd.rest.domain.StepExecutionProgressInfoResource

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.