public class DefaultJDBCAdapter extends Object implements JDBCAdapter
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
batchStatments |
protected ReadWriteLock |
cleanupExclusiveLock |
static int |
MAX_ROWS |
protected int |
maxRows |
protected boolean |
prioritizedMessages |
protected Statements |
statements |
| Constructor and Description |
|---|
DefaultJDBCAdapter() |
| Modifier and Type | Method and Description |
|---|---|
protected static void |
close(PreparedStatement s) |
protected static void |
close(ResultSet rs) |
void |
doAddMessage(TransactionContext c,
long sequence,
org.apache.activemq.command.MessageId messageID,
org.apache.activemq.command.ActiveMQDestination destination,
byte[] data,
long expiration,
byte priority,
org.apache.activemq.command.XATransactionId xid)
A non null xid indicated the op is part of 2pc prepare, so ops are flagged pending outcome
|
void |
doAddMessageReference(TransactionContext c,
long sequence,
org.apache.activemq.command.MessageId messageID,
org.apache.activemq.command.ActiveMQDestination destination,
long expirationTime,
String messageRef) |
void |
doClearLastAck(TransactionContext c,
org.apache.activemq.command.ActiveMQDestination destination,
byte priority,
String clientId,
String subName) |
void |
doCommitAddOp(TransactionContext c,
long sequence) |
void |
doCreateTables(TransactionContext c) |
void |
doDeleteOldMessages(TransactionContext c) |
void |
doDeleteSubscription(TransactionContext c,
org.apache.activemq.command.ActiveMQDestination destination,
String clientId,
String subscriptionName) |
void |
doDropTables(TransactionContext c) |
org.apache.activemq.command.SubscriptionInfo[] |
doGetAllSubscriptions(TransactionContext c,
org.apache.activemq.command.ActiveMQDestination destination) |
Set<org.apache.activemq.command.ActiveMQDestination> |
doGetDestinations(TransactionContext c) |
int |
doGetDurableSubscriberMessageCount(TransactionContext c,
org.apache.activemq.command.ActiveMQDestination destination,
String clientId,
String subscriptionName,
boolean isPrioritizedMessages) |
long |
doGetLastAckedDurableSubscriberMessageId(TransactionContext c,
org.apache.activemq.command.ActiveMQDestination destination,
String clientId,
String subscriberName) |
long |
doGetLastMessageStoreSequenceId(TransactionContext c) |
long |
doGetLastProducerSequenceId(TransactionContext c,
org.apache.activemq.command.ProducerId id) |
byte[] |
doGetMessage(TransactionContext c,
org.apache.activemq.command.MessageId id) |
byte[] |
doGetMessageById(TransactionContext c,
long storeSequenceId) |
int |
doGetMessageCount(TransactionContext c,
org.apache.activemq.command.ActiveMQDestination destination) |
String |
doGetMessageReference(TransactionContext c,
long seq) |
org.apache.activemq.command.SubscriptionInfo |
doGetSubscriberEntry(TransactionContext c,
org.apache.activemq.command.ActiveMQDestination destination,
String clientId,
String subscriptionName) |
void |
doMessageIdScan(TransactionContext c,
int limit,
JDBCMessageIdScanListener listener) |
void |
doRecordDestination(TransactionContext c,
org.apache.activemq.command.ActiveMQDestination destination) |
void |
doRecover(TransactionContext c,
org.apache.activemq.command.ActiveMQDestination destination,
JDBCMessageRecoveryListener listener) |
void |
doRecoverNextMessages(TransactionContext c,
org.apache.activemq.command.ActiveMQDestination destination,
long nextSeq,
long priority,
int maxReturned,
boolean isPrioritizedMessages,
JDBCMessageRecoveryListener listener) |
void |
doRecoverNextMessages(TransactionContext c,
org.apache.activemq.command.ActiveMQDestination destination,
String clientId,
String subscriptionName,
long seq,
long priority,
int maxReturned,
JDBCMessageRecoveryListener listener) |
void |
doRecoverNextMessagesWithPriority(TransactionContext c,
org.apache.activemq.command.ActiveMQDestination destination,
String clientId,
String subscriptionName,
long seq,
long priority,
int maxReturned,
JDBCMessageRecoveryListener listener) |
void |
doRecoverPreparedOps(TransactionContext c,
JdbcMemoryTransactionStore jdbcMemoryTransactionStore) |
void |
doRecoverSubscription(TransactionContext c,
org.apache.activemq.command.ActiveMQDestination destination,
String clientId,
String subscriptionName,
JDBCMessageRecoveryListener listener) |
void |
doRemoveAllMessages(TransactionContext c,
org.apache.activemq.command.ActiveMQDestination destinationName) |
void |
doRemoveMessage(TransactionContext c,
long seq,
org.apache.activemq.command.XATransactionId xid)
A non null xid indicated the op is part of 2pc prepare, so ops are flagged pending outcome
|
void |
doSetLastAck(TransactionContext c,
org.apache.activemq.command.ActiveMQDestination destination,
org.apache.activemq.command.XATransactionId xid,
String clientId,
String subscriptionName,
long seq,
long priority) |
void |
doSetLastAckWithPriority(TransactionContext c,
org.apache.activemq.command.ActiveMQDestination destination,
org.apache.activemq.command.XATransactionId xid,
String clientId,
String subscriptionName,
long seq,
long priority) |
void |
doSetSubscriberEntry(TransactionContext c,
org.apache.activemq.command.SubscriptionInfo info,
boolean retroactive,
boolean isPrioritizedMessages) |
void |
doUpdateMessage(TransactionContext c,
org.apache.activemq.command.ActiveMQDestination destination,
org.apache.activemq.command.MessageId id,
byte[] data) |
static void |
dumpTables(Connection c) |
static void |
dumpTables(Connection c,
String destinationName,
String clientId,
String subscriptionName) |
protected byte[] |
getBinaryData(ResultSet rs,
int index) |
int |
getMaxRows() |
Statements |
getStatements() |
long[] |
getStoreSequenceId(TransactionContext c,
org.apache.activemq.command.ActiveMQDestination destination,
org.apache.activemq.command.MessageId messageID) |
boolean |
isBatchStatements() |
boolean |
isBatchStatments() |
static void |
printQuery(Connection c,
String query,
PrintStream out) |
static void |
printQuery(PreparedStatement s,
PrintStream out) |
void |
setBatchStatements(boolean batchStatements)
Set the number of statements to process as a single batch DB update
|
void |
setBatchStatments(boolean batchStatments)
Deprecated.
|
protected void |
setBinaryData(PreparedStatement s,
int index,
byte[] data) |
void |
setMaxRows(int maxRows)
the max value for statement maxRows, used to limit jdbc queries
|
void |
setStatements(Statements statements) |
void |
setUseExternalMessageReferences(boolean useExternalMessageReferences) |
public static final int MAX_ROWS
protected Statements statements
protected boolean batchStatments
protected boolean prioritizedMessages
protected ReadWriteLock cleanupExclusiveLock
protected int maxRows
protected void setBinaryData(PreparedStatement s, int index, byte[] data) throws SQLException
SQLExceptionprotected byte[] getBinaryData(ResultSet rs, int index) throws SQLException
SQLExceptionpublic void doCreateTables(TransactionContext c) throws SQLException, IOException
doCreateTables in interface JDBCAdapterSQLExceptionIOExceptionpublic void doDropTables(TransactionContext c) throws SQLException, IOException
doDropTables in interface JDBCAdapterSQLExceptionIOExceptionpublic long doGetLastMessageStoreSequenceId(TransactionContext c) throws SQLException, IOException
doGetLastMessageStoreSequenceId in interface JDBCAdapterSQLExceptionIOExceptionpublic byte[] doGetMessageById(TransactionContext c, long storeSequenceId) throws SQLException, IOException
doGetMessageById in interface JDBCAdapterSQLExceptionIOExceptionpublic void doAddMessage(TransactionContext c, long sequence, org.apache.activemq.command.MessageId messageID, org.apache.activemq.command.ActiveMQDestination destination, byte[] data, long expiration, byte priority, org.apache.activemq.command.XATransactionId xid) throws SQLException, IOException
doAddMessage in interface JDBCAdapterSQLExceptionIOExceptionpublic void doUpdateMessage(TransactionContext c, org.apache.activemq.command.ActiveMQDestination destination, org.apache.activemq.command.MessageId id, byte[] data) throws SQLException, IOException
doUpdateMessage in interface JDBCAdapterSQLExceptionIOExceptionpublic void doAddMessageReference(TransactionContext c, long sequence, org.apache.activemq.command.MessageId messageID, org.apache.activemq.command.ActiveMQDestination destination, long expirationTime, String messageRef) throws SQLException, IOException
doAddMessageReference in interface JDBCAdapterSQLExceptionIOExceptionpublic long[] getStoreSequenceId(TransactionContext c, org.apache.activemq.command.ActiveMQDestination destination, org.apache.activemq.command.MessageId messageID) throws SQLException, IOException
getStoreSequenceId in interface JDBCAdapterSQLExceptionIOExceptionpublic byte[] doGetMessage(TransactionContext c, org.apache.activemq.command.MessageId id) throws SQLException, IOException
doGetMessage in interface JDBCAdapterSQLExceptionIOExceptionpublic String doGetMessageReference(TransactionContext c, long seq) throws SQLException, IOException
doGetMessageReference in interface JDBCAdapterSQLExceptionIOExceptionpublic void doRemoveMessage(TransactionContext c, long seq, org.apache.activemq.command.XATransactionId xid) throws SQLException, IOException
doRemoveMessage in interface JDBCAdapterSQLExceptionIOExceptionpublic void doRecover(TransactionContext c, org.apache.activemq.command.ActiveMQDestination destination, JDBCMessageRecoveryListener listener) throws Exception
doRecover in interface JDBCAdapterExceptionpublic void doMessageIdScan(TransactionContext c, int limit, JDBCMessageIdScanListener listener) throws SQLException, IOException
doMessageIdScan in interface JDBCAdapterSQLExceptionIOExceptionpublic void doSetLastAckWithPriority(TransactionContext c, org.apache.activemq.command.ActiveMQDestination destination, org.apache.activemq.command.XATransactionId xid, String clientId, String subscriptionName, long seq, long priority) throws SQLException, IOException
doSetLastAckWithPriority in interface JDBCAdapterSQLExceptionIOExceptionpublic void doSetLastAck(TransactionContext c, org.apache.activemq.command.ActiveMQDestination destination, org.apache.activemq.command.XATransactionId xid, String clientId, String subscriptionName, long seq, long priority) throws SQLException, IOException
doSetLastAck in interface JDBCAdapterSQLExceptionIOExceptionpublic void doClearLastAck(TransactionContext c, org.apache.activemq.command.ActiveMQDestination destination, byte priority, String clientId, String subName) throws SQLException, IOException
doClearLastAck in interface JDBCAdapterSQLExceptionIOExceptionpublic void doRecoverSubscription(TransactionContext c, org.apache.activemq.command.ActiveMQDestination destination, String clientId, String subscriptionName, JDBCMessageRecoveryListener listener) throws Exception
doRecoverSubscription in interface JDBCAdapterExceptionpublic void doRecoverNextMessages(TransactionContext c, org.apache.activemq.command.ActiveMQDestination destination, String clientId, String subscriptionName, long seq, long priority, int maxReturned, JDBCMessageRecoveryListener listener) throws Exception
doRecoverNextMessages in interface JDBCAdapterExceptionpublic void doRecoverNextMessagesWithPriority(TransactionContext c, org.apache.activemq.command.ActiveMQDestination destination, String clientId, String subscriptionName, long seq, long priority, int maxReturned, JDBCMessageRecoveryListener listener) throws Exception
doRecoverNextMessagesWithPriority in interface JDBCAdapterExceptionpublic int doGetDurableSubscriberMessageCount(TransactionContext c, org.apache.activemq.command.ActiveMQDestination destination, String clientId, String subscriptionName, boolean isPrioritizedMessages) throws SQLException, IOException
doGetDurableSubscriberMessageCount in interface JDBCAdapterSQLExceptionIOExceptionpublic void doSetSubscriberEntry(TransactionContext c, org.apache.activemq.command.SubscriptionInfo info, boolean retroactive, boolean isPrioritizedMessages) throws SQLException, IOException
doSetSubscriberEntry in interface JDBCAdapterc - info - retroactive - SQLExceptionIOExceptionpublic org.apache.activemq.command.SubscriptionInfo doGetSubscriberEntry(TransactionContext c, org.apache.activemq.command.ActiveMQDestination destination, String clientId, String subscriptionName) throws SQLException, IOException
doGetSubscriberEntry in interface JDBCAdapterSQLExceptionIOExceptionpublic org.apache.activemq.command.SubscriptionInfo[] doGetAllSubscriptions(TransactionContext c, org.apache.activemq.command.ActiveMQDestination destination) throws SQLException, IOException
doGetAllSubscriptions in interface JDBCAdapterSQLExceptionIOExceptionpublic void doRemoveAllMessages(TransactionContext c, org.apache.activemq.command.ActiveMQDestination destinationName) throws SQLException, IOException
doRemoveAllMessages in interface JDBCAdapterSQLExceptionIOExceptionpublic void doDeleteSubscription(TransactionContext c, org.apache.activemq.command.ActiveMQDestination destination, String clientId, String subscriptionName) throws SQLException, IOException
doDeleteSubscription in interface JDBCAdapterSQLExceptionIOExceptionpublic void doDeleteOldMessages(TransactionContext c) throws SQLException, IOException
doDeleteOldMessages in interface JDBCAdapterSQLExceptionIOExceptionpublic long doGetLastAckedDurableSubscriberMessageId(TransactionContext c, org.apache.activemq.command.ActiveMQDestination destination, String clientId, String subscriberName) throws SQLException, IOException
doGetLastAckedDurableSubscriberMessageId in interface JDBCAdapterSQLExceptionIOExceptionprotected static void close(PreparedStatement s)
protected static void close(ResultSet rs)
public Set<org.apache.activemq.command.ActiveMQDestination> doGetDestinations(TransactionContext c) throws SQLException, IOException
doGetDestinations in interface JDBCAdapterSQLExceptionIOExceptionpublic boolean isBatchStatements()
public void setBatchStatements(boolean batchStatements)
batchStatements - public boolean isBatchStatments()
public void setBatchStatments(boolean batchStatments)
batchStatments - public void setUseExternalMessageReferences(boolean useExternalMessageReferences)
setUseExternalMessageReferences in interface JDBCAdapterpublic Statements getStatements()
public void setStatements(Statements statements)
setStatements in interface JDBCAdapterpublic int getMaxRows()
getMaxRows in interface JDBCAdapterpublic void setMaxRows(int maxRows)
setMaxRows in interface JDBCAdapterpublic void doRecordDestination(TransactionContext c, org.apache.activemq.command.ActiveMQDestination destination) throws SQLException, IOException
doRecordDestination in interface JDBCAdapterSQLExceptionIOExceptionpublic void doRecoverPreparedOps(TransactionContext c, JdbcMemoryTransactionStore jdbcMemoryTransactionStore) throws SQLException, IOException
doRecoverPreparedOps in interface JDBCAdapterSQLExceptionIOExceptionpublic void doCommitAddOp(TransactionContext c, long sequence) throws SQLException, IOException
doCommitAddOp in interface JDBCAdapterSQLExceptionIOExceptionpublic int doGetMessageCount(TransactionContext c, org.apache.activemq.command.ActiveMQDestination destination) throws SQLException, IOException
doGetMessageCount in interface JDBCAdapterSQLExceptionIOExceptionpublic void doRecoverNextMessages(TransactionContext c, org.apache.activemq.command.ActiveMQDestination destination, long nextSeq, long priority, int maxReturned, boolean isPrioritizedMessages, JDBCMessageRecoveryListener listener) throws Exception
doRecoverNextMessages in interface JDBCAdapterExceptionpublic long doGetLastProducerSequenceId(TransactionContext c, org.apache.activemq.command.ProducerId id) throws SQLException, IOException
doGetLastProducerSequenceId in interface JDBCAdapterSQLExceptionIOExceptionpublic static void dumpTables(Connection c, String destinationName, String clientId, String subscriptionName) throws SQLException
SQLExceptionpublic static void dumpTables(Connection c) throws SQLException
SQLExceptionpublic static void printQuery(Connection c, String query, PrintStream out) throws SQLException
SQLExceptionpublic static void printQuery(PreparedStatement s, PrintStream out) throws SQLException
SQLExceptionCopyright © 2005-2015 The Apache Software Foundation. All Rights Reserved.