public class InMemoryMailboxMapper extends Object implements MailboxMapper<Long>
Mapper.Transaction<T>, Mapper.VoidTransaction| Constructor and Description |
|---|
InMemoryMailboxMapper() |
| Modifier and Type | Method and Description |
|---|---|
void |
delete(Mailbox<Long> mailbox)
Delete the given
Mailbox from the underlying storage |
void |
deleteAll() |
void |
endRequest()
Do nothing
|
<T> T |
execute(Mapper.Transaction<T> transaction)
Execute the given Transaction
|
Mailbox<Long> |
findMailboxByPath(MailboxPath path)
Return the
Mailbox for the given name |
List<Mailbox<Long>> |
findMailboxWithPathLike(MailboxPath path)
Return a List of
Mailbox which name is like the given name |
boolean |
hasChildren(Mailbox<Long> mailbox,
char delimiter)
Return if the given
Mailbox has children |
List<Mailbox<Long>> |
list()
|
void |
save(Mailbox<Long> mailbox)
Save the give
Mailbox to the underlying storage |
public void delete(Mailbox<Long> mailbox) throws MailboxException
MailboxMapperMailbox from the underlying storagedelete in interface MailboxMapper<Long>MailboxExceptionMailboxMapper.delete(org.apache.james.mailbox.store.mail.model.Mailbox)public void deleteAll()
throws MailboxException
MailboxExceptionpublic Mailbox<Long> findMailboxByPath(MailboxPath path) throws MailboxException, MailboxNotFoundException
MailboxMapperMailbox for the given namefindMailboxByPath in interface MailboxMapper<Long>MailboxExceptionMailboxNotFoundExceptionMailboxMapper.findMailboxByPath(org.apache.james.mailbox.model.MailboxPath)public List<Mailbox<Long>> findMailboxWithPathLike(MailboxPath path) throws MailboxException
MailboxMapperMailbox which name is like the given namefindMailboxWithPathLike in interface MailboxMapper<Long>MailboxExceptionMailboxMapper.findMailboxWithPathLike(org.apache.james.mailbox.model.MailboxPath)public void save(Mailbox<Long> mailbox) throws MailboxException
MailboxMapperMailbox to the underlying storagesave in interface MailboxMapper<Long>MailboxExceptionMailboxMapper.save(org.apache.james.mailbox.store.mail.model.Mailbox)public void endRequest()
endRequest in interface Mapperpublic boolean hasChildren(Mailbox<Long> mailbox, char delimiter) throws MailboxException, MailboxNotFoundException
MailboxMapperMailbox has childrenhasChildren in interface MailboxMapper<Long>mailbox - not nulldelimiter - path delimiterMailboxExceptionMailboxNotFoundExceptionMailboxMapper.hasChildren(org.apache.james.mailbox.store.mail.model.Mailbox, char)public List<Mailbox<Long>> list() throws MailboxException
MailboxMapperlist in interface MailboxMapper<Long>MailboxExceptionMailboxMapper.list()public <T> T execute(Mapper.Transaction<T> transaction) throws MailboxException
Mapperexecute in interface MapperMailboxExceptionCopyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.