org.axonframework.eventstore.fs
Class FileSystemSnapshotEventReader

java.lang.Object
  extended by 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

Constructor Summary
FileSystemSnapshotEventReader(InputStream eventFile, InputStream snapshotEventFile, Serializer eventSerializer)
          Creates a snapshot event reader that reads the latest snapshot from the snapshotEventFile.
 
Method Summary
 DomainEventMessage readSnapshotEvent(String type, Object identifier)
          Reads the latest snapshot of the given aggregate identifier.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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 snapshot
snapshotEventFile - the file to read snapshots from
eventSerializer - the serializer that is used to deserialize events in snapshot file
Method Detail

readSnapshotEvent

public DomainEventMessage readSnapshotEvent(String type,
                                            Object identifier)
                                     throws IOException
Reads the latest snapshot of the given aggregate identifier.

Parameters:
type - the aggregate's type
identifier - 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.