|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
I
- The type of the identifier of this aggregatepublic interface AggregateRoot<I>
Interface defining a contract for entities that represent the aggregate root.
AbstractAggregateRoot
Method Summary | |
---|---|
void |
addEventRegistrationCallback(EventRegistrationCallback eventRegistrationCallback)
Adds an EventRegistrationCallback, which is notified when the aggregate registers an Event for publication. |
void |
commitEvents()
Clears the events currently marked as "uncommitted" and clears any known EventRegistrationCallbacks (see addEventRegistrationCallback(EventRegistrationCallback) ). |
I |
getIdentifier()
Returns the identifier of this aggregate. |
int |
getUncommittedEventCount()
Returns the number of uncommitted events currently available in the aggregate. |
DomainEventStream |
getUncommittedEvents()
Returns a DomainEventStream to the events in the aggregate that have been raised since creation or the last commit. |
Long |
getVersion()
Returns the current version number of the aggregate, or null if the aggregate is newly created. |
boolean |
isDeleted()
Indicates whether this aggregate has been marked as deleted. |
Method Detail |
---|
I getIdentifier()
void commitEvents()
addEventRegistrationCallback(EventRegistrationCallback)
).
EventContainer.commit()
int getUncommittedEventCount()
DomainEventStream getUncommittedEvents()
Long getVersion()
null
if the aggregate is newly created.
This
version must reflect the version number of the aggregate on which changes are applied.
Each time the aggregate is modified and stored in a repository, the version number must be increased by
at least 1. This version number can be used by optimistic locking strategies and detection of conflicting
concurrent modification.
Typically the sequence number of the last committed event on this aggregate is used as version number.
null
if no events were ever committedboolean isDeleted()
true
, it is an instruction to the
repository to remove this instance at an appropriate time.
Repositories should not return any instances of Aggregates that return true
on
isDeleted()
.
true
if this aggregate was marked as deleted, otherwise false
.void addEventRegistrationCallback(EventRegistrationCallback eventRegistrationCallback)
eventRegistrationCallback
for processing.
eventRegistrationCallback
- the callback to notify when an event is registered
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |