Class TransactionOutboxEntry

java.lang.Object
com.gruelbox.transactionoutbox.TransactionOutboxEntry

public class TransactionOutboxEntry extends Object
Internal representation of a TransactionOutbox task. Generally only directly of interest to implementers of SPIs such as Persistor or Submitter.
  • Constructor Details

  • Method Details

    • description

      public String description()
      Returns:
      A textual description of the task.
    • validate

      public void validate(com.gruelbox.transactionoutbox.Validator validator)
    • builder

    • toBuilder

    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

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

      public String toString()
      Overrides:
      toString in class Object
    • getId

      public String getId()
      Returns:
      The id of the record. Usually a UUID.
    • getUniqueRequestId

      public String getUniqueRequestId()
    • getTopic

      public String getTopic()
    • getSequence

      public Long getSequence()
    • setSequence

      public void setSequence(Long sequence)
      Parameters:
      sequence - The ordered sequence within the topic.
    • getInvocation

      public Invocation getInvocation()
      Returns:
      The method invocation to perform.
    • getLastAttemptTime

      public Instant getLastAttemptTime()
      Returns:
      The timestamp at which the task was last processed.
    • setLastAttemptTime

      public void setLastAttemptTime(Instant lastAttemptTime)
      Parameters:
      lastAttemptTime - The timestamp at which the task was last processed.
    • getNextAttemptTime

      public Instant getNextAttemptTime()
      Returns:
      The timestamp after which the task is available for re-attempting.
    • setNextAttemptTime

      public void setNextAttemptTime(Instant nextAttemptTime)
      Parameters:
      nextAttemptTime - The timestamp after which the task is available for re-attempting.
    • getAttempts

      public int getAttempts()
      Returns:
      The number of unsuccessful attempts so far made to run the task.
    • setAttempts

      public void setAttempts(int attempts)
      Parameters:
      attempts - The number of unsuccessful attempts so far made to run the task.
    • isBlocked

      public boolean isBlocked()
      Returns:
      True if the task has exceeded the configured maximum number of attempts.
    • setBlocked

      public void setBlocked(boolean blocked)
      Parameters:
      blocked - True if the task has exceeded the configured maximum number of attempts.
    • isProcessed

      public boolean isProcessed()
      Returns:
      True if the task has been processed but has been retained to prevent * duplicate requests.
    • setProcessed

      public void setProcessed(boolean processed)
      Parameters:
      processed - True if the task has been processed but has been retained to prevent duplicate requests.
    • getVersion

      public int getVersion()
      Returns:
      The optimistic locking version. Monotonically increasing with each update.
    • setVersion

      public void setVersion(int version)
      Parameters:
      version - The optimistic locking version. Monotonically increasing with each update.