Class TaskRecord


  • public final class TaskRecord
    extends java.lang.Object
    Raw database record with task parameters and payload
    Since:
    09.07.2017
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static TaskRecord.Builder builder()  
      boolean equals​(java.lang.Object obj)  
      long getAttemptsCount()
      Get number of attempts to execute the task, including the current one.
      java.time.ZonedDateTime getCreatedAt()
      Get date and time when the task was added into the queue.
      java.util.Map<java.lang.String,​java.lang.String> getExtData()
      Get the map of external user-defined parameters, where the key is the column name in the tasks table.
      long getId()
      Get unique (sequence id) identifier of the task.
      java.time.ZonedDateTime getNextProcessAt()
      Get date and time of the next task execution.
      java.lang.String getPayload()
      Get raw task payload.
      long getReenqueueAttemptsCount()
      Get number of attempts to postpone (re-enqueue) the task.
      long getTotalAttemptsCount()
      Get sum of all attempts to execute the task, including all task re-enqueue attempts and all failed attempts.
      int hashCode()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • getId

        public long getId()
        Get unique (sequence id) identifier of the task.
        Returns:
        task identifier
      • getPayload

        @Nullable
        public java.lang.String getPayload()
        Get raw task payload.
        Returns:
        task payload
      • getAttemptsCount

        public long getAttemptsCount()
        Get number of attempts to execute the task, including the current one.
        Returns:
        number of attempts to execute the task.
      • getReenqueueAttemptsCount

        public long getReenqueueAttemptsCount()
        Get number of attempts to postpone (re-enqueue) the task.
        Returns:
        number of attempts to postpone (re-enqueue) the task.
      • getTotalAttemptsCount

        public long getTotalAttemptsCount()
        Get sum of all attempts to execute the task, including all task re-enqueue attempts and all failed attempts.
        This counter should never be reset.
        Returns:
        sum of all attempts to execute the task
      • getCreatedAt

        @Nonnull
        public java.time.ZonedDateTime getCreatedAt()
        Get date and time when the task was added into the queue.
        Returns:
        date and time when the task was added into the queue.
      • getNextProcessAt

        @Nonnull
        public java.time.ZonedDateTime getNextProcessAt()
        Get date and time of the next task execution.
        Returns:
        Date and time of the next task execution.
      • getExtData

        @Nonnull
        public java.util.Map<java.lang.String,​java.lang.String> getExtData()
        Get the map of external user-defined parameters, where the key is the column name in the tasks table.
        Returns:
        map of external user-defined parameters, where the key is the column name in the tasks table.
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object