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:
  • Field Details

  • 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 namespace
      name - the work requirement name
      tag - the work requirement tag
      taskGroups - the work requirement task groups
      priority - the work requirement priority
  • Method Details

    • builder

      public static WorkRequirement.Builder builder()
    • toBuilder

      public WorkRequirement.Builder toBuilder()
    • getId

      public String getId()
      The ID of the work requirement that is generated by YellowDog Scheduler when the requirement is first submitted.
      Specified by:
      getId in interface Identified
      Returns:
      the ID of the work requirement
    • getTaskGroups

      public List<@NotNull @Valid TaskGroup> getTaskGroups()
      The task groups containing tasks to be executed.
      Returns:
      the task groups containing tasks to be executed
    • getCreatedTime

      public Instant 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

      public String getTag()
      Description copied from interface: Tagged
      Gets the user defined tag
      Specified by:
      getTag in interface Tagged
      Returns:
      the user defined tag
    • getNamespace

      public String getNamespace()
      The user allocated namespace used to group work requirements and other objects together.
      Returns:
      the work requirement namespace
    • getName

      public String getName()
      The user allocated name used to uniquely identify the work requirement within its namespace.
      Specified by:
      getName in interface Named
      Returns:
      the work requirement name
    • getStatus

      public WorkRequirementStatus getStatus()
      The status of the work requirement.
      Returns:
      the status of the work requirement
    • getStatusChangedTime

      public Instant 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

      public void setId(String id)
      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

      public void setTaskGroups(List<@NotNull @Valid TaskGroup> taskGroups)
      The task groups containing tasks to be executed.
      Parameters:
      taskGroups - the task groups containing tasks to be executed
    • setCreatedTime

      public void setCreatedTime(Instant createdTime)
      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

      public void setTag(String tag)
      Description copied from interface: Tagged
      Sets the user defined tag
      Specified by:
      setTag in interface Tagged
      Parameters:
      tag - the user defined tag
    • setNamespace

      public void setNamespace(String namespace)
      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

      public void setName(String name)
      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

      public void setStatus(WorkRequirementStatus status)
      The status of the work requirement.
      Parameters:
      status - This should not be set outside of the YellowDog Scheduler service.
    • setStatusChangedTime

      public void setStatusChangedTime(Instant statusChangedTime)
      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

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object