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 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(String key, T value, String context)
CompletableFuture<Long>
putAsync(String key, T value, String context)
void
truncateContext(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(String key, T value, 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 CompletableFuture<Long> putAsync(String key, T value, 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(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)
-
-