public class PropertiesPersistingMetadataStore extends Object implements ConcurrentMetadataStore, InitializingBean, DisposableBean, Closeable, Flushable
MetadataStore. To avoid conflicts
each instance should be constructed with the unique key from which unique file name
will be generated. The file name will be 'persistentKey' + ".last.entry".
Files will be written to the 'java.io.tmpdir' + "/spring-integration/".| Constructor and Description |
|---|
PropertiesPersistingMetadataStore() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
void |
close() |
void |
destroy() |
void |
flush() |
String |
get(String key)
Reads a value for the given key from this MetadataStore.
|
void |
put(String key,
String value)
Writes a key value pair to this MetadataStore.
|
String |
putIfAbsent(String key,
String value)
Atomically insert the key into the store.
|
String |
remove(String key)
Remove a value for the given key from this MetadataStore.
|
boolean |
replace(String key,
String oldValue,
String newValue)
Atomically replace the value for the key in the store if the old
value matches the oldValue argument.
|
void |
setBaseDirectory(String baseDirectory) |
public void setBaseDirectory(String baseDirectory)
public void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface InitializingBeanExceptionpublic void put(String key, String value)
MetadataStoreput in interface MetadataStorekey - The key.value - The value.public String get(String key)
MetadataStoreget in interface MetadataStorekey - The key.public String remove(String key)
MetadataStoreremove in interface MetadataStorekey - The key.public String putIfAbsent(String key, String value)
ConcurrentMetadataStoreputIfAbsent in interface ConcurrentMetadataStorekey - The key.value - The value.public boolean replace(String key, String oldValue, String newValue)
ConcurrentMetadataStorereplace in interface ConcurrentMetadataStorekey - The key.oldValue - The old value.newValue - The new value.public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic void destroy()
throws Exception
destroy in interface DisposableBeanException