Class WorkRequirement
java.lang.Object
co.yellowdog.platform.model.WorkRequirement
- All Implemented Interfaces:
Identified
,Named
,Tagged
,Serializable
@ValidatedBy(WorkRequirementValidator.class)
public class WorkRequirement
extends Object
implements Identified, Named, Tagged, Serializable
Defines the requirement for work to be done with specifications on how it should be executed.
This class is the main model object within the YellowDog Scheduler API. It is passed between the service and clients in order to request work to be done and to monitor the state of that work.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
A builder that can be used to build a new WorkRequirement that is automatically validated on build. -
Field Summary
FieldsFields inherited from interface co.yellowdog.platform.model.Tagged
MAX_TAG_LENGTH
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic WorkRequirement.Builder
builder()
protected boolean
boolean
The date and time when the work requirement was first submitted to YellowDog Scheduler.getId()
The ID of the work requirement that is generated by YellowDog Scheduler when the requirement is first submitted.getName()
The user allocated name used to uniquely identify the work requirement within its namespace.The user allocated namespace used to group work requirements and other objects together.double
The priority of the work requirement.The status of the work requirement.The date and time when the status last changedgetTag()
Gets the user defined tagThe task groups containing tasks to be executed.int
hashCode()
void
setCreatedTime
(Instant createdTime) The date and time when the work requirement was first submitted to YellowDog Scheduler.void
The ID of the work requirement that is generated by YellowDog Scheduler when the requirement is first submitted.void
The user allocated name used to uniquely identify the work requirement within its namespace.void
setNamespace
(String namespace) The user allocated namespace used to group work requirements and other objects together.void
setPriority
(double priority) The priority of the work requirement.void
setStatus
(WorkRequirementStatus status) The status of the work requirement.void
setStatusChangedTime
(Instant statusChangedTime) The date and time when the status last changedvoid
Sets the user defined tagvoid
setTaskGroups
(List<@NotNull @Valid TaskGroup> taskGroups) The task groups containing tasks to be executed.toString()
-
Field Details
-
TASK_GROUPS_MAX
public static final int TASK_GROUPS_MAX- See Also:
-
-
Constructor Details
-
WorkRequirement
public WorkRequirement(String namespace, String name, String tag, List<TaskGroup> taskGroups, Double priority) Constructs a new work requirement with the specified values.- Parameters:
namespace
- the work requirement namespacename
- the work requirement nametag
- the work requirement tagtaskGroups
- the work requirement task groupspriority
- the work requirement priority
-
-
Method Details
-
builder
-
toBuilder
-
getId
The ID of the work requirement that is generated by YellowDog Scheduler when the requirement is first submitted.- Specified by:
getId
in interfaceIdentified
- Returns:
- the ID of the work requirement
-
getTaskGroups
-
getCreatedTime
The date and time when the work requirement was first submitted to YellowDog Scheduler.- Returns:
- the date and time when the work requirement was first submitted
-
getTag
-
getNamespace
The user allocated namespace used to group work requirements and other objects together.- Returns:
- the work requirement namespace
-
getName
-
getStatus
The status of the work requirement.- Returns:
- the status of the work requirement
-
getStatusChangedTime
The date and time when the status last changed- Returns:
- the date and time when the status last changed
-
getPriority
public double getPriority()The priority of the work requirement.- Returns:
- the priority of the work requirement
-
setId
The ID of the work requirement that is generated by YellowDog Scheduler when the requirement is first submitted.- Parameters:
id
- This should not be set outside of the YellowDog Scheduler service.
-
setTaskGroups
-
setCreatedTime
The date and time when the work requirement was first submitted to YellowDog Scheduler.- Parameters:
createdTime
- This should not be set outside of the YellowDog Scheduler service.
-
setTag
-
setNamespace
The user allocated namespace used to group work requirements and other objects together.- Parameters:
namespace
- the work requirement namespace
This should not be changed once the requirement has been submitted to YellowDog Scheduler.
-
setName
The user allocated name used to uniquely identify the work requirement within its namespace.- Parameters:
name
- the work requirement name
This should not be changed once the requirement has been submitted to YellowDog Scheduler.
-
setStatus
The status of the work requirement.- Parameters:
status
- This should not be set outside of the YellowDog Scheduler service.
-
setStatusChangedTime
The date and time when the status last changed- Parameters:
statusChangedTime
- This should not be set outside of the YellowDog Compute service.
-
setPriority
public void setPriority(double priority) The priority of the work requirement.- Parameters:
priority
- the priority of the work requirement
-
equals
-
canEqual
-
hashCode
-
toString
-