org.axonframework.eventstore.fs
Class FileSystemSnapshotEventWriter

java.lang.Object
  extended by org.axonframework.eventstore.fs.FileSystemSnapshotEventWriter

public class FileSystemSnapshotEventWriter
extends Object

Writes snapshot events to the given snapshotEventFile.

Since:
2.0
Author:
Frank Versnel

Constructor Summary
FileSystemSnapshotEventWriter(InputStream eventFile, OutputStream snapshotEventFile, Serializer eventSerializer)
          Creates a snapshot event writer that writes any given snapshotEvent to the given snapshotEventFile.
 
Method Summary
 void writeSnapshotEvent(DomainEventMessage snapshotEvent)
          Writes the given snapshotEvent to the snapshotEventFile.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileSystemSnapshotEventWriter

public FileSystemSnapshotEventWriter(InputStream eventFile,
                                     OutputStream snapshotEventFile,
                                     Serializer eventSerializer)
Creates a snapshot event writer that writes any given snapshotEvent to the given snapshotEventFile.

Parameters:
eventFile - used to determine the number of bytes to skip upon reading a snapshot when using FileSystemSnapshotEventReader.readSnapshotEvent(String, Object)
snapshotEventFile - the snapshot file to write to
eventSerializer - the serializer used to serialize snapshot events
Method Detail

writeSnapshotEvent

public void writeSnapshotEvent(DomainEventMessage snapshotEvent)
Writes the given snapshotEvent to the snapshotEventFile. Prepends a long value to the event in the file indicating the bytes to skip when reading the eventFile.

Parameters:
snapshotEvent - The snapshot to write to the snapshotEventFile


Copyright © 2010-2016. All Rights Reserved.