public class DefaultJDBCAdapter extends Object implements JDBCAdapter
Modifier and Type | Field and Description |
---|---|
protected boolean |
batchStatments |
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 preparedSequence,
long sequence) |
void |
doCreateTables(TransactionContext transactionContext) |
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[] lastRecoveredEntries,
long maxSeq,
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() |
String |
limitQuery(String query) |
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 int maxRows
public DefaultJDBCAdapter()
protected void setBinaryData(PreparedStatement s, int index, byte[] data) throws SQLException
SQLException
protected byte[] getBinaryData(ResultSet rs, int index) throws SQLException
SQLException
public void doCreateTables(TransactionContext transactionContext) throws SQLException, IOException
doCreateTables
in interface JDBCAdapter
SQLException
IOException
public void doDropTables(TransactionContext c) throws SQLException, IOException
doDropTables
in interface JDBCAdapter
SQLException
IOException
public long doGetLastMessageStoreSequenceId(TransactionContext c) throws SQLException, IOException
doGetLastMessageStoreSequenceId
in interface JDBCAdapter
SQLException
IOException
public byte[] doGetMessageById(TransactionContext c, long storeSequenceId) throws SQLException, IOException
doGetMessageById
in interface JDBCAdapter
SQLException
IOException
public 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 JDBCAdapter
SQLException
IOException
public void doUpdateMessage(TransactionContext c, org.apache.activemq.command.ActiveMQDestination destination, org.apache.activemq.command.MessageId id, byte[] data) throws SQLException, IOException
doUpdateMessage
in interface JDBCAdapter
SQLException
IOException
public 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 JDBCAdapter
SQLException
IOException
public long[] getStoreSequenceId(TransactionContext c, org.apache.activemq.command.ActiveMQDestination destination, org.apache.activemq.command.MessageId messageID) throws SQLException, IOException
getStoreSequenceId
in interface JDBCAdapter
SQLException
IOException
public byte[] doGetMessage(TransactionContext c, org.apache.activemq.command.MessageId id) throws SQLException, IOException
doGetMessage
in interface JDBCAdapter
SQLException
IOException
public String doGetMessageReference(TransactionContext c, long seq) throws SQLException, IOException
doGetMessageReference
in interface JDBCAdapter
SQLException
IOException
public void doRemoveMessage(TransactionContext c, long seq, org.apache.activemq.command.XATransactionId xid) throws SQLException, IOException
doRemoveMessage
in interface JDBCAdapter
SQLException
IOException
public void doRecover(TransactionContext c, org.apache.activemq.command.ActiveMQDestination destination, JDBCMessageRecoveryListener listener) throws Exception
doRecover
in interface JDBCAdapter
Exception
public void doMessageIdScan(TransactionContext c, int limit, JDBCMessageIdScanListener listener) throws SQLException, IOException
doMessageIdScan
in interface JDBCAdapter
SQLException
IOException
public 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 JDBCAdapter
SQLException
IOException
public 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 JDBCAdapter
SQLException
IOException
public void doClearLastAck(TransactionContext c, org.apache.activemq.command.ActiveMQDestination destination, byte priority, String clientId, String subName) throws SQLException, IOException
doClearLastAck
in interface JDBCAdapter
SQLException
IOException
public void doRecoverSubscription(TransactionContext c, org.apache.activemq.command.ActiveMQDestination destination, String clientId, String subscriptionName, JDBCMessageRecoveryListener listener) throws Exception
doRecoverSubscription
in interface JDBCAdapter
Exception
public 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 JDBCAdapter
Exception
public 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 JDBCAdapter
Exception
public int doGetDurableSubscriberMessageCount(TransactionContext c, org.apache.activemq.command.ActiveMQDestination destination, String clientId, String subscriptionName, boolean isPrioritizedMessages) throws SQLException, IOException
doGetDurableSubscriberMessageCount
in interface JDBCAdapter
SQLException
IOException
public void doSetSubscriberEntry(TransactionContext c, org.apache.activemq.command.SubscriptionInfo info, boolean retroactive, boolean isPrioritizedMessages) throws SQLException, IOException
doSetSubscriberEntry
in interface JDBCAdapter
c
- info
- retroactive
- SQLException
IOException
public org.apache.activemq.command.SubscriptionInfo doGetSubscriberEntry(TransactionContext c, org.apache.activemq.command.ActiveMQDestination destination, String clientId, String subscriptionName) throws SQLException, IOException
doGetSubscriberEntry
in interface JDBCAdapter
SQLException
IOException
public org.apache.activemq.command.SubscriptionInfo[] doGetAllSubscriptions(TransactionContext c, org.apache.activemq.command.ActiveMQDestination destination) throws SQLException, IOException
doGetAllSubscriptions
in interface JDBCAdapter
SQLException
IOException
public void doRemoveAllMessages(TransactionContext c, org.apache.activemq.command.ActiveMQDestination destinationName) throws SQLException, IOException
doRemoveAllMessages
in interface JDBCAdapter
SQLException
IOException
public void doDeleteSubscription(TransactionContext c, org.apache.activemq.command.ActiveMQDestination destination, String clientId, String subscriptionName) throws SQLException, IOException
doDeleteSubscription
in interface JDBCAdapter
SQLException
IOException
public void doDeleteOldMessages(TransactionContext c) throws SQLException, IOException
doDeleteOldMessages
in interface JDBCAdapter
SQLException
IOException
public long doGetLastAckedDurableSubscriberMessageId(TransactionContext c, org.apache.activemq.command.ActiveMQDestination destination, String clientId, String subscriberName) throws SQLException, IOException
doGetLastAckedDurableSubscriberMessageId
in interface JDBCAdapter
SQLException
IOException
protected static void close(PreparedStatement s)
public Set<org.apache.activemq.command.ActiveMQDestination> doGetDestinations(TransactionContext c) throws SQLException, IOException
doGetDestinations
in interface JDBCAdapter
SQLException
IOException
public 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 JDBCAdapter
public Statements getStatements()
public void setStatements(Statements statements)
setStatements
in interface JDBCAdapter
public int getMaxRows()
getMaxRows
in interface JDBCAdapter
public void setMaxRows(int maxRows)
setMaxRows
in interface JDBCAdapter
public void doRecordDestination(TransactionContext c, org.apache.activemq.command.ActiveMQDestination destination) throws SQLException, IOException
doRecordDestination
in interface JDBCAdapter
SQLException
IOException
public void doRecoverPreparedOps(TransactionContext c, JdbcMemoryTransactionStore jdbcMemoryTransactionStore) throws SQLException, IOException
doRecoverPreparedOps
in interface JDBCAdapter
SQLException
IOException
public void doCommitAddOp(TransactionContext c, long preparedSequence, long sequence) throws SQLException, IOException
doCommitAddOp
in interface JDBCAdapter
SQLException
IOException
public int doGetMessageCount(TransactionContext c, org.apache.activemq.command.ActiveMQDestination destination) throws SQLException, IOException
doGetMessageCount
in interface JDBCAdapter
SQLException
IOException
public void doRecoverNextMessages(TransactionContext c, org.apache.activemq.command.ActiveMQDestination destination, long[] lastRecoveredEntries, long maxSeq, int maxReturned, boolean isPrioritizedMessages, JDBCMessageRecoveryListener listener) throws Exception
doRecoverNextMessages
in interface JDBCAdapter
Exception
public long doGetLastProducerSequenceId(TransactionContext c, org.apache.activemq.command.ProducerId id) throws SQLException, IOException
doGetLastProducerSequenceId
in interface JDBCAdapter
SQLException
IOException
public static void dumpTables(Connection c, String destinationName, String clientId, String subscriptionName) throws SQLException
SQLException
public static void dumpTables(Connection c) throws SQLException
SQLException
public static void printQuery(Connection c, String query, PrintStream out) throws SQLException
SQLException
public static void printQuery(PreparedStatement s, PrintStream out) throws SQLException
SQLException
public String limitQuery(String query)
limitQuery
in interface JDBCAdapter
Copyright © 2005–2018 FuseSource, Corp.. All rights reserved.