TReadResult
- The result type for reads.TWriteResult
- The result type for writes.TReadInput
- The input parameter type for reads.TWriteInput
- The input type for writes.public final class Migration<TReadResult,TWriteResult,TReadInput,TWriteInput>
extends java.lang.Object
This class is not intended to be instanced directly, but instead should be constructed
using the MigrationBuilder
.
The thread safety model for a migration depends on the usage of thread-safe elements. Specifically the tracker, the client, and the thread pool should be thread-safe. Other elements of the migration instance itself are immutable for their thread-safety.
Modifier and Type | Class and Description |
---|---|
static interface |
Migration.Method<UInput,UOutput> |
static class |
Migration.MigrationResult<TResult>
This class represents the result of a migration operation.
|
static class |
Migration.MigrationWriteResult<TWriteResult>
The result of a migration write.
|
static interface |
Migration.ReadConsistencyChecker<TReadResult>
This interface defines a method for checking the consistency of two reads.
|
static interface |
Migration.Reader<TReadInput,TReadResult>
This interface defines a read method.
|
static interface |
Migration.Writer<TWriteInput,TWriteResult>
This interfaces defines a write method.
|
Modifier and Type | Method and Description |
---|---|
Migration.MigrationResult<TReadResult> |
read(java.lang.String key,
LDContext context,
MigrationStage defaultStage)
Execute a migration based read.
|
Migration.MigrationResult<TReadResult> |
read(java.lang.String key,
LDContext context,
MigrationStage defaultStage,
TReadInput payload)
Execute a migration based read with a payload.
|
Migration.MigrationWriteResult<TWriteResult> |
write(java.lang.String key,
LDContext context,
MigrationStage defaultStage)
Execute a migration based write.
|
Migration.MigrationWriteResult<TWriteResult> |
write(java.lang.String key,
LDContext context,
MigrationStage defaultStage,
TWriteInput payload)
Execute a migration based write with a payload.
|
@NotNull public Migration.MigrationResult<TReadResult> read(@NotNull java.lang.String key, @NotNull LDContext context, @NotNull MigrationStage defaultStage, @Nullable TReadInput payload)
To execute a read without a payload use read(String, LDContext, MigrationStage)
.
key
- the flag key of migration flagcontext
- the context for the migrationdefaultStage
- the default migration stagepayload
- an optional payload that will be passed to the new/old read implementations@NotNull public Migration.MigrationResult<TReadResult> read(@NotNull java.lang.String key, @NotNull LDContext context, @NotNull MigrationStage defaultStage)
To execute a read with a payload use read(String, LDContext, MigrationStage, Object)
.
key
- the flag key of migration flagcontext
- the context for the migrationdefaultStage
- the default migration stage@NotNull public Migration.MigrationWriteResult<TWriteResult> write(@NotNull java.lang.String key, @NotNull LDContext context, @NotNull MigrationStage defaultStage, @Nullable TWriteInput payload)
To execute a write without a payload use write(String, LDContext, MigrationStage)
.
key
- the flag key of migration flagcontext
- the context for the migrationdefaultStage
- the default migration stagepayload
- an optional payload that will be passed to the new/old write implementations@NotNull public Migration.MigrationWriteResult<TWriteResult> write(@NotNull java.lang.String key, @NotNull LDContext context, @NotNull MigrationStage defaultStage)
To execute a read with a payload use write(String, LDContext, MigrationStage, Object)
.
key
- the flag key of migration flagcontext
- the context for the migrationdefaultStage
- the default migration stage