Skip to content
This repository has been archived by the owner on May 26, 2020. It is now read-only.

Commit

Permalink
fix api
Browse files Browse the repository at this point in the history
  • Loading branch information
MohamedFarouk-HMCTS committed Mar 16, 2018
1 parent 063b8b4 commit 0bd9755
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,44 @@
/**
* Source of event streams.
*/
public interface EventSource {
public interface EventSource {

/**
* Get a stream of events by stream id.
*
* @param streamId - the stream id of the stream to be retrieved
* @param streamId the id of the stream to be retrieved
* @return the {@link EventStream}
*/
EventStream getStreamById(final UUID streamId);

/**
* Get a stream of event streams.
*
* @return a stream of {@link EventStream}s
*/
Stream<EventStream> getStreams();

/**
* Get a streams Of eventStreams.
* Get a stream of event streams.
*
* @return the {@link EventStream}
* @param position the position in the stream of streams to start from
* @return a stream of {@link EventStream}s
*/
Stream<EventStream> getEventStreamsBySequence(final long sequenceNumber);
Stream<EventStream> getStreamsFrom(final long position);

/**
* Clones the stream into a new stream id.
*
* @param streamId - the stream id of the stream to be cloned
* @return the StreamId of the cloned stream.
* @param streamId the stream id of the stream to be cloned
* @return the id of the cloned stream
* @throws EventStreamException if the cloning of the stream fails
*/
UUID cloneStream(final UUID streamId) throws EventStreamException;

/**
* Clears all of the events from a stream id.
*
* @param streamId - the streamId of the stream to be cleared
* @param streamId the id of the stream to be cleared
*/
void clearStream(final UUID streamId) throws EventStreamException;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,32 @@ public interface EventStream {

/**
* Get the current (current maximum) sequence id (version number) for a stream
*
* @deprecated use {@link #size()} instead
* @return the latest sequence id for the provided steam. 0 when stream is empty.
*/
@Deprecated
long getCurrentVersion();

/**
* Get the size of the event stream.
*
* Can be used to determine the position of the next event when appending to the stream
*
* @return the size of the steam; 0 when stream is empty
*/
long size();

/**
* Retrieve the id of this stream.
*
* @return the stream id.
*/
UUID getId();

long getSequenceNumber();
/**
* Get the position of this event stream within the sequence of all streams.
* @return the position
*/
long getPosition();

}
}

0 comments on commit 0bd9755

Please sign in to comment.