|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.axonframework.eventstore.fs.FileSystemEventStore
public class FileSystemEventStore
Implementation of the EventStore
that serializes objects (by default using
XStream) and
writes them to files to disk. Each aggregate is represented by a single file.
EventFileResolver
to specify the directory where event files should be stored and written to.
Note that the resource supplied must point to a folder and should contain a trailing slash. See org.springframework.core.io.FileSystemResource#FileSystemResource(String)
.
Constructor Summary | |
---|---|
FileSystemEventStore(EventFileResolver eventFileResolver)
Basic initialization of the event store. |
|
FileSystemEventStore(Serializer serializer,
EventFileResolver eventFileResolver)
Initialize the FileSystemEventStore using the given serializer . |
Method Summary | |
---|---|
void |
appendEvents(String type,
DomainEventStream eventsToStore)
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 aggregateIdentifier)
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 |
---|
public FileSystemEventStore(EventFileResolver eventFileResolver)
XStreamSerializer
eventFileResolver
- The EventFileResolver providing access to event filespublic FileSystemEventStore(Serializer serializer, EventFileResolver eventFileResolver)
serializer
. The serializer must be capable of
serializing the payload and meta data of Event Messages.
Note: the SerializedType of Message Meta Data is not stored. Upon retrieval, it is set to the default value
(name = "org.axonframework.domain.MetaData", revision = null). See SerializedMetaData.isSerializedMetaData(org.axonframework.serializer.SerializedObject)
serializer
- The serializer capable of serializing (at least) DomainEventseventFileResolver
- The EventFileResolver providing access to event filesMethod Detail |
---|
public void appendEvents(String type, DomainEventStream eventsToStore)
stream
to the event store.
This implementation writes events to an event log on the file system. It uses a directory per type of aggregate,
containing 1 file per aggregate.
appendEvents
in interface EventStore
type
- The type descriptor of the object to storeeventsToStore
- The event stream containing the events to storepublic DomainEventStream readEvents(String type, Object aggregateIdentifier)
EventStore
readEvents
in interface EventStore
type
- The type descriptor of the object to retrieveaggregateIdentifier
- The unique aggregate identifier of the events to load
public void appendSnapshotEvent(String type, DomainEventMessage snapshotEvent) throws EventStoreException
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.
appendSnapshotEvent
in interface SnapshotEventStore
type
- The type of aggregate the event belongs tosnapshotEvent
- The event summarizing one or more domain events for a specific aggregate.
EventStoreException
- when an error occurs while reading or writing to the event logs.public void setUpcasterChain(UpcasterChain upcasterChain)
UpcasterAware
setUpcasterChain
in interface UpcasterAware
upcasterChain
- the upcaster chain providing the upcasting capabilities
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |