Interface KeyValueClient
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
InMemoryKeyValueStore, WebsocketKeyValueClient
Represents a service to store and retrieve a piece of serialized data by key.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()default CompletableFuture<Void> deleteValue(String key) Deletes the value associated with the given key.deleteValue(String key, Guarantee guarantee) Deletes the value associated with the given key.Data<byte[]> Returns theDataobject associated with the given key.Adds or replaces the given value in the key value store.putValueIfAbsent(String key, Data<byte[]> value) Adds the given value in the key value store if the key is not already mapped to a value.
-
Method Details
-
putValue
Adds or replaces the given value in the key value store.- Parameters:
key- The key associated with this valuevalue- The value to storeguarantee- The guarantee for storing- Returns:
- a handle that enables clients to wait until the value was sent or stored depending on the guarantee
-
putValueIfAbsent
Adds the given value in the key value store if the key is not already mapped to a value.- Parameters:
key- The key associated with this valuevalue- The value to store- Returns:
- a handle that enables clients to wait until the value was sent or stored depending on the guarantee
-
getValue
-
deleteValue
Deletes the value associated with the given key.- Parameters:
key- The key associated with this value- Returns:
- a handle that enables clients to wait until the command was safely sent to the store
-
deleteValue
Deletes the value associated with the given key.- Parameters:
key- The key associated with this value- Returns:
- a handle that enables clients to wait until the command was safely sent to the store
-
close
void close()- Specified by:
closein interfaceAutoCloseable
-