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
MailboxMapper
Mailbox
from the underlying storagedelete
in interface MailboxMapper<Long>
MailboxException
MailboxMapper.delete(org.apache.james.mailbox.store.mail.model.Mailbox)
public void deleteAll() throws MailboxException
MailboxException
public Mailbox<Long> findMailboxByPath(MailboxPath path) throws MailboxException, MailboxNotFoundException
MailboxMapper
Mailbox
for the given namefindMailboxByPath
in interface MailboxMapper<Long>
MailboxException
MailboxNotFoundException
MailboxMapper.findMailboxByPath(org.apache.james.mailbox.model.MailboxPath)
public List<Mailbox<Long>> findMailboxWithPathLike(MailboxPath path) throws MailboxException
MailboxMapper
Mailbox
which name is like the given namefindMailboxWithPathLike
in interface MailboxMapper<Long>
MailboxException
MailboxMapper.findMailboxWithPathLike(org.apache.james.mailbox.model.MailboxPath)
public void save(Mailbox<Long> mailbox) throws MailboxException
MailboxMapper
Mailbox
to the underlying storagesave
in interface MailboxMapper<Long>
MailboxException
MailboxMapper.save(org.apache.james.mailbox.store.mail.model.Mailbox)
public void endRequest()
endRequest
in interface Mapper
public boolean hasChildren(Mailbox<Long> mailbox, char delimiter) throws MailboxException, MailboxNotFoundException
MailboxMapper
Mailbox
has childrenhasChildren
in interface MailboxMapper<Long>
mailbox
- not nulldelimiter
- path delimiterMailboxException
MailboxNotFoundException
MailboxMapper.hasChildren(org.apache.james.mailbox.store.mail.model.Mailbox, char)
public List<Mailbox<Long>> list() throws MailboxException
MailboxMapper
list
in interface MailboxMapper<Long>
MailboxException
MailboxMapper.list()
public <T> T execute(Mapper.Transaction<T> transaction) throws MailboxException
Mapper
execute
in interface Mapper
MailboxException
Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.