Interface LongRunningTaskManagerInternal
-
- All Superinterfaces:
LongRunningTaskManager
- All Known Implementing Classes:
DefaultLongRunningTaskManager
@ParametersAreNonnullByDefault @ReturnValuesAreNonnullByDefault public interface LongRunningTaskManagerInternal extends LongRunningTaskManager
Internal version of theLongRunningTaskManagerinterface; see the package-info.java for rationale.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description PageResponse<LongTaskStatus>getAllTasks(@Nullable ConfluenceUser asUser, LimitedRequest request)Get all currently-tracked tasks that the specified user can see.intgetTaskCount()Return a count of the current queued and running tasks.LongRunningTaskIdqueueLongRunningTask(com.atlassian.core.task.longrunning.LongRunningTask task)Start tracking a long running task that should be started in a new thread whenstartIfQueued(com.atlassian.confluence.util.longrunning.LongRunningTaskId)is called.voidrunToCompletion(@Nullable com.atlassian.user.User user, com.atlassian.core.task.longrunning.LongRunningTask task)Starts aLongRunningTaskand waits for it to complete.voidstartIfQueued(LongRunningTaskId taskId)Starts the task in a new thread if it has previously been queued.-
Methods inherited from interface com.atlassian.confluence.util.longrunning.LongRunningTaskManager
getLongRunningTask, removeComplete, resume, startLongRunningTask, stop, stopTrackingLongRunningTask
-
-
-
-
Method Detail
-
queueLongRunningTask
LongRunningTaskId queueLongRunningTask(com.atlassian.core.task.longrunning.LongRunningTask task)
Start tracking a long running task that should be started in a new thread whenstartIfQueued(com.atlassian.confluence.util.longrunning.LongRunningTaskId)is called.- Parameters:
task- the task to perform- Returns:
- an ID that can be used to look up the task
-
startIfQueued
void startIfQueued(LongRunningTaskId taskId)
Starts the task in a new thread if it has previously been queued.- Parameters:
taskId- the ID of the task
-
getAllTasks
PageResponse<LongTaskStatus> getAllTasks(@Nullable ConfluenceUser asUser, LimitedRequest request)
Get all currently-tracked tasks that the specified user can see.
-
runToCompletion
void runToCompletion(@Nullable com.atlassian.user.User user, com.atlassian.core.task.longrunning.LongRunningTask task)Starts aLongRunningTaskand waits for it to complete.- Parameters:
user- the user responsible for the tasktask- the task to perform- Throws:
IllegalStateException- if the task manager has been shut down
-
getTaskCount
int getTaskCount()
Return a count of the current queued and running tasks. The count may include tasks that the current user is not allowed to see.
-
-