Class WebsocketKeyValueClient
java.lang.Object
io.fluxcapacitor.javaclient.common.websocket.AbstractWebsocketClient
io.fluxcapacitor.javaclient.persisting.keyvalue.client.WebsocketKeyValueClient
- All Implemented Interfaces:
KeyValueClient,AutoCloseable
-
Nested Class Summary
Nested classes/interfaces inherited from class io.fluxcapacitor.javaclient.common.websocket.AbstractWebsocketClient
AbstractWebsocketClient.WebSocketRequest -
Field Summary
Fields inherited from class io.fluxcapacitor.javaclient.common.websocket.AbstractWebsocketClient
defaultObjectMapper, defaultWebSocketContainer -
Constructor Summary
ConstructorsConstructorDescriptionWebsocketKeyValueClient(String endPointUrl, WebSocketClient.ClientConfig clientConfig) WebsocketKeyValueClient(URI endpointUri, WebSocketClient.ClientConfig clientConfig) -
Method Summary
Modifier and TypeMethodDescriptiondeleteValue(String key) 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.protected AwaitablestoreValues(List<KeyValuePair> keyValuePairs) Methods inherited from class io.fluxcapacitor.javaclient.common.websocket.AbstractWebsocketClient
close, close, handleResult, onClose, onError, onMessage, retryOutstandingRequests, send, send, sendAndForget, sendAndWait, sendBatch, tryPublishMetricsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.fluxcapacitor.javaclient.persisting.keyvalue.client.KeyValueClient
close
-
Constructor Details
-
WebsocketKeyValueClient
-
WebsocketKeyValueClient
-
-
Method Details
-
storeValues
-
putValue
Description copied from interface:KeyValueClientAdds or replaces the given value in the key value store.- Specified by:
putValuein interfaceKeyValueClient- 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
Description copied from interface:KeyValueClientAdds the given value in the key value store if the key is not already mapped to a value.- Specified by:
putValueIfAbsentin interfaceKeyValueClient- 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
Description copied from interface:KeyValueClientReturns theDataobject associated with the given key. Returnsnullif there is no associated value.- Specified by:
getValuein interfaceKeyValueClient- Parameters:
key- The key associated with the value- Returns:
- the value for the given key or null
-
deleteValue
Description copied from interface:KeyValueClientDeletes the value associated with the given key.- Specified by:
deleteValuein interfaceKeyValueClient- 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
-