KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > activemq > store > jdbc > JDBCAdapter


1 /**
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE
4  * file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file
5  * to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
6  * License. You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
11  * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
12  * specific language governing permissions and limitations under the License.
13  */

14
15 package org.apache.activemq.store.jdbc;
16
17 import java.io.IOException JavaDoc;
18 import java.sql.SQLException JavaDoc;
19 import java.util.Set JavaDoc;
20 import org.apache.activemq.command.ActiveMQDestination;
21 import org.apache.activemq.command.MessageId;
22 import org.apache.activemq.command.SubscriptionInfo;
23
24 /**
25  * @version $Revision: 1.5 $
26  */

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