@ManagedResource(description="JDBC IdempotentRepository")
public abstract class AbstractJdbcMessageIdRepository<T>
extends org.apache.camel.support.ServiceSupport
implements org.apache.camel.spi.IdempotentRepository<T>
#queryForInt(T key)
#insert(T key)
#delete(T key)
Modifier and Type | Field and Description |
---|---|
protected DataSource |
dataSource |
protected org.springframework.jdbc.core.JdbcTemplate |
jdbcTemplate |
protected org.slf4j.Logger |
log |
protected String |
processorName |
protected org.springframework.transaction.support.TransactionTemplate |
transactionTemplate |
Constructor and Description |
---|
AbstractJdbcMessageIdRepository() |
AbstractJdbcMessageIdRepository(DataSource dataSource,
String processorName) |
AbstractJdbcMessageIdRepository(DataSource dataSource,
org.springframework.transaction.support.TransactionTemplate transactionTemplate,
String processorName) |
AbstractJdbcMessageIdRepository(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate,
org.springframework.transaction.support.TransactionTemplate transactionTemplate) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(T key) |
void |
clear() |
boolean |
confirm(T key) |
boolean |
contains(T key) |
protected static org.springframework.transaction.support.TransactionTemplate |
createTransactionTemplate(DataSource dataSource)
Creates the transaction template
|
protected abstract int |
delete()
Operations that deletes all the rows
|
protected abstract int |
delete(T key)
Operations that deletes the key if it exists
|
protected void |
doStart() |
protected void |
doStop() |
DataSource |
getDataSource() |
org.springframework.jdbc.core.JdbcTemplate |
getJdbcTemplate() |
String |
getProcessorName() |
org.springframework.transaction.support.TransactionTemplate |
getTransactionTemplate() |
protected abstract int |
insert(T key)
Operation that inserts the key if it does not already exist
|
protected abstract int |
queryForInt(T key)
Operation that returns the number of rows, if any, for the specified key
|
boolean |
remove(T key) |
void |
setDataSource(DataSource dataSource) |
void |
setJdbcTemplate(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate) |
void |
setProcessorName(String processorName) |
void |
setTransactionTemplate(org.springframework.transaction.support.TransactionTemplate transactionTemplate) |
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
protected org.springframework.jdbc.core.JdbcTemplate jdbcTemplate
protected String processorName
protected org.springframework.transaction.support.TransactionTemplate transactionTemplate
protected DataSource dataSource
protected org.slf4j.Logger log
public AbstractJdbcMessageIdRepository()
public AbstractJdbcMessageIdRepository(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, org.springframework.transaction.support.TransactionTemplate transactionTemplate)
public AbstractJdbcMessageIdRepository(DataSource dataSource, org.springframework.transaction.support.TransactionTemplate transactionTemplate, String processorName)
public AbstractJdbcMessageIdRepository(DataSource dataSource, String processorName)
protected abstract int queryForInt(T key)
key
- the keyprotected abstract int insert(T key)
key
- the keyprotected abstract int delete(T key)
key
- the keyprotected abstract int delete()
key
- the keyprotected static org.springframework.transaction.support.TransactionTemplate createTransactionTemplate(DataSource dataSource)
protected void doStart() throws Exception
doStart
in class org.apache.camel.support.ServiceSupport
Exception
protected void doStop() throws Exception
doStop
in class org.apache.camel.support.ServiceSupport
Exception
@ManagedOperation(description="Adds the key to the store") public boolean add(T key)
add
in interface org.apache.camel.spi.IdempotentRepository<T>
@ManagedOperation(description="Does the store contain the given key") public boolean contains(T key)
contains
in interface org.apache.camel.spi.IdempotentRepository<T>
@ManagedOperation(description="Remove the key from the store") public boolean remove(T key)
remove
in interface org.apache.camel.spi.IdempotentRepository<T>
@ManagedOperation(description="Clear the store") public void clear()
clear
in interface org.apache.camel.spi.IdempotentRepository<T>
public boolean confirm(T key)
confirm
in interface org.apache.camel.spi.IdempotentRepository<T>
public org.springframework.jdbc.core.JdbcTemplate getJdbcTemplate()
public void setJdbcTemplate(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate)
public String getProcessorName()
public void setProcessorName(String processorName)
public org.springframework.transaction.support.TransactionTemplate getTransactionTemplate()
public void setTransactionTemplate(org.springframework.transaction.support.TransactionTemplate transactionTemplate)
public DataSource getDataSource()
public void setDataSource(DataSource dataSource)
Apache Camel