Class JobImpl

  • All Implemented Interfaces:
    Job

    public class JobImpl
    extends java.lang.Object
    implements Job
    • Field Detail

      • expiry

        public final java.time.Duration expiry
    • Method Detail

      • getId

        public java.lang.String getId()
        Description copied from interface: Job
        Get job id corresponding to a message
        Specified by:
        getId in interface Job
        Returns:
        string job id
      • getMessageId

        public java.lang.String getMessageId()
        Description copied from interface: Job
        Get message id corresponding to this job
        Specified by:
        getMessageId in interface Job
        Returns:
        message id
      • getRqueueMessage

        public RqueueMessage getRqueueMessage()
        Description copied from interface: Job
        RqueueMessage that's consumed by this job
        Specified by:
        getRqueueMessage in interface Job
        Returns:
        an object of RqueueMessage
      • checkIn

        public void checkIn​(java.io.Serializable message)
        Description copied from interface: Job
        Checkin allows you to display a message for long running tasks, so that you can see the progress.

        The checking message could be anything given message's JSON serializable/deserializable. The message could be the current status of the job or anything else.

        NOTE: Checkin is not allowed for periodic job

        Specified by:
        checkIn in interface Job
        Parameters:
        message - a serializable message
      • getMessage

        public java.lang.Object getMessage()
        Description copied from interface: Job
        A message that was enqueued
        Specified by:
        getMessage in interface Job
        Returns:
        an object could be null if deserialization fail.
      • getMessageMetadata

        public MessageMetadata getMessageMetadata()
        Description copied from interface: Job
        MessageMetadata corresponding the enqueued message
        Specified by:
        getMessageMetadata in interface Job
        Returns:
        message metadata object
      • getStatus

        public JobStatus getStatus()
        Description copied from interface: Job
        The current status of this job, the message can have different status.
        Specified by:
        getStatus in interface Job
        Returns:
        job status
        See Also:
        MessageMetadata
      • getException

        public java.lang.Throwable getException()
        Description copied from interface: Job
        Any error detail, if it fails during execution
        Specified by:
        getException in interface Job
        Returns:
        an error object
      • getExecutionTime

        public long getExecutionTime()
        Description copied from interface: Job
        Total execution time of the fetched RqueueMessages
        Specified by:
        getExecutionTime in interface Job
        Returns:
        total execution time, that's sum of all listener method calls.
      • getQueueDetail

        public QueueDetail getQueueDetail()
        Description copied from interface: Job
        Queue detail on which this job was executing
        Specified by:
        getQueueDetail in interface Job
        Returns:
        queue detail object
      • setContext

        public void setContext​(Context context)
        Specified by:
        setContext in interface Job
      • release

        public void release​(JobStatus jobStatus,
                            java.io.Serializable why,
                            java.time.Duration duration)
        Specified by:
        release in interface Job
      • release

        public void release​(JobStatus jobStatus,
                            java.io.Serializable why)
        Specified by:
        release in interface Job
      • delete

        public void delete​(JobStatus status,
                           java.io.Serializable why)
        Specified by:
        delete in interface Job
      • isDeleted

        public boolean isDeleted()
        Specified by:
        isDeleted in interface Job
      • isReleased

        public boolean isReleased()
        Specified by:
        isReleased in interface Job
      • isDiscarded

        public boolean isDiscarded()
        Specified by:
        isDiscarded in interface Job
      • getFailureCount

        public int getFailureCount()
        Specified by:
        getFailureCount in interface Job