|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.james.mailrepository.file.MBoxMailRepository
public class MBoxMailRepository
Implementation of a MailRepository using UNIX mbox files.
Requires a configuration element in the .conf.xml file of the form:
<repository destinationURL="mbox://<directory>"
type="MAIL"
</directory> is where the individual mbox files are read from/written to
Type can ONLY be MAIL (SPOOL is NOT supported)
Requires a logger called MailRepository.
Implementation notes:
This class keeps an internal store of the mbox file When the internal mbox file is updated (added/deleted) then the file will be re-read from disk and then written back. This is a bit inefficent but means that the file on disk should be correct.
The mbox store is mainly meant to be used as a one-way street. Storing new emails is very fast (append to file) whereas reading them (via POP3) is slower (read from disk and parse). Therefore this implementation is best suited to people who wish to use the mbox format for taking data out of James and into something else (IMAP server or mail list displayer)
| Nested Class Summary | |
|---|---|
static interface |
MBoxMailRepository.MessageAction
A callback used when a message is read from the mbox file |
| Constructor Summary | |
|---|---|
MBoxMailRepository()
|
|
| Method Summary | |
|---|---|
void |
configure(org.apache.commons.configuration.HierarchicalConfiguration configuration)
|
protected org.apache.commons.logging.Log |
getLogger()
|
java.util.Iterator<java.lang.String> |
list()
|
boolean |
lock(java.lang.String key)
|
void |
remove(java.util.Collection<org.apache.mailet.Mail> mails)
|
void |
remove(org.apache.mailet.Mail mail)
|
void |
remove(java.lang.String key)
|
org.apache.mailet.Mail |
retrieve(java.lang.String key)
|
void |
setLog(org.apache.commons.logging.Log logger)
|
void |
store(org.apache.mailet.Mail mc)
|
boolean |
unlock(java.lang.String key)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MBoxMailRepository()
| Method Detail |
|---|
public void setLog(org.apache.commons.logging.Log logger)
setLog in interface LogEnabled
public void configure(org.apache.commons.configuration.HierarchicalConfiguration configuration)
throws org.apache.commons.configuration.ConfigurationException
configure in interface Configurableorg.apache.commons.configuration.ConfigurationExceptionprotected org.apache.commons.logging.Log getLogger()
public void store(org.apache.mailet.Mail mc)
store in interface MailRepositoryMailRepository.store(Mail)public java.util.Iterator<java.lang.String> list()
list in interface MailRepositoryMailRepository.list()public org.apache.mailet.Mail retrieve(java.lang.String key)
retrieve in interface MailRepositoryMailRepository.retrieve(String)public void remove(org.apache.mailet.Mail mail)
remove in interface MailRepositoryMailRepository.remove(Mail)public void remove(java.util.Collection<org.apache.mailet.Mail> mails)
remove in interface MailRepositoryMailRepository.remove(Collection)public void remove(java.lang.String key)
remove in interface MailRepositoryMailRepository.remove(String)public boolean lock(java.lang.String key)
lock in interface MailRepositoryMailRepository.lock(String)public boolean unlock(java.lang.String key)
unlock in interface MailRepositoryMailRepository.unlock(String)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||