/** * Constructor to initialize the TaskExecutionResource using * {@link TaskJobExecutionRel}. * * @param taskJobExecutionRel contains the {@link TaskExecution} but also a list of * the Job ExecutionIds that were associated with this task if applicable. */ public TaskExecutionResource(TaskJobExecutionRel taskJobExecutionRel) { Assert.notNull(taskJobExecutionRel, "taskJobExecutionDTO must not be null"); this.executionId = taskJobExecutionRel.getTaskExecution().getExecutionId(); this.exitCode = taskJobExecutionRel.getTaskExecution().getExitCode(); this.taskName = taskJobExecutionRel.getTaskExecution().getTaskName(); this.exitMessage = taskJobExecutionRel.getTaskExecution().getExitMessage(); this.arguments = Collections.unmodifiableList(taskJobExecutionRel.getTaskExecution().getArguments()); this.startTime = taskJobExecutionRel.getTaskExecution().getStartTime(); this.endTime = taskJobExecutionRel.getTaskExecution().getEndTime(); this.errorMessage = taskJobExecutionRel.getTaskExecution().getErrorMessage(); this.externalExecutionId = taskJobExecutionRel.getTaskExecution().getExternalExecutionId(); if (taskJobExecutionRel.getJobExecutionIds() == null) { this.jobExecutionIds = Collections.emptyList(); } else { this.jobExecutionIds = Collections .unmodifiableList(new ArrayList<>(taskJobExecutionRel.getJobExecutionIds())); } }
@Override public TaskExecutionResource toResource(TaskJobExecutionRel taskJobExecutionRel) { return createResourceWithId(taskJobExecutionRel.getTaskExecution().getExecutionId(), taskJobExecutionRel); }
private Page<TaskJobExecutionRel> getPageableRelationships(Page<TaskExecution> taskExecutions, Pageable pageable) { List<TaskJobExecutionRel> taskJobExecutionRels = new ArrayList<>(); for (TaskExecution taskExecution : taskExecutions.getContent()) { taskJobExecutionRels .add(new TaskJobExecutionRel(sanitizePotentialSensitiveKeys(taskExecution), new ArrayList<>( this.explorer.getJobExecutionIdsByTaskExecutionId(taskExecution.getExecutionId())))); } return new PageImpl<>(taskJobExecutionRels, pageable, taskExecutions.getTotalElements()); }
@Override public TaskExecutionResource toResource(TaskJobExecutionRel taskJobExecutionRel) { return createResourceWithId(taskJobExecutionRel.getTaskExecution().getExecutionId(), taskJobExecutionRel); }
private Page<TaskJobExecutionRel> getPageableRelationships(Page<TaskExecution> taskExecutions, Pageable pageable) { List<TaskJobExecutionRel> taskJobExecutionRels = new ArrayList<>(); for (TaskExecution taskExecution : taskExecutions.getContent()) { taskJobExecutionRels .add(new TaskJobExecutionRel(sanitizePotentialSensitiveKeys(taskExecution), new ArrayList<>( this.explorer.getJobExecutionIdsByTaskExecutionId(taskExecution.getExecutionId())))); } return new PageImpl<>(taskJobExecutionRels, pageable, taskExecutions.getTotalElements()); }
/** * Constructor to initialize the TaskExecutionResource using * {@link TaskJobExecutionRel}. * * @param taskJobExecutionRel contains the {@link TaskExecution} but also a list of * the Job ExecutionIds that were associated with this task if applicable. */ public TaskExecutionResource(TaskJobExecutionRel taskJobExecutionRel) { Assert.notNull(taskJobExecutionRel, "taskJobExecutionDTO must not be null"); this.executionId = taskJobExecutionRel.getTaskExecution().getExecutionId(); this.exitCode = taskJobExecutionRel.getTaskExecution().getExitCode(); this.taskName = taskJobExecutionRel.getTaskExecution().getTaskName(); this.exitMessage = taskJobExecutionRel.getTaskExecution().getExitMessage(); this.arguments = Collections.unmodifiableList(taskJobExecutionRel.getTaskExecution().getArguments()); this.startTime = taskJobExecutionRel.getTaskExecution().getStartTime(); this.endTime = taskJobExecutionRel.getTaskExecution().getEndTime(); this.errorMessage = taskJobExecutionRel.getTaskExecution().getErrorMessage(); this.externalExecutionId = taskJobExecutionRel.getTaskExecution().getExternalExecutionId(); if (taskJobExecutionRel.getJobExecutionIds() == null) { this.jobExecutionIds = Collections.emptyList(); } else { this.jobExecutionIds = Collections .unmodifiableList(new ArrayList<>(taskJobExecutionRel.getJobExecutionIds())); } }
/** * View the details of a single task execution, specified by id. * * @param id the id of the requested {@link TaskExecution} * @return the {@link TaskExecution} */ @RequestMapping(value = "/{id}", method = RequestMethod.GET) @ResponseStatus(HttpStatus.OK) public TaskExecutionResource view(@PathVariable("id") long id) { TaskExecution taskExecution = this.explorer.getTaskExecution(id); if (taskExecution == null) { throw new NoSuchTaskExecutionException(id); } taskExecution = sanitizePotentialSensitiveKeys(taskExecution); TaskJobExecutionRel taskJobExecutionRel = new TaskJobExecutionRel(taskExecution, new ArrayList<>(this.explorer.getJobExecutionIdsByTaskExecutionId(taskExecution.getExecutionId()))); return this.taskAssembler.toResource(taskJobExecutionRel); }
/** * View the details of a single task execution, specified by id. * * @param id the id of the requested {@link TaskExecution} * @return the {@link TaskExecution} */ @RequestMapping(value = "/{id}", method = RequestMethod.GET) @ResponseStatus(HttpStatus.OK) public TaskExecutionResource view(@PathVariable("id") long id) { TaskExecution taskExecution = this.explorer.getTaskExecution(id); if (taskExecution == null) { throw new NoSuchTaskExecutionException(id); } taskExecution = sanitizePotentialSensitiveKeys(taskExecution); TaskJobExecutionRel taskJobExecutionRel = new TaskJobExecutionRel(taskExecution, new ArrayList<>(this.explorer.getJobExecutionIdsByTaskExecutionId(taskExecution.getExecutionId()))); return this.taskAssembler.toResource(taskJobExecutionRel); }