SK.gnome.dwarf.mail.store
Class FileUserStore

java.lang.Object
  extended bySK.gnome.dwarf.GenericService
      extended bySK.gnome.dwarf.mail.store.GenericFileStore
          extended bySK.gnome.dwarf.mail.store.FileUserStore
All Implemented Interfaces:
SK.gnome.dwarf.Service, UserStore

public class FileUserStore
extends GenericFileStore
implements UserStore

This class provides a filesystem-based user store.


Field Summary
 
Fields inherited from class SK.gnome.dwarf.mail.store.GenericFileStore
autoCreate, backupObjects, letterSubdirs, userBaseDir
 
Fields inherited from class SK.gnome.dwarf.GenericService
initParameters, parent
 
Fields inherited from interface SK.gnome.dwarf.Service
INITIALIZED, LOG_DEBUG, LOG_ERROR, LOG_FATAL, LOG_INFO, LOG_TRACE, LOG_WARN, LOG_XFER, SHUTDOWN, STARTED, STOPPED
 
Constructor Summary
FileUserStore(java.lang.String name)
          Creates a new FileUserStore.
 
Method Summary
 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.
 Options readOptions(java.lang.String user)
          Reads the webmail user options.
 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.
 
Methods inherited from class SK.gnome.dwarf.mail.store.GenericFileStore
create, exists, getUserDirectory, init, listUsers, lock, readObject, remove, setAutoCreate, setBackupObjects, setLetterSubdirs, setUserBaseDir, storeObject, unlock
 
Methods inherited from class SK.gnome.dwarf.GenericService
getAuthenticator, getAuthFacility, getFullName, getInitParameter, getInitParameterNames, getLogFacility, getLogger, getName, getParameters, getPrincipal, getShutdownTimeout, getState, log, log, login, logout, setAuthFacility, setInitParameters, setLogFacility, shutdown, start, stop, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface SK.gnome.dwarf.mail.store.UserStore
create, exists, listUsers, remove
 

Constructor Detail

FileUserStore

public FileUserStore(java.lang.String name)
Creates a new FileUserStore.

Method Detail

getForwardAddress

public java.lang.String[] getForwardAddress(java.lang.String user)
                                     throws MailException
Description copied from interface: UserStore
Returns a list of forward addresses associated with the given user.

This method must be implemented for SMTPServer setup.

Specified by:
getForwardAddress in interface UserStore
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
Description copied from interface: UserStore
Returns an automatic reply message for the given user.

This method must be implemented for SMTPServer setup.

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

hasSubscribed

public boolean hasSubscribed(java.lang.String user,
                             java.lang.String mailbox)
                      throws MailException
Description copied from interface: UserStore
Whether the mailbox is subscribed for the given user.

This method must be implemented for IMAPServer setup.

Specified by:
hasSubscribed in interface UserStore
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
Description copied from interface: UserStore
Subscribes the mailbox for the given user.

This method must be implemented for IMAPServer setup.

Specified by:
subscribe in interface UserStore
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
Description copied from interface: UserStore
Unsubscribes the mailbox for the given user.

This method must be implemented for IMAPServer setup.

Specified by:
unsubscribe in interface UserStore
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
Description copied from interface: UserStore
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.

Specified by:
readOptions in interface UserStore
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
Description copied from interface: UserStore
Stores the webmail user options.

This method must be implemented for Webmail setup.

Specified by:
storeOptions in interface UserStore
Parameters:
user - the user identification
options - the user options
Throws:
MailException - if an error occured


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