@ManagedResource(description="JDBC IdempotentRepository")
public abstract class AbstractJdbcMessageIdRepository
extends org.apache.camel.support.service.ServiceSupport
implements org.apache.camel.spi.IdempotentRepository
IdempotentRepository parameterized,
as it should have been a pre-configured to use a String type.| 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(String key) |
void |
clear() |
boolean |
confirm(String key) |
boolean |
contains(String 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(String 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(String key)
Operation that inserts the key if it does not already exist
|
protected abstract int |
queryForInt(String key)
Operation that returns the number of rows, if any, for the specified key
|
boolean |
remove(String 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) |
doInit, doResume, doShutdown, doSuspend, getStatus, init, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitprotected 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(String key)
key - the keyprotected abstract int insert(String key)
key - the keyprotected abstract int delete(String key)
key - the keyprotected abstract int delete()
protected static org.springframework.transaction.support.TransactionTemplate createTransactionTemplate(DataSource dataSource)
protected void doStart()
throws Exception
doStart in class org.apache.camel.support.service.ServiceSupportExceptionprotected void doStop()
throws Exception
doStop in class org.apache.camel.support.service.ServiceSupportException@ManagedOperation(description="Adds the key to the store") public boolean add(String key)
add in interface org.apache.camel.spi.IdempotentRepository@ManagedOperation(description="Does the store contain the given key") public boolean contains(String key)
contains in interface org.apache.camel.spi.IdempotentRepository@ManagedOperation(description="Remove the key from the store") public boolean remove(String key)
remove in interface org.apache.camel.spi.IdempotentRepository@ManagedOperation(description="Clear the store") public void clear()
clear in interface org.apache.camel.spi.IdempotentRepositorypublic boolean confirm(String key)
confirm in interface org.apache.camel.spi.IdempotentRepositorypublic 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