org.axonframework.eventstore.fs
Class FileSystemSnapshotEventReader
java.lang.Object
org.axonframework.eventstore.fs.FileSystemSnapshotEventReader
public class FileSystemSnapshotEventReader
- extends Object
Reads the latest snapshot event from a given snapshotEventFile
and
skips the correct number of bytes in the given eventFile
.
- Since:
- 2.0
- Author:
- Frank Versnel
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FileSystemSnapshotEventReader
public FileSystemSnapshotEventReader(InputStream eventFile,
InputStream snapshotEventFile,
Serializer eventSerializer)
- Creates a snapshot event reader that reads the latest snapshot from the
snapshotEventFile
.
- Parameters:
eventFile
- used to skip the number of bytes specified by the latest snapshotsnapshotEventFile
- the file to read snapshots fromeventSerializer
- the serializer that is used to deserialize events in snapshot file
readSnapshotEvent
public DomainEventMessage readSnapshotEvent(String type,
Object identifier)
throws IOException
- Reads the latest snapshot of the given aggregate identifier.
- Parameters:
type
- the aggregate's typeidentifier
- the aggregate's identifier
- Returns:
- The latest snapshot of the given aggregate identifier
- Throws:
IOException
- when reading the snapshotEventFile
or reading the eventFile
failed
Copyright © 2010-2016. All Rights Reserved.