View Javadoc

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