public class GaeEventStore extends Object implements SnapshotEventStore, UpcasterAware
| Constructor and Description |
|---|
GaeEventStore()
Constructs an instance using a GAE compatible instance of the XStreamSerializer.
|
GaeEventStore(Serializer eventSerializer)
Constructs and instance using the given
eventSerializer. |
| Modifier and Type | Method and Description |
|---|---|
void |
appendEvents(String type,
DomainEventStream events)
Append the events in the given
stream to the event store. |
void |
appendSnapshotEvent(String type,
DomainEventMessage snapshotEvent)
Append the given
snapshotEvent to the snapshot event log for the given type type. |
DomainEventStream |
readEvents(String type,
Object identifier)
Read the events of the aggregate identified by the given type and identifier that allow the current aggregate
state to be rebuilt.
|
void |
setUpcasterChain(UpcasterChain upcasterChain)
Sets the UpcasterChain which allow older revisions of serialized objects to be deserialized.
|
public GaeEventStore()
public GaeEventStore(Serializer eventSerializer)
eventSerializer.eventSerializer - The serializer to serialize payload and metadata of EventMessages with.public void appendEvents(String type, DomainEventStream events)
EventStorestream to the event store.appendEvents in interface EventStoretype - The type descriptor of the object to storeevents - The event stream containing the events to storepublic DomainEventStream readEvents(String type, Object identifier)
EventStorereadEvents in interface EventStoretype - The type descriptor of the object to retrieveidentifier - The unique aggregate identifier of the events to loadpublic void appendSnapshotEvent(String type, DomainEventMessage snapshotEvent)
SnapshotEventStoresnapshotEvent to the snapshot event log for the given type type. The
sequence number of the snapshotEvent must be equal to the sequence number of the last regular
domain
event that is included in the snapshot.
Implementations may choose to prune snapshots upon appending a new snapshot, in order to minimize storage space.appendSnapshotEvent in interface SnapshotEventStoretype - The type of aggregate the event belongs tosnapshotEvent - The event summarizing one or more domain events for a specific aggregate.public void setUpcasterChain(UpcasterChain upcasterChain)
UpcasterAwaresetUpcasterChain in interface UpcasterAwareupcasterChain - the upcaster chain providing the upcasting capabilitiesCopyright © 2010-2014. All Rights Reserved.