|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.sdnplatform.sync.internal.store.JacksonStore<K,V>
public class JacksonStore<K,V>
A store that will serialize and deserialize objects to JSON using Jackson
| Field Summary | |
|---|---|
protected static org.slf4j.Logger |
logger
|
protected static com.fasterxml.jackson.databind.ObjectMapper |
mapper
|
| Constructor Summary | |
|---|---|
JacksonStore(IStore<ByteArray,byte[]> delegate,
java.lang.Class<K> keyClass,
java.lang.Class<V> valueClass)
|
|
JacksonStore(IStore<ByteArray,byte[]> delegate,
com.fasterxml.jackson.core.type.TypeReference<K> keyType,
com.fasterxml.jackson.core.type.TypeReference<V> valueType)
|
|
| Method Summary | |
|---|---|
void |
close()
Close the store. |
IClosableIterator<java.util.Map.Entry<K,java.util.List<Versioned<V>>>> |
entries()
Get an iterator over pairs of entries in the store. |
java.util.List<Versioned<V>> |
get(K key)
Get the value associated with the given key |
java.lang.String |
getName()
|
java.util.List<IVersion> |
getVersions(K key)
Get a list of the versions associated with the given key |
void |
put(K key,
Versioned<V> value)
Associate the value with the key and version in this store |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static org.slf4j.Logger logger
protected static final com.fasterxml.jackson.databind.ObjectMapper mapper
| Constructor Detail |
|---|
public JacksonStore(IStore<ByteArray,byte[]> delegate,
java.lang.Class<K> keyClass,
java.lang.Class<V> valueClass)
public JacksonStore(IStore<ByteArray,byte[]> delegate,
com.fasterxml.jackson.core.type.TypeReference<K> keyType,
com.fasterxml.jackson.core.type.TypeReference<V> valueType)
| Method Detail |
|---|
public java.util.List<Versioned<V>> get(K key)
throws SyncException
IStore
get in interface IStore<K,V>key - The key to check for
SyncExceptionpublic IClosableIterator<java.util.Map.Entry<K,java.util.List<Versioned<V>>>> entries()
IStore
entries in interface IStore<K,V>
public void put(K key,
Versioned<V> value)
throws SyncException
IStore
put in interface IStore<K,V>key - The key to usevalue - The value to store and its version.
SyncExceptionpublic java.lang.String getName()
getName in interface IStore<K,V>
public void close()
throws SyncException
IStore
close in interface IStore<K,V>SyncException - If closing fails.
public java.util.List<IVersion> getVersions(K key)
throws SyncException
IStore
getVersions in interface IStore<K,V>key - the key
IVersion objects
SyncException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||