public class JdbcMetadataStore extends Object implements ConcurrentMetadataStore, InitializingBean
MetadataStore using a relational database via JDBC.
SQL scripts to create the necessary tables are packaged as
org/springframework/integration/jdbc/schema-*.sql,
where * is the target database type.
The transaction management is required to use this MetadataStore.
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_TABLE_PREFIX
Default value for the table prefix property.
|
| Constructor and Description |
|---|
JdbcMetadataStore(DataSource dataSource)
Instantiate a
JdbcMetadataStore using provided dataSource DataSource. |
JdbcMetadataStore(JdbcOperations jdbcOperations)
Instantiate a
JdbcMetadataStore using provided jdbcOperations JdbcOperations. |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
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 |
setRegion(String region)
A unique grouping identifier for all messages persisted with this store.
|
void |
setTablePrefix(String tablePrefix)
Public setter for the table prefix property.
|
public static final String DEFAULT_TABLE_PREFIX
public JdbcMetadataStore(DataSource dataSource)
JdbcMetadataStore using provided dataSource DataSource.dataSource - a DataSourcepublic JdbcMetadataStore(JdbcOperations jdbcOperations)
JdbcMetadataStore using provided jdbcOperations JdbcOperations.jdbcOperations - a JdbcOperationspublic void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface InitializingBeanExceptionpublic void setTablePrefix(String tablePrefix)
DEFAULT_TABLE_PREFIX.tablePrefix - the tablePrefix to setpublic void setRegion(String region)
DEFAULT.region - the region name to set@Transactional public String putIfAbsent(String key, String value)
ConcurrentMetadataStoreputIfAbsent in interface ConcurrentMetadataStorekey - The key.value - The value.@Transactional public boolean replace(String key, String oldValue, String newValue)
ConcurrentMetadataStorereplace in interface ConcurrentMetadataStorekey - The key.oldValue - The old value.newValue - The new value.@Transactional public void put(String key, String value)
MetadataStoreput in interface MetadataStorekey - The key.value - The value.@Transactional public String get(String key)
MetadataStoreget in interface MetadataStorekey - The key.@Transactional public String remove(String key)
MetadataStoreremove in interface MetadataStorekey - The key.