KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > james > imapserver > RecordRepository


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

17
18 package org.apache.james.imapserver;
19
20 import java.util.Iterator JavaDoc;
21
22 /**
23  * Interface for objects representing a Repository of FolderRecords.
24  * There should be a RecordRepository for every Host.
25  * <p>Note that there is no method for removing Records: an IMAP host is
26  * meant to retain information about deleted folders.
27  *
28  * @version 0.1 on 14 Dec 2000
29  * @see FolderRecord
30  */

31 public interface RecordRepository {
32
33     String JavaDoc RECORD = "RECORD";
34
35     /**
36      * Sets the location of this repository.
37      *
38      * @param rootPath String location of this repository
39      */

40     void setPath( String JavaDoc rootPath );
41
42     /**
43      * Stores a folder record in this repository.
44      *
45      * @param fr FolderRecord to be stored
46      */

47     void store( FolderRecord fr );
48       
49     /**
50      * Returns Iterator over names of folders in repository
51      *
52      * @return Iterator over Strings of AbsoluteNames of Folders. Calling
53      * objects cannot change contents of Iterator.
54      */

55     Iterator JavaDoc getAbsoluteNames();
56
57     /**
58      * Retrieves a folder record given the folder's full name.
59      *
60      * @param folderAbsoluteName String name of a folder
61      * @return FolderRecord for specified folder, null if no such FolderRecord
62      */

63     FolderRecord retrieve( String JavaDoc folderAbsoluteName );
64     
65     /**
66      * Tests if there is a folder record for the given folder name.
67      *
68      * @param folderAbsoluteName String name of a folder
69      * @return boolean True if there is a record for the specified folder.
70      */

71     boolean containsRecord( String JavaDoc folderAbsoluteName );
72
73     /**
74      * Returns the a unique UID validity value for this Host.
75      * UID validity values are used to differentiate messages in 2 mailboxes with the same names
76      * (when one is deleted).
77      */

78     int nextUIDValidity();
79
80     /**
81      * Deletes the FolderRecord from the repository.
82      */

83     void deleteRecord( FolderRecord record );
84 }
85
86     
87
Popular Tags