Class AsyncJobCallback
java.lang.Object
com.kingsrook.qqq.backend.core.actions.async.AsyncJobCallback
- Direct Known Subclasses:
NonPersistedAsyncJobCallback
Argument passed to an AsyncJob when it runs, which can be used to communicate
data back out of the job.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Remove the values from the current invalid input: '&' total fieldsvoid
Increase the 'current' value in the '1 of 2' sense.void
incrementCurrent
(int amount) Increase the 'current' value in the '1 of 2' sense.void
setAsyncJobStatus
(AsyncJobStatus asyncJobStatus) Setter for asyncJobStatusprotected void
void
updateStatus
(int current, int total) Update the current and total fields (e.g., 1 of 2, 2 of 2, 3 of 2)void
updateStatus
(String message) Update the messagevoid
updateStatus
(String message, int current, int total) Update all 3 status fieldsvoid
updateStatusOnlyUpwards
(int current, int total) Update the current and total fields, but ONLY if the new values are both >= the previous values.boolean
Check if the asyncJobStatus had a cancellation requested.
-
Constructor Details
-
AsyncJobCallback
-
-
Method Details
-
setAsyncJobStatus
Setter for asyncJobStatus -
updateStatus
Update the message -
updateStatus
Update all 3 status fields -
updateStatus
public void updateStatus(int current, int total) Update the current and total fields (e.g., 1 of 2, 2 of 2, 3 of 2) -
updateStatusOnlyUpwards
public void updateStatusOnlyUpwards(int current, int total) Update the current and total fields, but ONLY if the new values are both >= the previous values. -
incrementCurrent
public void incrementCurrent()Increase the 'current' value in the '1 of 2' sense. -
incrementCurrent
public void incrementCurrent(int amount) Increase the 'current' value in the '1 of 2' sense. -
clearCurrentAndTotal
public void clearCurrentAndTotal()Remove the values from the current invalid input: '&' total fields -
storeUpdatedStatus
protected void storeUpdatedStatus() -
wasCancelRequested
public boolean wasCancelRequested()Check if the asyncJobStatus had a cancellation requested. TODO - concern about multiple threads writing this object to a non-in-memory state provider, and this value getting lost...
-