Class PassthroughChangeStream<DocumentT>
- java.lang.Object
-
- com.mongodb.stitch.core.services.mongodb.remote.ChangeStream<ChangeEvent<DocumentT>,DocumentT>
-
- com.mongodb.stitch.server.services.mongodb.remote.PassthroughChangeStream<DocumentT>
-
- Type Parameters:
DocumentT
- The type of full document on the change event.
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class PassthroughChangeStream<DocumentT> extends ChangeStream<ChangeEvent<DocumentT>,DocumentT>
SimpleChangeStream
implementation that unwraps and returns the same change event provided on the internalStitchEvent
.
-
-
Constructor Summary
Constructors Constructor Description PassthroughChangeStream(Stream<ChangeEvent<DocumentT>> stream)
Initializes a passthrough change stream with the provided underlying event stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ChangeEvent<DocumentT>
nextEvent()
Returns the next event available from the stream.-
Methods inherited from class com.mongodb.stitch.core.services.mongodb.remote.ChangeStream
close, dispatchError, getExceptionListener, getStream, isOpen, setExceptionListener
-
-
-
-
Constructor Detail
-
PassthroughChangeStream
public PassthroughChangeStream(Stream<ChangeEvent<DocumentT>> stream)
Initializes a passthrough change stream with the provided underlying event stream.- Parameters:
stream
- The event stream.
-
-
Method Detail
-
nextEvent
public ChangeEvent<DocumentT> nextEvent() throws IOException
Description copied from class:ChangeStream
Returns the next event available from the stream.- Specified by:
nextEvent
in classChangeStream<ChangeEvent<DocumentT>,DocumentT>
- Returns:
- The next event.
- Throws:
IOException
- If the underlying stream throws anIOException
-
-