Record Class EmptyAppendTransaction
java.lang.Object
java.lang.Record
org.axonframework.eventsourcing.eventstore.EmptyAppendTransaction
- All Implemented Interfaces:
EventStorageEngine.AppendTransaction<Void>
public record EmptyAppendTransaction()
extends Record
implements EventStorageEngine.AppendTransaction<Void>
Represents an empty append transaction. This transaction does nothing and always succeeds. It is used when there are
no events to persist.
- Since:
- 5.0.0
- Author:
- Mateusz Nowak
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final EventStorageEngine.AppendTransaction<Void> The single instance of theEmptyAppendTransaction. -
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of aEmptyAppendTransactionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionafterCommit(Void commitResult) Always provides the consistency markerConsistencyMarker.ORIGIN.commit()Commit any underlying transactions to make the appended events visible to consumers.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.voidrollback()Rolls back any events that have been appended, permanently making them unavailable for consumers.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
INSTANCE
The single instance of theEmptyAppendTransaction.
-
-
Constructor Details
-
EmptyAppendTransaction
public EmptyAppendTransaction()Creates an instance of aEmptyAppendTransactionrecord class.
-
-
Method Details
-
commit
Description copied from interface:EventStorageEngine.AppendTransactionCommit any underlying transactions to make the appended events visible to consumers.Called during the
COMMITphase.- Specified by:
commitin interfaceEventStorageEngine.AppendTransaction<Void>- Returns:
- A
CompletableFutureto complete the commit asynchrously, returning a value for.invalid reference
afterCommit
-
rollback
public void rollback()Description copied from interface:EventStorageEngine.AppendTransactionRolls back any events that have been appended, permanently making them unavailable for consumers.- Specified by:
rollbackin interfaceEventStorageEngine.AppendTransaction<Void>
-
afterCommit
Always provides the consistency markerConsistencyMarker.ORIGIN.- Specified by:
afterCommitin interfaceEventStorageEngine.AppendTransaction<Void>- Parameters:
commitResult- The result returned from the commit call.context- The currentProcessingContext, if any.- Returns:
- An empty always a completed future with the consistency marker
ConsistencyMarker.ORIGIN.
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal.
-