Class AsyncJobManager
java.lang.Object
com.kingsrook.qqq.backend.core.actions.async.AsyncJobManager
Class to manage running asynchronous actions, and working with their statuses.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidGetter for forcedJobUUIDgetJobStatus(String uuid) Get the status of the job identified by the given UUID.getJobStatusForUser(String uuid, String processName, String processUUID) Check ownership even while the process has not produced any state yet.voidsetForcedJobUUID(String forcedJobUUID) Setter for forcedJobUUID<T extends Serializable>
TStart a job - if it finishes within the specified timeout, get its results, else, get back an exception with the job id.<T extends Serializable>
StringStart a job, and always, just get back the job UUID.<T extends Serializable>
TStart a job - if it finishes within the specified timeout, get its results, else, get back an exception with the job id.<T extends Serializable>
StringStart a job, and always, just get back the job UUID.withForcedJobUUID(String forcedJobUUID) Fluent setter for forcedJobUUIDwithProcessUUID(String processUUID) Bind a user-facing job to the process whose state it produces.
-
Constructor Details
-
AsyncJobManager
public AsyncJobManager()
-
-
Method Details
-
startJob
public <T extends Serializable> T startJob(long timeout, TimeUnit timeUnit, AsyncJob<T> asyncJob) throws JobGoingAsyncException, QException Start a job - if it finishes within the specified timeout, get its results, else, get back an exception with the job id.- Throws:
JobGoingAsyncExceptionQException
-
startJob
public <T extends Serializable> T startJob(String jobName, long timeout, TimeUnit timeUnit, AsyncJob<T> asyncJob) throws JobGoingAsyncException, QException Start a job - if it finishes within the specified timeout, get its results, else, get back an exception with the job id.- Throws:
JobGoingAsyncExceptionQException
-
startJob
Start a job, and always, just get back the job UUID.- Throws:
QException
-
startJob
public <T extends Serializable> String startJob(String jobName, AsyncJob<T> asyncJob) throws QException Start a job, and always, just get back the job UUID.- Throws:
QException
-
getJobStatus
Get the status of the job identified by the given UUID. -
withProcessUUID
Bind a user-facing job to the process whose state it produces. -
getJobStatusForUser
public Optional<AsyncJobStatus> getJobStatusForUser(String uuid, String processName, String processUUID) throws QException Check ownership even while the process has not produced any state yet.- Throws:
QException
-
cancelJob
-
getForcedJobUUID
Getter for forcedJobUUID -
setForcedJobUUID
Setter for forcedJobUUID -
withForcedJobUUID
Fluent setter for forcedJobUUID
-