SK.gnome.dwarf.mail.store
Interface UserStore

All Known Implementing Classes:
FileUserStore

public interface UserStore

This class provides interface for user store.

The user store is used by mail servers for storing a user-specific information, such as a mail session state, client software configuration, etc. Different servers use different methods, therefore only those may be implemented which are really required byt the current application setup.


Method Summary
 void create(java.lang.String user)
          Creates a user store for the given user.
 boolean exists(java.lang.String user)
          Whether the given user's store exists.
 java.io.InputStream getAutoReply(java.lang.String user)
          Returns an automatic reply message for the given user.
 java.lang.String[] getForwardAddress(java.lang.String user)
          Returns a list of forward addresses associated with the given user.
 boolean hasSubscribed(java.lang.String user, java.lang.String mailbox)
          Whether the mailbox is subscribed for the given user.
 java.lang.String[] listUsers()
          Returns a list of all users present in this mail store.
 Options readOptions(java.lang.String user)
          Reads the webmail user options.
 void remove(java.lang.String user)
          Removes the given user's store.
 void storeOptions(java.lang.String user, Options options)
          Stores the webmail user options.
 void subscribe(java.lang.String user, java.lang.String mailbox)
          Subscribes the mailbox for the given user.
 void unsubscribe(java.lang.String user, java.lang.String mailbox)
          Unsubscribes the mailbox for the given user.
 

Method Detail

create

public void create(java.lang.String user)
            throws MailException
Creates a user store for the given user.

Parameters:
user - the user identification
Throws:
MailException - if an error occured

exists

public boolean exists(java.lang.String user)
               throws MailException
Whether the given user's store exists.

This method must be always implemented.

Parameters:
user - the user identification
Returns:
true if the store exists, false otherwise
Throws:
MailException - if an error occured

remove

public void remove(java.lang.String user)
            throws MailException
Removes the given user's store.

This method must be always implemented.

Parameters:
user - the user identification
Throws:
MailException - if an error occured

listUsers

public java.lang.String[] listUsers()
                             throws MailException
Returns a list of all users present in this mail store.

This method must be always implemented.

Returns:
the array of user identifications
Throws:
MailException - if an error occured

getForwardAddress

public java.lang.String[] getForwardAddress(java.lang.String user)
                                     throws MailException
Returns a list of forward addresses associated with the given user.

This method must be implemented for SMTPServer setup.

Parameters:
user - the user identification
Returns:
the array of internet email addresses
Throws:
MailException - if an error occured

getAutoReply

public java.io.InputStream getAutoReply(java.lang.String user)
                                 throws java.io.IOException,
                                        MailException
Returns an automatic reply message for the given user.

This method must be implemented for SMTPServer setup.

Parameters:
user - the user identification
Returns:
the reply message as an input stream
Throws:
java.io.IOException - if an I/O error occured
MailException - if an error occured

hasSubscribed

public boolean hasSubscribed(java.lang.String user,
                             java.lang.String mailbox)
                      throws MailException
Whether the mailbox is subscribed for the given user.

This method must be implemented for IMAPServer setup.

Parameters:
user - the user identification
mailbox - the full mailbox name
Returns:
true if the mailbox is subscribed, false otherwise
Throws:
MailException - if an error occured

subscribe

public void subscribe(java.lang.String user,
                      java.lang.String mailbox)
               throws MailException
Subscribes the mailbox for the given user.

This method must be implemented for IMAPServer setup.

Parameters:
user - the user identification
mailbox - the full mailbox name
Throws:
MailException - if an error occured

unsubscribe

public void unsubscribe(java.lang.String user,
                        java.lang.String mailbox)
                 throws MailException
Unsubscribes the mailbox for the given user.

This method must be implemented for IMAPServer setup.

Parameters:
user - the user identification
mailbox - the full mailbox name
Throws:
MailException - if an error occured

readOptions

public Options readOptions(java.lang.String user)
                    throws MailException
Reads the webmail user options.

Returns null if there are no user options for the given user currently stored.

This method must be implemented for Webmail setup.

Parameters:
user - the user identification
Returns:
the user options or null
Throws:
MailException - if an error occured

storeOptions

public void storeOptions(java.lang.String user,
                         Options options)
                  throws MailException
Stores the webmail user options.

This method must be implemented for Webmail setup.

Parameters:
user - the user identification
options - the user options
Throws:
MailException - if an error occured


Copyright (c) 2004-2005, Gnome Ltd. All rights reserved.