Class AsyncJobCallback

java.lang.Object
com.kingsrook.qqq.backend.core.actions.async.AsyncJobCallback
Direct Known Subclasses:
NonPersistedAsyncJobCallback

public class AsyncJobCallback extends Object
Argument passed to an AsyncJob when it runs, which can be used to communicate data back out of the job.
  • Constructor Details

    • AsyncJobCallback

      public AsyncJobCallback(UUID jobUUID, AsyncJobStatus asyncJobStatus)
  • Method Details

    • setAsyncJobStatus

      public void setAsyncJobStatus(AsyncJobStatus asyncJobStatus)
      Setter for asyncJobStatus
    • updateStatus

      public void updateStatus(String message)
      Update the message
    • updateStatus

      public void updateStatus(String message, int current, int total)
      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...