reprepare

open fun reprepare(key: String, oldValue: V, newValue: V): Mono<Boolean>

Reprepares a key with a new value that never expires.

This method updates an existing key preparation with a new permanent value. The old value is used for optimistic concurrency control.

Return

A Mono emitting true if reprepare succeeded, false otherwise

Parameters

key

The key to reprepare

oldValue

The expected current value for concurrency control

newValue

The new value to prepare permanently

See also

(String, V, PreparedValue) for TTL-based reprepare


abstract fun reprepare(key: String, oldValue: V, newValue: PreparedValue<V>): Mono<Boolean>

Reprepares a key with a new value that may have TTL.

This method updates an existing key preparation with a new value and optional TTL. The old value ensures atomicity and prevents concurrent modifications.

Return

A Mono emitting true if reprepare succeeded, false otherwise

Parameters

key

The key to reprepare

oldValue

The expected current value for concurrency control

newValue

The new prepared value with optional TTL


open fun reprepare(key: String, value: V): Mono<Boolean>

Reprepares a key with a new permanent value.

This method updates the value for an existing key preparation, keeping it permanent.

Return

A Mono emitting true if reprepare succeeded, false otherwise

Parameters

key

The key to reprepare

value

The new permanent value


abstract fun reprepare(key: String, value: PreparedValue<V>): Mono<Boolean>

Reprepares a key with a new value that may have TTL.

This method updates the value for an existing key preparation with optional TTL.

Return

A Mono emitting true if reprepare succeeded, false otherwise

Parameters

key

The key to reprepare

value

The new prepared value with optional TTL


open fun reprepare(oldKey: String, oldValue: V, newKey: String, newValue: V): Mono<Boolean>

Reprepares by changing both key and value to new permanent values.

This method atomically releases the old key and prepares the new key. It's commonly used for scenarios like username changes where the identifier itself changes.

Return

A Mono emitting true if the key change succeeded, false otherwise

Parameters

oldKey

The current key to release

oldValue

The expected value of the old key for concurrency control

newKey

The new key to prepare

newValue

The permanent value for the new key

Throws

if oldKey equals newKey


open fun reprepare(oldKey: String, oldValue: V, newKey: String, newValue: PreparedValue<V>): Mono<Boolean>

Reprepares by changing both key and value with optional TTL.

This method provides the most flexible reprepare operation, allowing changes to both the key and value with TTL support. It ensures atomicity by first preparing the new key, then rolling back the old key only if successful.

Return

A Mono emitting true if the key change succeeded, false otherwise

Parameters

oldKey

The current key to release

oldValue

The expected value of the old key for concurrency control

newKey

The new key to prepare (must be different from oldKey)

newValue

The prepared value for the new key with optional TTL

Throws

if oldKey equals newKey

if rollback of old key fails after new key is prepared