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 TypeMethodDescriptionvoidRemove the values from the current invalid input: '&' total fieldsvoidIncrease the 'current' value in the '1 of 2' sense.voidincrementCurrent(int amount) Increase the 'current' value in the '1 of 2' sense.voidsetAsyncJobStatus(AsyncJobStatus asyncJobStatus) Setter for asyncJobStatusprotected voidvoidupdateStatus(int current, int total) Update the current and total fields (e.g., 1 of 2, 2 of 2, 3 of 2)voidupdateStatus(String message) Update the messagevoidupdateStatus(String message, int current, int total) Update all 3 status fieldsvoidupdateStatusOnlyUpwards(int current, int total) Update the current and total fields, but ONLY if the new values are both >= the previous values.booleanCheck 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...
-