KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > activemq > kaha > Store


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

18 package org.apache.activemq.kaha;
19
20 import java.io.IOException JavaDoc;
21 import java.util.Set JavaDoc;
22 /**
23  * A Store is holds persistent containers
24  *
25  * @version $Revision: 1.2 $
26  */

27 public interface Store{
28     /**
29      * Defauly container name
30      */

31     public static final String JavaDoc DEFAULT_CONTAINER_NAME="kaha";
32
33     /**
34      * Byte Marshaller
35      */

36     public final static Marshaller BytesMarshaller = new BytesMarshaller();
37     
38     /**
39      * Object Marshaller
40      */

41     public final static Marshaller ObjectMarshaller = new ObjectMarshaller();
42     
43     /**
44      * String Marshaller
45      */

46     public final static Marshaller StringMarshaller = new StringMarshaller();
47     /**
48      * close the store
49      *
50      * @throws IOException
51      */

52     public void close() throws IOException JavaDoc;
53
54     /**
55      * Force all writes to disk
56      *
57      * @throws IOException
58      */

59     public void force() throws IOException JavaDoc;
60
61     /**
62      * empty all the contents of the store
63      *
64      * @throws IOException
65      */

66     public void clear() throws IOException JavaDoc;
67
68     /**
69      * delete the store
70      *
71      * @return true if the delete was successful
72      * @throws IOException
73      */

74     public boolean delete() throws IOException JavaDoc;
75
76     /**
77      * Checks if a MapContainer exists in the default container
78      *
79      * @param id
80      * @return new MapContainer
81      * @throws IOException
82      */

83     public boolean doesMapContainerExist(Object JavaDoc id) throws IOException JavaDoc;
84     
85     /**
86      * Checks if a MapContainer exists in the named container
87      *
88      * @param id
89      * @param containerName
90      * @return new MapContainer
91      * @throws IOException
92      */

93     public boolean doesMapContainerExist(Object JavaDoc id,String JavaDoc containerName) throws IOException JavaDoc;
94
95     /**
96      * Get a MapContainer with the given id - the MapContainer is created if needed
97      *
98      * @param id
99      * @return container for the associated id or null if it doesn't exist
100      * @throws IOException
101      */

102      public MapContainer getMapContainer(Object JavaDoc id) throws IOException JavaDoc;
103
104     /**
105      * Get a MapContainer with the given id - the MapContainer is created if needed
106      *
107      * @param id
108      * @param containerName
109      * @return container for the associated id or null if it doesn't exist
110      * @throws IOException
111      */

112     public MapContainer getMapContainer(Object JavaDoc id,String JavaDoc containerName) throws IOException JavaDoc;
113     
114     /**
115      * Get a MapContainer with the given id - the MapContainer is created if needed
116      *
117      * @param id
118      * @param containerName
119      * @param persistentIndex
120      * @return container for the associated id or null if it doesn't exist
121      * @throws IOException
122      */

123     public MapContainer getMapContainer(Object JavaDoc id,String JavaDoc containerName,boolean persistentIndex) throws IOException JavaDoc;
124
125     /**
126      * delete a container from the default container
127      *
128      * @param id
129      * @throws IOException
130      */

131     public void deleteMapContainer(Object JavaDoc id) throws IOException JavaDoc;
132     
133     /**
134      * delete a MapContainer from the name container
135      *
136      * @param id
137      * @param containerName
138      * @throws IOException
139      */

140     public void deleteMapContainer(Object JavaDoc id,String JavaDoc containerName) throws IOException JavaDoc;
141     
142     /**
143      * Delete Map container
144      * @param id
145      * @throws IOException
146      */

147     public void deleteMapContainer(ContainerId id) throws IOException JavaDoc;
148
149     /**
150      * Get a Set of call MapContainer Ids
151      *
152      * @return the set of ids
153      * @throws IOException
154      */

155     public Set JavaDoc<ContainerId> getMapContainerIds() throws IOException JavaDoc;
156
157     /**
158      * Checks if a ListContainer exists in the default container
159      *
160      * @param id
161      * @return new MapContainer
162      * @throws IOException
163      */

164     public boolean doesListContainerExist(Object JavaDoc id) throws IOException JavaDoc;
165     
166     /**
167      * Checks if a ListContainer exists in the named container
168      *
169      * @param id
170      * @param containerName
171      * @return new MapContainer
172      * @throws IOException
173      */

174     public boolean doesListContainerExist(Object JavaDoc id,String JavaDoc containerName) throws IOException JavaDoc;
175
176     /**
177      * Get a ListContainer with the given id and creates it if it doesn't exist
178      *
179      * @param id
180      * @return container for the associated id or null if it doesn't exist
181      * @throws IOException
182      */

183      public ListContainer getListContainer(Object JavaDoc id) throws IOException JavaDoc;
184
185     /**
186      * Get a ListContainer with the given id and creates it if it doesn't exist
187      *
188      * @param id
189      * @param containerName
190      * @return container for the associated id or null if it doesn't exist
191      * @throws IOException
192      */

193     public ListContainer getListContainer(Object JavaDoc id,String JavaDoc containerName) throws IOException JavaDoc;
194     
195     /**
196      * Get a ListContainer with the given id and creates it if it doesn't exist
197      *
198      * @param id
199      * @param containerName
200      * @param persistentIndex
201      * @return container for the associated id or null if it doesn't exist
202      * @throws IOException
203      */

204     public ListContainer getListContainer(Object JavaDoc id,String JavaDoc containerName,boolean persistentIndex) throws IOException JavaDoc;
205
206     /**
207      * delete a ListContainer from the default container
208      *
209      * @param id
210      * @throws IOException
211      */

212     public void deleteListContainer(Object JavaDoc id) throws IOException JavaDoc;
213     
214     /**
215      * delete a ListContainer from the named container
216      *
217      * @param id
218      * @param containerName
219      * @throws IOException
220      */

221     public void deleteListContainer(Object JavaDoc id,String JavaDoc containerName) throws IOException JavaDoc;
222
223     /**
224      * delete a list container
225      * @param id
226      * @throws IOException
227      */

228     public void deleteListContainer(ContainerId id) throws IOException JavaDoc;
229
230     /**
231      * Get a Set of call ListContainer Ids
232      *
233      * @return the set of ids
234      * @throws IOException
235      */

236     public Set JavaDoc<ContainerId> getListContainerIds() throws IOException JavaDoc;
237     
238     /**
239      * @return the maxDataFileLength
240      */

241     public long getMaxDataFileLength();
242
243     /**
244      * @param maxDataFileLength the maxDataFileLength to set
245      */

246     public void setMaxDataFileLength(long maxDataFileLength);
247     
248     /**
249      * @see org.apache.activemq.kaha.IndexTypes
250      * @return the default index type
251      */

252     public String JavaDoc getIndexTypeAsString();
253     
254     /**
255      * Set the default index type
256      * @param type
257      * @see org.apache.activemq.kaha.IndexTypes
258      */

259     public void setIndexTypeAsString(String JavaDoc type);
260     
261     /**
262      * @return true if the store has been initialized
263      */

264     public boolean isInitialized();
265 }
266
Popular Tags