Interface WorkClient
- All Known Implementing Classes:
WorkClientImpl
public interface WorkClient
Client interface containing methods for accessing YellowDog Scheduler functions.
-
Method Summary
Modifier and TypeMethodDescriptionaddTasksToTaskGroup
(TaskGroup taskGroup, List<Task> tasks) Submits NEW tasks to the YellowDog Scheduler service to be added to the specified task group.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.addTasksToTaskGroup
(String taskGroupId, List<Task> tasks) Submits NEW tasks to the YellowDog Scheduler service to be added to the specified task group.addWorkRequirement
(WorkRequirement workRequirement) Submits a NEW work requirement to the YellowDog Scheduler service to be initialised and started.void
addWorkRequirementListener
(WorkRequirement workRequirement, SubscriptionEventListener<WorkRequirement> listener) Adds an event listener to receive notifications of changes for the specified work requirement.void
addWorkRequirementListener
(String workRequirementId, SubscriptionEventListener<WorkRequirement> listener) Adds an event listener to receive notifications of changes for the specified work requirement.cancelTask
(Task task, boolean abort) Instructs the Scheduler to cancel the specified task.cancelTask
(String taskId, boolean abort) Instructs the Scheduler to cancel the specified task.cancelWorkRequirement
(WorkRequirement workRequirement) Instructs the Scheduler to cancel the supplied work requirement, no further tasks will be executed and all workers shall be released.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.cancelWorkRequirement
(String workRequirementId) Instructs the Scheduler to cancel the supplied work requirement, no further tasks will be executed and all workers shall be released.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.Deprecated, for removal: This API element is subject to removal in a future version.findTasks
(TaskSearch search) Deprecated, for removal: This API element is subject to removal in a future version.usegetTasks(TaskSearch)
instead to search tasks.findTasks
(TaskSearch search, SliceReference sliceReference) Deprecated, for removal: This API element is subject to removal in a future version.usegetTasks(TaskSearch)
instead to search tasks.Gets the latest state of the supplied task.Gets the latest state of the supplied task.getTasks
(TaskSearch search) Returns aSearchClient
that offers the ability to search tasks.getWorkRequirement
(WorkRequirement workRequirement) Gets the latest state of the supplied work requirement.getWorkRequirement
(String workRequirementId) Gets the latest state of the supplied work requirement.getWorkRequirement
(String namespace, String workRequirementName) Gets the latest state of the supplied work requirement.getWorkRequirementHelper
(WorkRequirement workRequirement) Constructs a new work requirement helper for the specified requirement.getWorkRequirementHelper
(String workRequirementId) Constructs a new work requirement helper for the specified requirement.Returns aSearchClient
that offers the ability to search work requirements.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.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.void
Removes the specified event listener.startWorkRequirement
(WorkRequirement workRequirement) Instructs the Scheduler to start the supplied work requirement after it was held.startWorkRequirement
(String workRequirementId) Instructs the Scheduler to start the supplied work requirement after it was held.streamTasks
(TaskSearch search) Deprecated, for removal: This API element is subject to removal in a future version.usegetTasks(TaskSearch)
instead to search tasks.updateWorkRequirement
(WorkRequirement workRequirement) Submits an existing work requirement to the YellowDog Scheduler service to be updated.
-
Method Details
-
addWorkRequirement
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
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
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
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
Gets the latest state of the supplied work requirement.- Parameters:
namespace
- the namespace containing the requirementworkRequirementName
- the name of the requirement- Returns:
- the latest state of the work requirement
-
holdWorkRequirement
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
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
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
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
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
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 cancelabort
- 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
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
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 cancelabort
- 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 notificationslistener
- 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 notificationslistener
- the event listener that will be invoked for notifications
-
removeWorkRequirementListener
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
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
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, for removal: This API element is subject to removal in a future version.usegetWorkRequirements(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 aSearchClient
that offers the ability to search work requirements.- Parameters:
search
- the search- Returns:
- the search client
-
addTasksToTaskGroup
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 totasks
- the submitted tasks- Returns:
- the latest state of the tasks after they have been submitted
-
addTasksToTaskGroup
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 totasks
- 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 namespaceworkRequirementName
- the work requirement nametaskGroupName
- the task group nametasks
- the submitted tasks- Returns:
- the latest state of the tasks after they have been submitted
-
getTask
-
getTask
-
cancelTask
-
cancelTask
Instructs the Scheduler to cancel the specified task.- Parameters:
taskId
- the ID of the task to cancelabort
- 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, for removal: This API element is subject to removal in a future version.usegetTasks(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 usingstreamTasks(TaskSearch)
orfindTasks(TaskSearch, SliceReference)
.- Parameters:
search
- the search- Returns:
- a list of tasks
-
streamTasks
Deprecated, for removal: This API element is subject to removal in a future version.usegetTasks(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.usegetTasks(TaskSearch)
instead to search tasks.Returns a slice of tasks that match the specified search and slice reference.- Parameters:
search
- the searchsliceReference
- the slice reference- Returns:
- a slice of tasks
-
getTasks
Returns aSearchClient
that offers the ability to search tasks.- Parameters:
search
- the search- Returns:
- the search client
-
getWorkRequirements(WorkRequirementSearch)
instead to search tasks.