Package com.gruelbox.transactionoutbox
Class TransactionOutboxEntry
java.lang.Object
com.gruelbox.transactionoutbox.TransactionOutboxEntry
Internal representation of a
TransactionOutbox
task. Generally only directly of interest
to implementers of SPIs such as Persistor
or Submitter
.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
TransactionOutboxEntry.TransactionOutboxEntryBuilder<C extends TransactionOutboxEntry,
B extends TransactionOutboxEntry.TransactionOutboxEntryBuilder<C, B>> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
protected boolean
boolean
int
getId()
getTopic()
int
int
hashCode()
boolean
boolean
void
setAttempts
(int attempts) void
setBlocked
(boolean blocked) void
setLastAttemptTime
(Instant lastAttemptTime) void
setNextAttemptTime
(Instant nextAttemptTime) void
setProcessed
(boolean processed) void
setSequence
(Long sequence) void
setVersion
(int version) toString()
void
validate
(com.gruelbox.transactionoutbox.Validator validator)
-
Constructor Details
-
TransactionOutboxEntry
-
-
Method Details
-
description
- Returns:
- A textual description of the task.
-
validate
public void validate(com.gruelbox.transactionoutbox.Validator validator) -
builder
-
toBuilder
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-
getId
- Returns:
- The id of the record. Usually a UUID.
-
getUniqueRequestId
-
getTopic
-
getSequence
-
setSequence
- Parameters:
sequence
- The ordered sequence within thetopic
.
-
getInvocation
- Returns:
- The method invocation to perform.
-
getLastAttemptTime
- Returns:
- The timestamp at which the task was last processed.
-
setLastAttemptTime
- Parameters:
lastAttemptTime
- The timestamp at which the task was last processed.
-
getNextAttemptTime
- Returns:
- The timestamp after which the task is available for re-attempting.
-
setNextAttemptTime
- 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.
-