Class AbstractKeyValueStore<T>
- java.lang.Object
-
- org.opennms.features.distributed.kvstore.api.AbstractKeyValueStore<T>
-
- All Implemented Interfaces:
KeyValueStore<T>
- Direct Known Subclasses:
AbstractAsyncKeyValueStore
,CassandraBlobStore
public abstract class AbstractKeyValueStore<T> extends java.lang.Object implements KeyValueStore<T>
Skeleton implementation ofKeyValueStore
that defaults calls without ttl specified.
-
-
Constructor Summary
Constructors Constructor Description AbstractKeyValueStore()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
put(java.lang.String key, T value, java.lang.String context)
java.util.concurrent.CompletableFuture<java.lang.Long>
putAsync(java.lang.String key, T value, java.lang.String context)
void
truncateContext(java.lang.String context)
A default truncate implementation.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.opennms.features.distributed.kvstore.api.KeyValueStore
delete, deleteAsync, enumerateContext, enumerateContextAsync, get, getAsync, getIfStale, getIfStaleAsync, getLastUpdated, getLastUpdatedAsync, getName, put, putAsync, truncateContextAsync
-
-
-
-
Method Detail
-
put
public final long put(java.lang.String key, T value, java.lang.String context)
- Specified by:
put
in interfaceKeyValueStore<T>
context
- a context used to differentiate between keys with the same name (forms a compound key)- Returns:
- the timestamp the value was persisted with
-
putAsync
public final java.util.concurrent.CompletableFuture<java.lang.Long> putAsync(java.lang.String key, T value, java.lang.String context)
- Specified by:
putAsync
in interfaceKeyValueStore<T>
context
- a context used to differentiate between keys with the same name (forms a compound key)- Returns:
- a future containing the timestamp the value was persisted with
-
truncateContext
public void truncateContext(java.lang.String context)
A default truncate implementation.- Specified by:
truncateContext
in interfaceKeyValueStore<T>
- Parameters:
context
- a context used to differentiate between keys with the same name (forms a compound key)
-
-