public interface EventFileResolver
The streams provided by these methods should be closed by the caller when it has finished using them.
Modifier and Type | Method and Description |
---|---|
boolean |
eventFileExists(String type,
Object aggregateIdentifier)
Indicates whether there is a file containing (regular) events for the given
aggregateIdentifier of
given type . |
InputStream |
openEventFileForReading(String type,
Object aggregateIdentifier)
Provides an input stream to the (regular) events file for the aggregate with the given
aggregateIdentifier and of given type . |
OutputStream |
openEventFileForWriting(String type,
Object aggregateIdentifier)
Provides an output stream to the (regular) events file for the aggregate with the given
aggregateIdentifier and of given type . |
InputStream |
openSnapshotFileForReading(String type,
Object aggregateIdentifier)
Provides an input stream to the snapshot events file for the aggregate with the given
aggregateIdentifier and of given type . |
OutputStream |
openSnapshotFileForWriting(String type,
Object aggregateIdentifier)
Provides an output stream to the snapshot events file for the aggregate with the given
aggregateIdentifier and of given type . |
boolean |
snapshotFileExists(String type,
Object aggregateIdentifier)
Indicates whether there is a file containing snapshot events for the given
aggregateIdentifier of
given type . |
OutputStream openEventFileForWriting(String type, Object aggregateIdentifier) throws IOException
aggregateIdentifier
and of given type
. Written bytes are appended to already existing
information.
The caller of this method is responsible for closing the output stream when all data has been written to it.
type
- The type of aggregate to open the stream foraggregateIdentifier
- the identifier of the aggregateIOException
- when an error occurs while opening a fileOutputStream openSnapshotFileForWriting(String type, Object aggregateIdentifier) throws IOException
aggregateIdentifier
and of given type
. Written bytes are appended to already existing
information.
The caller of this method is responsible for closing the output stream when all data has been written to it.
type
- The type of aggregate to open the stream foraggregateIdentifier
- the identifier of the aggregateIOException
- when an error occurs while opening a fileInputStream openEventFileForReading(String type, Object aggregateIdentifier) throws IOException
aggregateIdentifier
and of given type
.
The caller of this method is responsible for closing the input stream when done reading from it.
type
- The type of aggregate to open the stream foraggregateIdentifier
- the identifier of the aggregateIOException
- when an error occurs while opening a fileInputStream openSnapshotFileForReading(String type, Object aggregateIdentifier) throws IOException
aggregateIdentifier
and of given type
.
The caller of this method is responsible for closing the input stream when done reading from it.
type
- The type of aggregate to open the stream foraggregateIdentifier
- the identifier of the aggregateIOException
- when an error occurs while opening a fileboolean eventFileExists(String type, Object aggregateIdentifier) throws IOException
aggregateIdentifier
of
given type
.type
- The type of aggregateaggregateIdentifier
- the identifier of the aggregatetrue
if an event log exists for the aggregate, false
otherwise.IOException
- when an error occurs while reading from the FileSystem. The existence of the event file is
undetermined.boolean snapshotFileExists(String type, Object aggregateIdentifier) throws IOException
aggregateIdentifier
of
given type
.type
- The type of aggregateaggregateIdentifier
- the identifier of the aggregatetrue
if a snapshot event log exists for the aggregate, false
otherwise.IOException
- when an error occurs while reading from the FileSystem. The existence of the event file is
undetermined.Copyright © 2010-2014. All Rights Reserved.