public class NoOpJsonStore extends AbstractAsyncKeyValueStore<String> implements JsonStore
Constructor and Description |
---|
NoOpJsonStore() |
Modifier and Type | Method and Description |
---|---|
void |
delete(String key,
String context) |
Map<String,String> |
enumerateContext(String context) |
Optional<String> |
get(String key,
String context) |
Optional<Optional<String>> |
getIfStale(String key,
String context,
long timestamp) |
OptionalLong |
getLastUpdated(String key,
String context) |
String |
getName() |
long |
put(String key,
String value,
String context,
Integer ttlInSeconds)
Put a value with a suggested time-to-live after which the value should be expired and removed from the store.
|
deleteAsync, enumerateContextAsync, getAsync, getIfStaleAsync, getLastUpdatedAsync, putAsync, truncateContextAsync
put, putAsync, truncateContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
deleteAsync, enumerateContextAsync, getAsync, getIfStaleAsync, getLastUpdatedAsync, put, putAsync, putAsync, truncateContext, truncateContextAsync
public long put(String key, String value, String context, Integer ttlInSeconds)
KeyValueStore
Records are expired on a best effort basis and depending on the implementation it is possible to get an expired record.
put
in interface KeyValueStore<String>
context
- a context used to differentiate between keys with the same name (forms a compound key)ttlInSeconds
- the time to live in seconds for this key or no ttl if nullpublic Optional<String> get(String key, String context)
get
in interface KeyValueStore<String>
context
- a context used to differentiate between keys with the same name (forms a compound key)public Optional<Optional<String>> getIfStale(String key, String context, long timestamp)
getIfStale
in interface KeyValueStore<String>
context
- a context used to differentiate between keys with the same name (forms a compound key)timestamp
- the timestamp of the last known state such that if an record with a more recent timestamp is
found the provided timestamp will be considered stale and the new record will be returnedpublic OptionalLong getLastUpdated(String key, String context)
getLastUpdated
in interface KeyValueStore<String>
context
- a context used to differentiate between keys with the same name (forms a compound key)public String getName()
getName
in interface KeyValueStore<String>
public Map<String,String> enumerateContext(String context)
enumerateContext
in interface KeyValueStore<String>
context
- a context used to differentiate between keys with the same name (forms a compound key)public void delete(String key, String context)
delete
in interface KeyValueStore<String>
context
- a context used to differentiate between keys with the same name (forms a compound key)Copyright © 2020. All rights reserved.