Interface SnapshotProducer
-
public interface SnapshotProducer
ASnapshotProducer
produces a snapshot index, which consists of a list of pages which contain all entities.In order to produce a snapshot, you provide a stream of entities.
A snapshot producer is created using a builder: call the
builder(SnapshotIndexRepository, SnapshotPageRepository, SnapshotPageUrlBuilder)
method to create a new builder with default settings, call the methods onSnapshotProducer.Builder
to customize the producer, then callSnapshotProducer.Builder.build()
to create a newSnapshotProducer
instance.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
SnapshotProducer.Builder
A builder forSnapshotProducer
.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static SnapshotProducer.Builder
builder(@NonNull SnapshotIndexRepository snapshotIndexRepository, @NonNull SnapshotPageRepository snapshotPageRepository, @NonNull SnapshotPageUrlBuilder snapshotPageUrlBuilder)
Create a newSnapshotProducer.Builder
with default settings.@NonNull java.util.concurrent.CompletionStage<@NonNull SnapshotIndex>
produce(java.util.concurrent.Flow.Publisher<@NonNull Entity<@NonNull SnapshotEntityHeader>> entities)
Produces a snapshot of given stream of entities.
-
-
-
Method Detail
-
produce
@NonNull @NonNull java.util.concurrent.CompletionStage<@NonNull SnapshotIndex> produce(@NonNull java.util.concurrent.Flow.Publisher<@NonNull Entity<@NonNull SnapshotEntityHeader>> entities)
Produces a snapshot of given stream of entities.- Parameters:
entities
- the entities as a stream which will be included in the snapshot.- Returns:
- a
SnapshotIndex
-
builder
@NonNull static SnapshotProducer.Builder builder(@NonNull @NonNull SnapshotIndexRepository snapshotIndexRepository, @NonNull @NonNull SnapshotPageRepository snapshotPageRepository, @NonNull @NonNull SnapshotPageUrlBuilder snapshotPageUrlBuilder)
Create a newSnapshotProducer.Builder
with default settings. Use theSnapshotProducer.Builder.build()
method on the returned builder to create aSnapshotProducer
with the specified settings.- Parameters:
snapshotIndexRepository
- the repository where the snapshot indexes are stored.snapshotPageRepository
- the repository where the pages of the corresponding snapshot are stored.snapshotPageUrlBuilder
- the builder, which build the urls of the pages of a snapshot.- Returns:
- a new builder
-
-