KickJava   Java API By Example, From Geeks To Geeks.

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


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 org.apache.james.imapserver.AuthenticationException;
21
22 import java.util.Iterator JavaDoc;
23
24 /**
25  * An IMAP4rev1 messaging system, possible containing multiple Hosts. There
26  * should be one instance of this class per instance of James.
27  * <p> An IMAP messaging system may span more than one server.
28  *
29  * References: rfc 2060, rfc 2193, rfc 2221
30  * @version 0.1 on 14 Dec 2000
31  * @see Host
32  */

33 public interface IMAPSystem {
34
35     String JavaDoc ROLE = "org.apache.james.imapserver.IMAPSystem";
36
37     String JavaDoc IMAP_SYSTEM = "IMAP_SYSTEM";
38     String JavaDoc PRIVATE = "Private";
39     String JavaDoc OTHER_USERS = "OtherUsers";
40     String JavaDoc SHARED = "Shared";
41
42     /**
43      * Returns the token indicating a namespace. Implementation dependent but
44      * by convention, '#'.
45      * Example: #news.org.apache vs #mail.org.apache
46      */

47     String JavaDoc getNamespaceToken();
48
49     /**
50      * Returns the home server (server with user's INBOX) for specified user.
51      * Enables Login Referrals per RFC2221. (Ie user attempts to login to a
52      * server which is not their Home Server.) The returned string must comply
53      * with RFC2192, IMAP URL Scheme.
54      *
55      * @param username String representation of a user
56      * @return String holding an IMAP URL for the user's home server
57      * @throws AuthenticationException if this System does not recognise
58      * the user.
59      */

60     String JavaDoc getHomeServer( String JavaDoc username )
61         throws AuthenticationException;
62
63     /**
64      * Returns the character used as a mail hierarchy separator in a given
65      * namespace. A namespace must use the same separator at all levels of
66      * hierarchy.
67      * <p>Recommendations (from rfc 2683) are period (US)/ full stop (Brit),
68      * forward slash or backslash.
69      *
70      * @param namespace String identifying a namespace
71      * @return char, usually '.', '/', or '\'
72      */

73     String JavaDoc getHierarchySeperator( String JavaDoc namespace );
74
75     /**
76      * Provides the set of namespaces a given user can access. Implementations
77      * should, but are not required to, reveal all namespaces that a user can
78      * access. Different namespaces may be handled by different
79      * <code>IMAPHosts</code>
80      *
81      * @param username String identifying a user of this System
82      * @return String whose contents should be a space seperated triple
83      * <personal namespaces(s)> space <other users' namespace(s)> space
84      * <shared namespace(s)>, per RFC2342
85      */

86     String JavaDoc getNamespaces( String JavaDoc username );
87
88     /**
89      * Returns an iterator over the collection of servers on which this user
90      * has access. The collection should be unmodifiable.
91      * Enable Mailbox Referrals - RFC 2193.
92      *
93      * @param username String identifying a user
94      * @return iterator over a collection of strings
95      */

96     Iterator JavaDoc getAccessibleServers( String JavaDoc username );
97 }
98
Popular Tags