public class JdbcMetadataStore extends java.lang.Object implements ConcurrentMetadataStore, org.springframework.beans.factory.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 java.lang.String |
DEFAULT_TABLE_PREFIX
Default value for the table prefix property.
|
| Constructor and Description |
|---|
JdbcMetadataStore(javax.sql.DataSource dataSource)
Instantiate a
JdbcMetadataStore using provided dataSource DataSource. |
JdbcMetadataStore(org.springframework.jdbc.core.JdbcOperations jdbcOperations)
Instantiate a
JdbcMetadataStore using provided jdbcOperations JdbcOperations. |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
java.lang.String |
get(java.lang.String key)
Reads a value for the given key from this MetadataStore.
|
void |
put(java.lang.String key,
java.lang.String value)
Writes a key value pair to this MetadataStore.
|
java.lang.String |
putIfAbsent(java.lang.String key,
java.lang.String value)
Atomically insert the key into the store.
|
java.lang.String |
remove(java.lang.String key)
Remove a value for the given key from this MetadataStore.
|
boolean |
replace(java.lang.String key,
java.lang.String oldValue,
java.lang.String newValue)
Atomically replace the value for the key in the store if the old
value matches the oldValue argument.
|
void |
setRegion(java.lang.String region)
A unique grouping identifier for all messages persisted with this store.
|
void |
setTablePrefix(java.lang.String tablePrefix)
Public setter for the table prefix property.
|
public static final java.lang.String DEFAULT_TABLE_PREFIX
public JdbcMetadataStore(javax.sql.DataSource dataSource)
JdbcMetadataStore using provided dataSource DataSource.dataSource - a DataSourcepublic JdbcMetadataStore(org.springframework.jdbc.core.JdbcOperations jdbcOperations)
JdbcMetadataStore using provided jdbcOperations JdbcOperations.jdbcOperations - a JdbcOperationspublic void afterPropertiesSet()
throws java.lang.Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanjava.lang.Exceptionpublic void setTablePrefix(java.lang.String tablePrefix)
DEFAULT_TABLE_PREFIX.tablePrefix - the tablePrefix to setpublic void setRegion(java.lang.String region)
DEFAULT.region - the region name to set@Transactional
public java.lang.String putIfAbsent(java.lang.String key,
java.lang.String value)
ConcurrentMetadataStoreputIfAbsent in interface ConcurrentMetadataStorekey - The key.value - The value.@Transactional
public boolean replace(java.lang.String key,
java.lang.String oldValue,
java.lang.String newValue)
ConcurrentMetadataStorereplace in interface ConcurrentMetadataStorekey - The key.oldValue - The old value.newValue - The new value.@Transactional
public void put(java.lang.String key,
java.lang.String value)
MetadataStoreput in interface MetadataStorekey - The key.value - The value.@Transactional public java.lang.String get(java.lang.String key)
MetadataStoreget in interface MetadataStorekey - The key.@Transactional public java.lang.String remove(java.lang.String key)
MetadataStoreremove in interface MetadataStorekey - The key.