org.springframework.cloud.dataflow.rest.resource

## Class TaskExecutionResource

- java.lang.Object
- - org.springframework.hateoas.RepresentationModel<TaskExecutionResource>
  - - org.springframework.cloud.dataflow.rest.resource.TaskExecutionResource

-     public class TaskExecutionResource
      extends org.springframework.hateoas.RepresentationModel<TaskExecutionResource>

  A HATEOAS representation of a TaskExecution.
  Author:
    Glenn Renfro, Gunnar Hillert, Ilayaperumal Gopinathan

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `TaskExecutionResource.Page`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TaskExecutionResource()`
    `TaskExecutionResource(org.springframework.cloud.task.repository.TaskExecution taskExecution, TaskJobExecution composedTaskJobExecution)` Constructor to initialize the TaskExecutionResource using a `TaskExecution`.
    `TaskExecutionResource(org.springframework.cloud.task.repository.TaskExecution taskExecution, TaskManifest taskManifest, TaskJobExecution composedTaskJobExecution)` Constructor to initialize the TaskExecutionResource using a `TaskExecution` and `TaskManifest`.
    `TaskExecutionResource(TaskJobExecutionRel taskJobExecutionRel)` Constructor to initialize the TaskExecutionResource using `TaskJobExecutionRel`.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Map<String,String>` | `getAppProperties()`
    `List<String>` | `getArguments()`
    `Map<String,String>` | `getDeploymentProperties()`
    `Date` | `getEndTime()`
    `String` | `getErrorMessage()`
    `long` | `getExecutionId()`
    `Integer` | `getExitCode()`
    `String` | `getExitMessage()`
    `String` | `getExternalExecutionId()`
    `List<Long>` | `getJobExecutionIds()`
    `Long` | `getParentExecutionId()`
    `String` | `getPlatformName()`
    `String` | `getResourceUrl()`
    `Date` | `getStartTime()`
    `TaskExecutionStatus` | `getTaskExecutionStatus()` Returns the calculated status of this `TaskExecution`.
    `String` | `getTaskName()`
    `void` | `setPlatformName(String platformName)`
    `void` | `setTaskExecutionStatus(String taskExecutionStatus)`

    - ### Methods inherited from class org.springframework.hateoas.RepresentationModel

      `add, add, add, addAllIf, addIf, equals, getLink, getLink, getLinks, getLinks, getLinks, getRequiredLink, getRequiredLink, hashCode, hasLink, hasLink, hasLinks, of, of, removeLinks, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### TaskExecutionResource

          public TaskExecutionResource()

    - #### TaskExecutionResource

          public TaskExecutionResource(TaskJobExecutionRel taskJobExecutionRel)

      Constructor to initialize the TaskExecutionResource using `TaskJobExecutionRel`.
      Parameters:
        `taskJobExecutionRel` - contains the `TaskExecution` but also a list of the Job ExecutionIds that were associated with this task if applicable.

    - #### TaskExecutionResource

          public TaskExecutionResource(org.springframework.cloud.task.repository.TaskExecution taskExecution,
                                       TaskJobExecution composedTaskJobExecution)

      Constructor to initialize the TaskExecutionResource using a `TaskExecution`.
      Parameters:
        `taskExecution` - contains the `TaskExecution`

    - #### TaskExecutionResource

          public TaskExecutionResource(org.springframework.cloud.task.repository.TaskExecution taskExecution,
                                       TaskManifest taskManifest,
                                       TaskJobExecution composedTaskJobExecution)

      Constructor to initialize the TaskExecutionResource using a `TaskExecution` and `TaskManifest`.
      Parameters:
        `taskExecution` - contains the `TaskExecution`
        `taskManifest` - contains the (@link TaskManifest}

  - ### Method Detail

    - #### getExecutionId

          public long getExecutionId()

    - #### getExitCode

          public Integer getExitCode()

      Returns:
        the int containing the exit code of the task application upon completion. Default is 0.

    - #### getTaskName

          public String getTaskName()

    - #### getStartTime

          public Date getStartTime()

    - #### getEndTime

          public Date getEndTime()

    - #### getExitMessage

          public String getExitMessage()

    - #### getArguments

          public List<String> getArguments()

    - #### getJobExecutionIds

          public List<Long> getJobExecutionIds()

    - #### getErrorMessage

          public String getErrorMessage()

    - #### getExternalExecutionId

          public String getExternalExecutionId()

    - #### getParentExecutionId

          public Long getParentExecutionId()

    - #### getResourceUrl

          public String getResourceUrl()

    - #### getAppProperties

          public Map<String,String> getAppProperties()

    - #### getDeploymentProperties

          public Map<String,String> getDeploymentProperties()

    - #### getPlatformName

          public String getPlatformName()

    - #### setPlatformName

          public void setPlatformName(String platformName)

    - #### setTaskExecutionStatus

          public void setTaskExecutionStatus(String taskExecutionStatus)

    - #### getTaskExecutionStatus

          public TaskExecutionStatus getTaskExecutionStatus()

      Returns the calculated status of this `TaskExecution`. If `startTime` is null, the `TaskExecution` is considered to be not running (never executed). If `endTime` is null, the `TaskExecution` is considered to be still running: `TaskExecutionStatus.RUNNING`. If the `endTime` is defined and the `exitCode` is non-zero, an status of `TaskExecutionStatus.ERROR` is assumed, if `exitCode` is zero, `TaskExecutionStatus.COMPLETE` is returned.
      Returns:
        TaskExecutionStatus, never null

Copyright © 2021 Pivotal Software, Inc.. All rights reserved.