Klasse SimpleSnapshotEventGenerator
java.lang.Object
org.zalando.nakadiproducer.snapshots.SimpleSnapshotEventGenerator
- Alle implementierten Schnittstellen:
SnapshotEventGenerator
@Deprecated
public final class SimpleSnapshotEventGenerator
extends Object
implements SnapshotEventGenerator
Veraltet.
This is a simple implementation of the
SnapshotEventGenerator. It is
meant to be used in a functional style.- Siehe auch:
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungSimpleSnapshotEventGenerator(String supportedEventType, BiFunction<Object, String, List<Snapshot>> snapshotEventFactory) Veraltet.Creates a SnapshotEventGenerator for an event type, with filtering support.SimpleSnapshotEventGenerator(String supportedEventType, Function<Object, List<Snapshot>> snapshotEventFactory) Veraltet.Creates a SnapshotEventGenerator for an event type, which doesn't support filtering. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibunggenerateSnapshots(Object withIdGreaterThan, String filter) Veraltet.Returns a batch of snapshots of given type (event type is an event channel topic name).Veraltet.The name of the event type supported by this snapshot generator.
-
Konstruktordetails
-
SimpleSnapshotEventGenerator
public SimpleSnapshotEventGenerator(String supportedEventType, Function<Object, List<Snapshot>> snapshotEventFactory) Veraltet.Creates a SnapshotEventGenerator for an event type, which doesn't support filtering.- Parameter:
supportedEventType- the eventType that this SnapShotEventProvider will support.snapshotEventFactory- a snapshot event factory function conforming to the specification ofSnapshotEventGenerator.generateSnapshots(Object, String)(but without the filter parameter). Any filter provided by the caller will be thrown away.
-
SimpleSnapshotEventGenerator
public SimpleSnapshotEventGenerator(String supportedEventType, BiFunction<Object, String, List<Snapshot>> snapshotEventFactory) Veraltet.Creates a SnapshotEventGenerator for an event type, with filtering support.- Parameter:
supportedEventType- the eventType that this SnapShotEventProvider will support.snapshotEventFactory- a snapshot event factory function conforming to the specification ofSnapshotEventGenerator.generateSnapshots(Object, String).
-
-
Methodendetails
-
generateSnapshots
Veraltet.Beschreibung aus Schnittstelle kopiert:SnapshotEventGeneratorReturns a batch of snapshots of given type (event type is an event channel topic name). The implementation may return an arbitrary amount of results, but it must return at least one element if there are entities matching the parameters.
Calling this method must have no side effects.
The library will call your implementation like this:- Request: generateSnapshots(null, filter), Response: 1,2,3
- Request: generateSnapshots(3, filter), Response: 4,5
- Request: generateSnapshots(5, filter), Response: emptyList
It is your responsibility to make sure that the returned events are ordered by their ID ascending and that, given you return a list of events for entities with IDs {id1, ..., idN}, there exists no entity with an ID between id1 and idN, that is not part of the result.
- Angegeben von:
generateSnapshotsin SchnittstelleSnapshotEventGenerator- Parameter:
withIdGreaterThan- if not null, only events for entities with an ID greater than the given one must be returnedfilter- a filter for the snapshot generation mechanism. This value is simply passed through from the request body of the REST endpoint (or from any other triggering mechanism). If there was no request body, this will benull. Implementors can interpret it in whatever way they want (even ignore it). All calls for one snapshot generation will receive the same string.- Gibt zurück:
- list of elements (wrapped in Snapshot objects) ordered by their ID.
-
getSupportedEventType
Veraltet.Beschreibung aus Schnittstelle kopiert:SnapshotEventGeneratorThe name of the event type supported by this snapshot generator.- Angegeben von:
getSupportedEventTypein SchnittstelleSnapshotEventGenerator
-
SnapshotEventGenerator.of(java.lang.String, java.util.function.Function<java.lang.Object, java.util.List<org.zalando.nakadiproducer.snapshots.Snapshot>>)methods instead.