KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > sandesha > IStorageManager


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * 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
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */

17 package org.apache.sandesha;
18
19 import org.apache.sandesha.storage.Callback;
20
21 import java.util.Map JavaDoc;
22
23 /**
24  * Interface for StorageManager. This is the interface for RMSource and RMDestination for the
25  * Storage. Any implementation of this interface can be used as the storage for Sandesha
26  */

27 public interface IStorageManager {
28     void init();
29
30     boolean isSequenceExist(String JavaDoc sequenceID);
31
32     boolean isResponseSequenceExist(String JavaDoc sequenceID);
33
34     Object JavaDoc getNextSeqToProcess();
35
36     RMMessageContext getNextMessageToProcess(Object JavaDoc seq);
37
38     void setAcknowledged(String JavaDoc seqID, long msgNumber);
39
40     void addSequence(String JavaDoc sequenceID);
41
42     void addCreateSequenceResponse(RMMessageContext rmMessageContext);
43
44     void addCreateSequenceRequest(RMMessageContext rmMessageContext);
45
46     void addAcknowledgement(RMMessageContext rmMessageContext);
47
48     boolean isMessageExist(String JavaDoc sequenceID, long messageNumber);
49
50     Map JavaDoc getListOfMessageNumbers(String JavaDoc sequenceID);
51
52     RMMessageContext getNextMessageToSend();
53
54     void setTemporaryOutSequence(String JavaDoc sequenceId, String JavaDoc outSequenceId);
55
56     boolean setApprovedOutSequence(String JavaDoc oldOutsequenceId, String JavaDoc newOutSequenceId);
57
58     long getNextMessageNumber(String JavaDoc sequenceID);
59
60     void insertOutgoingMessage(RMMessageContext rmMessageContext);
61
62     void insertIncomingMessage(RMMessageContext rmMessageContext);
63
64     RMMessageContext checkForResponseMessage(String JavaDoc sequenceId, String JavaDoc requestMsgId);
65
66     void insertTerminateSeqMessage(RMMessageContext terminateSeqMessage);
67
68     void setAckReceived(String JavaDoc seqId, long msgNo);
69
70     void insertFault(RMMessageContext rmMsgCtx);
71
72     void addSendMsgNo(String JavaDoc seqId, long msgNo);
73
74     boolean isSentMsg(String JavaDoc seqId, long msgNo);
75
76     boolean hasLastIncomingMsgReceived(String JavaDoc seqId);
77
78     long getLastIncomingMsgNo(String JavaDoc seqId);
79
80     void addOutgoingSequence(String JavaDoc seqId);
81
82     void addIncomingSequence(String JavaDoc seqId);
83
84     String JavaDoc getOutgoingSeqOfMsg(String JavaDoc msgId);
85
86     void addRequestedSequence(String JavaDoc seqId);
87
88     boolean isRequestedSeqPresent(String JavaDoc seqId);
89
90     String JavaDoc getOutgoingSeqenceIdOfIncomingMsg(RMMessageContext msg);
91
92     void setTerminateSend(String JavaDoc seqId);
93
94     void setTerminateReceived(String JavaDoc seqId);
95
96     String JavaDoc getKeyFromOutgoingSeqId(String JavaDoc seqId);
97
98     void setAcksTo(String JavaDoc seqId, String JavaDoc acksTo);
99
100     String JavaDoc getAcksTo(String JavaDoc seqId);
101
102     void setCallback(Callback callBack);
103
104     void removeCallback();
105
106     void addOffer(String JavaDoc msgID, String JavaDoc offerID);
107
108     String JavaDoc getOffer(String JavaDoc msgID);
109
110     void clearStorage();
111
112     boolean isSequenceComplete(String JavaDoc seqId);
113
114     void sendAck(String JavaDoc sequenceId);
115 }
Popular Tags