org.axonframework.gae.eventstore
Class GaeEventStore

java.lang.Object
  extended by org.axonframework.gae.eventstore.GaeEventStore
All Implemented Interfaces:
EventStore, SnapshotEventStore, UpcasterAware

public class GaeEventStore
extends Object
implements SnapshotEventStore, UpcasterAware

EventStore implementation that uses Google App Engine's DatastoreService to store Event Streams.

Since:
1.0
Author:
Jettro Coenradie

Constructor Summary
GaeEventStore()
          Constructs an instance using a GAE compatible instance of the XStreamSerializer.
GaeEventStore(Serializer eventSerializer)
          Constructs and instance using the given eventSerializer.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GaeEventStore

public GaeEventStore()
Constructs an instance using a GAE compatible instance of the XStreamSerializer.


GaeEventStore

public GaeEventStore(Serializer eventSerializer)
Constructs and instance using the given eventSerializer.

Parameters:
eventSerializer - The serializer to serialize payload and metadata of EventMessages with.
Method Detail

appendEvents

public void appendEvents(String type,
                         DomainEventStream events)
Description copied from interface: EventStore
Append the events in the given stream to the event store.

Specified by:
appendEvents in interface EventStore
Parameters:
type - The type descriptor of the object to store
events - The event stream containing the events to store

readEvents

public DomainEventStream readEvents(String type,
                                    Object identifier)
Description copied from interface: EventStore
Read the events of the aggregate identified by the given type and identifier that allow the current aggregate state to be rebuilt. Implementations may omit or replace events (e.g. by using snapshot events) from the stream for performance purposes.

Specified by:
readEvents in interface EventStore
Parameters:
type - The type descriptor of the object to retrieve
identifier - The unique aggregate identifier of the events to load
Returns:
an event stream containing the events of the aggregate

appendSnapshotEvent

public void appendSnapshotEvent(String type,
                                DomainEventMessage snapshotEvent)
Description copied from interface: SnapshotEventStore
Append the given snapshotEvent 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.

Specified by:
appendSnapshotEvent in interface SnapshotEventStore
Parameters:
type - The type of aggregate the event belongs to
snapshotEvent - The event summarizing one or more domain events for a specific aggregate.

setUpcasterChain

public void setUpcasterChain(UpcasterChain upcasterChain)
Description copied from interface: UpcasterAware
Sets the UpcasterChain which allow older revisions of serialized objects to be deserialized.

Specified by:
setUpcasterChain in interface UpcasterAware
Parameters:
upcasterChain - the upcaster chain providing the upcasting capabilities


Copyright © 2010-2016. All Rights Reserved.