1 14 15 package org.apache.activemq.store.jdbc; 16 17 import java.io.IOException ; 18 import java.sql.SQLException ; 19 import java.util.Set ; 20 import org.apache.activemq.command.ActiveMQDestination; 21 import org.apache.activemq.command.MessageId; 22 import org.apache.activemq.command.SubscriptionInfo; 23 24 27 public interface JDBCAdapter{ 28 29 public void setStatements(Statements statementProvider); 30 31 public abstract void doCreateTables(TransactionContext c) throws SQLException ,IOException ; 32 33 public abstract void doDropTables(TransactionContext c) throws SQLException ,IOException ; 34 35 public abstract void doAddMessage(TransactionContext c,MessageId messageID,ActiveMQDestination destination, 36 byte[] data,long expiration) throws SQLException ,IOException ; 37 38 public abstract void doAddMessageReference(TransactionContext c,MessageId messageId, 39 ActiveMQDestination destination,long expirationTime,String messageRef) throws SQLException ,IOException ; 40 41 public abstract byte[] doGetMessage(TransactionContext c,long seq) throws SQLException ,IOException ; 42 43 public abstract String doGetMessageReference(TransactionContext c,long id) throws SQLException ,IOException ; 44 45 public abstract void doRemoveMessage(TransactionContext c,long seq) throws SQLException ,IOException ; 46 47 public abstract void doRecover(TransactionContext c,ActiveMQDestination destination, 48 JDBCMessageRecoveryListener listener) throws Exception ; 49 50 public abstract void doSetLastAck(TransactionContext c,ActiveMQDestination destination,String clientId, 51 String subscriptionName,long seq) throws SQLException ,IOException ; 52 53 public abstract void doRecoverSubscription(TransactionContext c,ActiveMQDestination destination,String clientId, 54 String subscriptionName,JDBCMessageRecoveryListener listener) throws Exception ; 55 56 public abstract void doRecoverNextMessages(TransactionContext c,ActiveMQDestination destination,String clientId, 57 String subscriptionName,long seq,int maxReturned,JDBCMessageRecoveryListener listener) throws Exception ; 58 59 public abstract void doSetSubscriberEntry(TransactionContext c,ActiveMQDestination destination,String clientId, 60 String subscriptionName,String selector,boolean retroactive) throws SQLException ,IOException ; 61 62 public abstract SubscriptionInfo doGetSubscriberEntry(TransactionContext c,ActiveMQDestination destination, 63 String clientId,String subscriptionName) throws SQLException ,IOException ; 64 65 public abstract long getBrokerSequenceId(TransactionContext c,MessageId messageID) throws SQLException ,IOException ; 66 67 public abstract void doRemoveAllMessages(TransactionContext c,ActiveMQDestination destinationName) 68 throws SQLException ,IOException ; 69 70 public abstract void doDeleteSubscription(TransactionContext c,ActiveMQDestination destinationName,String clientId, 71 String subscriptionName) throws SQLException ,IOException ; 72 73 public abstract void doDeleteOldMessages(TransactionContext c) throws SQLException ,IOException ; 74 75 public abstract long doGetLastMessageBrokerSequenceId(TransactionContext c) throws SQLException ,IOException ; 76 77 public abstract Set doGetDestinations(TransactionContext c) throws SQLException ,IOException ; 78 79 public abstract void setUseExternalMessageReferences(boolean useExternalMessageReferences); 80 81 public abstract SubscriptionInfo[] doGetAllSubscriptions(TransactionContext c,ActiveMQDestination destination) 82 throws SQLException ,IOException ; 83 84 public int doGetDurableSubscriberMessageCount(TransactionContext c,ActiveMQDestination destination,String clientId, 85 String subscriptionName) throws SQLException ,IOException ; 86 87 public int doGetMessageCount(TransactionContext c, ActiveMQDestination destination) throws SQLException , IOException ; 88 89 public void doRecoverNextMessages(TransactionContext c,ActiveMQDestination destination,long nextSeq,int maxReturned, 90 JDBCMessageRecoveryListener listener) throws Exception ; 91 92 public long doGetLastAckedDurableSubscriberMessageId(TransactionContext c,ActiveMQDestination destination,String clientId, String subscriberName) throws SQLException ,IOException ; 93 } 94 | Popular Tags |