|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object SK.gnome.dwarf.GenericService SK.gnome.dwarf.mail.store.GenericFileStore SK.gnome.dwarf.mail.store.FileMailStore
This class provides a filesystem-based mail 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 | |
FileMailStore(java.lang.String name)
Creates a new FileMailStore. |
Method Summary | |
void |
addMailEventListener(MailEventListener listener)
Adds the given mail event listener to this store. |
void |
dispatchMailEvent(MailEvent event)
Dispatches the given mail event to the registered listeners. |
MailFolder |
getDefaultFolder(java.lang.String user)
Returns a default folder for the given user. |
protected int |
getPreloadLimit()
Returns the maximum size of a message which will be always preloaded and cached in the memory. |
protected boolean |
getSharedAccess()
Whether the simultaneous multiple access to the same mail folder is enabled. |
MailFolder |
getSharedDefaultFolder()
|
protected java.lang.String |
getSharedPrefix()
Returns the prefix for the shared folders. |
void |
removeMailEventListener(MailEventListener listener)
Removes the given mail event listener from this store. |
void |
setPreloadLimit(int limit)
Maximum size for a message to be always preloaded into the memory. |
void |
setSharedAccess(boolean enable)
Enables or disables simultaneous access to the same mail folder. |
void |
setSharedPrefix(java.lang.String prefix)
Sets the prefix for the shared folders. |
void |
setSharedUser(java.lang.String user)
Sets the user account for sharing. |
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.MailStore |
create, exists, listUsers, remove |
Constructor Detail |
public FileMailStore(java.lang.String name)
Method Detail |
public void setSharedAccess(boolean enable)
If disabled, a folder will refuse call to MailFolder.open(int)
method if
MailFolder.isOpen()
already returns true.
This feature may be used to force mail storage to operate in the "single thread per mailbox" mode. It is recommended to disable the simultaneous access in very busy production servers.
Default value: true
enable
- true to enable the simultaneous access, false otherwisepublic void setPreloadLimit(int limit)
If this is a non-zero value and the particular message size is less or equal to it, the message content will be always loaded into memory and cached by the mail store from the time a mail folder is opened until it is closed. Higher limit means faster access to folders and messages, but also a higher memory footprint. Setting this attribute to zero completely disables this feature. A reasonable value for preloading limit is about 4096 bytes.
Default value: 0
limit
- the message size limit in bytespublic void setSharedUser(java.lang.String user)
The whole user's folder hierarchy will be mapped to the namespace of other users. It will
appear under a special folder, whose name must be set by the setSharedPrefix(String)
method.
user
- the name of the shared user accountpublic void setSharedPrefix(java.lang.String prefix)
This is the name of a special folder under which the shared account will appear in the namespace of other users.
prefix
- the shared folders prefixpublic MailFolder getDefaultFolder(java.lang.String user) throws MailException
MailStore
getDefaultFolder
in interface MailStore
user
- the user identification
MailException
- if an error occuredpublic MailFolder getSharedDefaultFolder() throws MailException
MailException
public void addMailEventListener(MailEventListener listener)
MailStore
addMailEventListener
in interface MailStore
listener
- the mail event listenerpublic void removeMailEventListener(MailEventListener listener)
MailStore
removeMailEventListener
in interface MailStore
listener
- the mail event listenerpublic final void dispatchMailEvent(MailEvent event)
MailStore
dispatchMailEvent
in interface MailStore
event
- the mail eventprotected boolean getSharedAccess()
setSharedAccess(boolean)
protected int getPreloadLimit()
setPreloadLimit(int)
protected java.lang.String getSharedPrefix()
setSharedPrefix(String)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |