Interface WorkClient

All Known Implementing Classes:
WorkClientImpl

public interface WorkClient
Client interface containing methods for accessing YellowDog Scheduler functions.
  • Method Details

    • addWorkRequirement

      WorkRequirement addWorkRequirement(WorkRequirement workRequirement)
      Submits a NEW work requirement to the YellowDog Scheduler service to be initialised and started.
      Parameters:
      workRequirement - the work requirement to submit
      Returns:
      the latest state of the work requirement after it has been submitted
    • updateWorkRequirement

      WorkRequirement updateWorkRequirement(WorkRequirement workRequirement)
      Submits an existing work requirement to the YellowDog Scheduler service to be updated.
      Parameters:
      workRequirement - the work requirement to submit
      Returns:
      the latest state of the work requirement after it has been submitted
    • getWorkRequirement

      WorkRequirement getWorkRequirement(WorkRequirement workRequirement)
      Gets the latest state of the supplied work requirement.
      Parameters:
      workRequirement - the work requirement for which to get the latest state
      Returns:
      the latest state of the work requirement
    • getWorkRequirement

      WorkRequirement getWorkRequirement(String workRequirementId)
      Gets the latest state of the supplied work requirement.
      Parameters:
      workRequirementId - the ID of the work requirement
      Returns:
      the latest state of the work requirement
    • getWorkRequirement

      WorkRequirement getWorkRequirement(String namespace, String workRequirementName)
      Gets the latest state of the supplied work requirement.
      Parameters:
      namespace - the namespace containing the requirement
      workRequirementName - the name of the requirement
      Returns:
      the latest state of the work requirement
    • holdWorkRequirement

      WorkRequirement holdWorkRequirement(WorkRequirement workRequirement)
      Instructs the Scheduler to hold the supplied work requirement, no further tasks will be executed until the work requirement is started again.
      Parameters:
      workRequirement - the work requirement to hold
      Returns:
      the latest state of the work requirement after the hold instruction was submitted
    • holdWorkRequirement

      WorkRequirement holdWorkRequirement(String workRequirementId)
      Instructs the Scheduler to hold the supplied work requirement, no further tasks will be executed until the work requirement is started again.
      Parameters:
      workRequirementId - the ID of the work requirement to hold
      Returns:
      the latest state of the work requirement after the hold instruction was submitted
    • startWorkRequirement

      WorkRequirement startWorkRequirement(WorkRequirement workRequirement)
      Instructs the Scheduler to start the supplied work requirement after it was held.
      Parameters:
      workRequirement - the work requirement to start after being held
      Returns:
      the latest state of the work requirement after the start instruction was submitted
    • startWorkRequirement

      WorkRequirement startWorkRequirement(String workRequirementId)
      Instructs the Scheduler to start the supplied work requirement after it was held.
      Parameters:
      workRequirementId - the ID of the work requirement to start after being held
      Returns:
      the latest state of the work requirement after the start instruction was submitted
    • cancelWorkRequirement

      WorkRequirement cancelWorkRequirement(WorkRequirement workRequirement)
      Instructs the Scheduler to cancel the supplied work requirement, no further tasks will be executed and all workers shall be released.
      Parameters:
      workRequirement - the work requirement to cancel
      Returns:
      the latest state of the work requirement after the cancel instruction was submitted
    • cancelWorkRequirement

      WorkRequirement cancelWorkRequirement(WorkRequirement workRequirement, boolean abort)
      Instructs the Scheduler to cancel the supplied work requirement, no further tasks will be executed and all workers shall be released.
      Parameters:
      workRequirement - the work requirement to cancel
      abort - if tasks should be aborted if they have been allocated to a worker
      Returns:
      the latest state of the work requirement after the cancel instruction was submitted
    • cancelWorkRequirement

      WorkRequirement cancelWorkRequirement(String workRequirementId)
      Instructs the Scheduler to cancel the supplied work requirement, no further tasks will be executed and all workers shall be released.
      Parameters:
      workRequirementId - the ID of the work requirement to cancel
      Returns:
      the latest state of the work requirement after the cancel instruction was submitted
    • cancelWorkRequirement

      WorkRequirement cancelWorkRequirement(String workRequirementId, boolean abort)
      Instructs the Scheduler to cancel the supplied work requirement, no further tasks will be executed and all workers shall be released.
      Parameters:
      workRequirementId - the ID of the work requirement to cancel
      abort - if tasks should be aborted if they have been allocated to a worker
      Returns:
      the latest state of the work requirement after the cancel instruction was submitted
    • addWorkRequirementListener

      void addWorkRequirementListener(WorkRequirement workRequirement, SubscriptionEventListener<WorkRequirement> listener)
      Adds an event listener to receive notifications of changes for the specified work requirement. The client manages subscriptions to YellowDog Scheduler such that the first listener created for a requirement will cause a Server-Sent Events subscription to be initiated; additional listeners for the same requirement share that subscription.
      Parameters:
      workRequirement - the work requirement for which to receive notifications
      listener - the event listener that will be invoked for notifications
    • addWorkRequirementListener

      void addWorkRequirementListener(String workRequirementId, SubscriptionEventListener<WorkRequirement> listener)
      Adds an event listener to receive notifications of changes for the specified work requirement. The client manages subscriptions to YellowDog Scheduler such that the first listener created for a requirement will cause a Server-Sent Events subscription to be initiated; additional listeners for the same requirement share that subscription.
      Parameters:
      workRequirementId - the ID of the work requirement for which to receive notifications
      listener - the event listener that will be invoked for notifications
    • removeWorkRequirementListener

      void removeWorkRequirementListener(SubscriptionEventListener<WorkRequirement> listener)
      Removes the specified event listener. The client manages subscriptions to YellowDog Scheduler such that when the last listener for a requirement is removed, the associated Server-Sent Events subscription is cancelled.
      Parameters:
      listener - the event listener that will no longer be invoked for notifications
    • getWorkRequirementHelper

      WorkRequirementHelper getWorkRequirementHelper(WorkRequirement workRequirement)
      Constructs a new work requirement helper for the specified requirement.
      Parameters:
      workRequirement - the work requirement for which the helper will be constructed
      Returns:
      a new work requirement helper
    • getWorkRequirementHelper

      WorkRequirementHelper getWorkRequirementHelper(String workRequirementId)
      Constructs a new work requirement helper for the specified requirement.
      Parameters:
      workRequirementId - the ID of the work requirement for which the helper will be constructed
      Returns:
      a new work requirement helper
    • findAllWorkRequirements

      @Deprecated(since="8.9.27", forRemoval=true) List<WorkRequirementSummary> findAllWorkRequirements()
      Deprecated, for removal: This API element is subject to removal in a future version.
      use getWorkRequirements(WorkRequirementSearch) instead to search tasks.
      Returns summaries of all existing work requirements within the system for the requesting user.
      Returns:
      a list of work requirement summaries
    • getWorkRequirements

      Returns a SearchClient that offers the ability to search work requirements.
      Parameters:
      search - the search
      Returns:
      the search client
    • addTasksToTaskGroup

      List<Task> addTasksToTaskGroup(TaskGroup taskGroup, List<Task> tasks)
      Submits NEW tasks to the YellowDog Scheduler service to be added to the specified task group.
      Parameters:
      taskGroup - the task group to add the tasks to
      tasks - the submitted tasks
      Returns:
      the latest state of the tasks after they have been submitted
    • addTasksToTaskGroup

      List<Task> addTasksToTaskGroup(String taskGroupId, List<Task> tasks)
      Submits NEW tasks to the YellowDog Scheduler service to be added to the specified task group.
      Parameters:
      taskGroupId - the ID of the task group to add the tasks to
      tasks - the submitted tasks
      Returns:
      the latest state of the tasks after they have been submitted
    • addTasksToTaskGroup

      List<Task> addTasksToTaskGroup(String namespace, String workRequirementName, String taskGroupName, List<Task> tasks)
      Submits NEW tasks to the YellowDog Scheduler service to be added to the specified task group.
      Parameters:
      namespace - the namespace
      workRequirementName - the work requirement name
      taskGroupName - the task group name
      tasks - the submitted tasks
      Returns:
      the latest state of the tasks after they have been submitted
    • getTask

      Task getTask(Task task)
      Gets the latest state of the supplied task.
      Parameters:
      task - the task for which to get the latest state
      Returns:
      the latest state of the task
    • getTask

      Task getTask(String taskId)
      Gets the latest state of the supplied task.
      Parameters:
      taskId - the ID of the task
      Returns:
      the latest state of the task
    • cancelTask

      Task cancelTask(Task task, boolean abort)
      Instructs the Scheduler to cancel the specified task.
      Parameters:
      task - the task to cancel
      abort - if the task should be aborted if it has been allocated to a worker
      Returns:
      the latest state of the task after the cancel instruction was submitted
    • cancelTask

      Task cancelTask(String taskId, boolean abort)
      Instructs the Scheduler to cancel the specified task.
      Parameters:
      taskId - the ID of the task to cancel
      abort - if the task should be aborted if it has been allocated to a worker
      Returns:
      the latest state of the task after the cancel instruction was submitted
    • findTasks

      @Deprecated(since="6.0.1", forRemoval=true) List<Task> findTasks(TaskSearch search)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use getTasks(TaskSearch) instead to search tasks.
      Returns tasks within the system that match the specified search. WARNING: If your search matches too many tasks to fit into your application's memory limits, consider using streamTasks(TaskSearch) or findTasks(TaskSearch, SliceReference).
      Parameters:
      search - the search
      Returns:
      a list of tasks
    • streamTasks

      @Deprecated(since="6.0.1", forRemoval=true) Stream<Task> streamTasks(TaskSearch search)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use getTasks(TaskSearch) instead to search tasks.
      Streams tasks within the system that match the specified search.
      Parameters:
      search - the search
      Returns:
      a stream of tasks
    • findTasks

      @Deprecated(since="6.0.1", forRemoval=true) Slice<Task> findTasks(TaskSearch search, SliceReference sliceReference)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use getTasks(TaskSearch) instead to search tasks.
      Returns a slice of tasks that match the specified search and slice reference.
      Parameters:
      search - the search
      sliceReference - the slice reference
      Returns:
      a slice of tasks
    • getTasks

      SearchClient<Task> getTasks(TaskSearch search)
      Returns a SearchClient that offers the ability to search tasks.
      Parameters:
      search - the search
      Returns:
      the search client