public class SimpleTaskRepository extends Object implements TaskRepository
Modifier and Type | Field and Description |
---|---|
static int |
MAX_ERROR_MESSAGE_SIZE
Default max error message size.
|
static int |
MAX_EXIT_MESSAGE_SIZE
Default max exit message size.
|
static int |
MAX_TASK_NAME_SIZE
Default max task name size.
|
Constructor and Description |
---|
SimpleTaskRepository(org.springframework.beans.factory.FactoryBean<TaskExecutionDao> taskExecutionDaoFactoryBean) |
SimpleTaskRepository(org.springframework.beans.factory.FactoryBean<TaskExecutionDao> taskExecutionDaoFactoryBean,
Integer maxExitMessageSize,
Integer maxTaskNameSize,
Integer maxErrorMessageSize) |
Modifier and Type | Method and Description |
---|---|
TaskExecution |
completeTaskExecution(long executionId,
Integer exitCode,
Date endTime,
String exitMessage)
Notifies the repository that a taskExecution has completed.
|
TaskExecution |
completeTaskExecution(long executionId,
Integer exitCode,
Date endTime,
String exitMessage,
String errorMessage)
Notifies the repository that a taskExecution has completed.
|
TaskExecution |
createTaskExecution()
Creates an empty TaskExecution with just an id provided.
|
TaskExecution |
createTaskExecution(String name)
Creates an empty TaskExecution with just an id and name provided.
|
TaskExecution |
createTaskExecution(TaskExecution taskExecution)
Notifies the repository that a taskExecution needs to be created.
|
TaskExecutionDao |
getTaskExecutionDao()
Retrieves the taskExecutionDao associated with this repository.
|
void |
setMaxErrorMessageSize(int maxErrorMessageSize) |
void |
setMaxExitMessageSize(int maxExitMessageSize) |
void |
setMaxTaskNameSize(int maxTaskNameSize) |
TaskExecution |
startTaskExecution(long executionid,
String taskName,
Date startTime,
List<String> arguments,
String externalExecutionId)
Notifies the repository that a taskExecution has has started.
|
TaskExecution |
startTaskExecution(long executionid,
String taskName,
Date startTime,
List<String> arguments,
String externalExecutionId,
Long parentExecutionId)
Notifies the repository that a taskExecution has has started.
|
void |
updateExternalExecutionId(long executionid,
String externalExecutionId)
Notifies the repository to update the taskExecution's externalExecutionId.
|
public static final int MAX_EXIT_MESSAGE_SIZE
public static final int MAX_TASK_NAME_SIZE
public static final int MAX_ERROR_MESSAGE_SIZE
public SimpleTaskRepository(org.springframework.beans.factory.FactoryBean<TaskExecutionDao> taskExecutionDaoFactoryBean)
public SimpleTaskRepository(org.springframework.beans.factory.FactoryBean<TaskExecutionDao> taskExecutionDaoFactoryBean, Integer maxExitMessageSize, Integer maxTaskNameSize, Integer maxErrorMessageSize)
public TaskExecution completeTaskExecution(long executionId, Integer exitCode, Date endTime, String exitMessage)
TaskRepository
completeTaskExecution
in interface TaskRepository
executionId
- to the task execution to be updated.exitCode
- to be stored for this task.endTime
- designated when the task completed.exitMessage
- to be stored for the task.TaskExecution
public TaskExecution completeTaskExecution(long executionId, Integer exitCode, Date endTime, String exitMessage, String errorMessage)
TaskRepository
completeTaskExecution
in interface TaskRepository
executionId
- to the task execution to be updated.exitCode
- to be stored for this task execution.endTime
- designated when the task completed.exitMessage
- to be stored for the task execution.errorMessage
- to be stored for the task execution.TaskExecution
public TaskExecution createTaskExecution(TaskExecution taskExecution)
TaskRepository
createTaskExecution
in interface TaskRepository
taskExecution
- a TaskExecution instance containing the startTime, arguments
and externalExecutionId that will be stored in the repository. Only the values
enumerated above will be stored for this TaskExecution.TaskExecution
that was stored in the repository. The
TaskExecution's taskExecutionId will also contain the id that was used to store the
TaskExecution.public TaskExecution createTaskExecution(String name)
TaskRepository
createTaskExecution
in interface TaskRepository
name
- task name to be associated with the task execution.TaskExecution
public TaskExecution createTaskExecution()
TaskRepository
createTaskExecution
in interface TaskRepository
TaskExecution
public TaskExecution startTaskExecution(long executionid, String taskName, Date startTime, List<String> arguments, String externalExecutionId)
TaskRepository
startTaskExecution
in interface TaskRepository
executionid
- to the task execution to be updated.taskName
- the name that associated with the task execution.startTime
- the time task began.arguments
- list of key/value pairs that configure the task.externalExecutionId
- id assigned to the task by the platform.public void updateExternalExecutionId(long executionid, String externalExecutionId)
TaskRepository
updateExternalExecutionId
in interface TaskRepository
executionid
- to the task execution to be updated.externalExecutionId
- id assigned to the task by the platform.public TaskExecution startTaskExecution(long executionid, String taskName, Date startTime, List<String> arguments, String externalExecutionId, Long parentExecutionId)
TaskRepository
startTaskExecution
in interface TaskRepository
executionid
- to the task execution to be updated.taskName
- the name that associated with the task execution.startTime
- the time task began.arguments
- list of key/value pairs that configure the task.externalExecutionId
- id assigned to the task by the platform.parentExecutionId
- the parent task execution id.public TaskExecutionDao getTaskExecutionDao()
public void setMaxExitMessageSize(int maxExitMessageSize)
public void setMaxTaskNameSize(int maxTaskNameSize)
public void setMaxErrorMessageSize(int maxErrorMessageSize)
Copyright © 2021 Pivotal Software, Inc.. All rights reserved.