|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.hs.mail.imap.mailbox.DefaultMailboxManager
public class DefaultMailboxManager
Constructor Summary | |
---|---|
DefaultMailboxManager()
|
Method Summary | |
---|---|
void |
addEventListener(EventListener listener)
|
void |
addMessage(long ownerID,
MailMessage message,
String mailboxName)
Appends a message to the user's INBOX. |
void |
addSubscription(long userID,
long mailboxID,
String mailboxName)
Subscribe the user to the given mailbox. |
void |
appendMessage(long mailboxID,
Date internalDate,
javax.mail.Flags flags,
File file)
Appends a message to this mailbox. |
void |
copyMessage(long uid,
long mailboxID)
Copies a message to the given mailbox. |
Mailbox |
createMailbox(long ownerID,
String mailboxName)
Creates a new mailbox. |
void |
deleteMailbox(long ownerID,
long mailboxID,
boolean delete)
Delete or empty a mailbox from store. |
void |
deleteMessage(long uid)
Deletes the given message. |
void |
deleteSubscription(long userID,
String mailboxName)
Unsubscribes the user from the given mailbox. |
void |
destroy()
|
List<Long> |
expunge(long mailboxID)
Gets the UIDs of messages which has /Deleted flag. |
List<Mailbox> |
getChildren(long userID,
long ownerID,
String mailboxName,
boolean subscribed)
|
EventDispatcher |
getEventDispatcher()
|
javax.mail.Flags |
getFlags(long uid)
|
Map<String,String> |
getHeader(long physMessageID)
Gets the headers of the message. |
Map<String,String> |
getHeader(long physMessageID,
String[] fields)
Gets the headers of the message. |
Mailbox |
getMailbox(long ownerID,
String mailboxName)
Returns user's Mailbox with a given path |
List<Long> |
getMailboxIDList(String mailboxName)
|
FetchData |
getMessageFetchData(long uid)
|
List<Long> |
getMessageIDList(long mailboxID)
|
org.springframework.transaction.support.TransactionTemplate |
getTransactionTemplate()
|
boolean |
hasChildren(Mailbox mailbox)
Does the mailbox have inferior child mailboxes? |
boolean |
isSubscribed(long userID,
String mailboxName)
Check if given mailbox is subscribed to user |
boolean |
mailboxExists(long ownerID,
String mailboxName)
Check if given mailbox exists. |
void |
removeEventListener(EventListener listener)
|
void |
renameMailbox(Mailbox source,
String targetName)
Renames a mailbox. |
void |
resetRecent(long mailboxID)
|
List<Long> |
search(UidToMsnMapper map,
long mailboxID,
SearchKey key)
Searches for the messages matching the given query. |
void |
setFetchDataCache(net.sf.ehcache.Ehcache cache)
|
void |
setFlags(long uid,
javax.mail.Flags flags,
boolean replace,
boolean set)
Sets flags on this message. |
void |
setHeaderCache(net.sf.ehcache.Ehcache cache)
|
void |
setTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultMailboxManager()
Method Detail |
---|
public void setTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager)
public org.springframework.transaction.support.TransactionTemplate getTransactionTemplate()
public void setFetchDataCache(net.sf.ehcache.Ehcache cache)
public void setHeaderCache(net.sf.ehcache.Ehcache cache)
public EventDispatcher getEventDispatcher()
getEventDispatcher
in interface MailboxManager
public void addEventListener(EventListener listener)
addEventListener
in interface MailboxManager
public void removeEventListener(EventListener listener)
removeEventListener
in interface MailboxManager
public Mailbox getMailbox(long ownerID, String mailboxName)
MailboxManager
Mailbox
with a given path
getMailbox
in interface MailboxManager
ownerID
- owner of the mailboxmailboxName
- path to the mailbox
Mailbox
public boolean mailboxExists(long ownerID, String mailboxName)
MailboxManager
mailboxExists
in interface MailboxManager
ownerID
- owner of this mailboxmailboxName
- the name of mailbox for checking existence
public List<Mailbox> getChildren(long userID, long ownerID, String mailboxName, boolean subscribed)
getChildren
in interface MailboxManager
public List<Long> getMailboxIDList(String mailboxName)
getMailboxIDList
in interface MailboxManager
public boolean hasChildren(Mailbox mailbox)
MailboxManager
hasChildren
in interface MailboxManager
mailbox
- ID of the mailbox
public List<Long> expunge(long mailboxID)
MailboxManager
expunge
in interface MailboxManager
mailboxID
- ID of mailbox
public List<Long> search(UidToMsnMapper map, long mailboxID, SearchKey key)
MailboxManager
search
in interface MailboxManager
map
- UID to MSN converting mapmailboxID
- ID of mailbox to searchkey
- the search query
public Mailbox createMailbox(long ownerID, String mailboxName)
MailboxManager
createMailbox
in interface MailboxManager
ownerID
- owner of the mailboxmailboxName
- the name of mailbox to create
Mailbox
createdpublic void renameMailbox(Mailbox source, String targetName)
MailboxManager
renameMailbox
in interface MailboxManager
source
- original mailboxtargetName
- new name for the mailboxpublic void deleteMailbox(long ownerID, long mailboxID, boolean delete)
MailboxManager
deleteMailbox
in interface MailboxManager
ownerID
- ID of the user who owns the mailboxmailboxID
- ID of the mailboxdelete
- true when delete, false when emptypublic boolean isSubscribed(long userID, String mailboxName)
MailboxManager
isSubscribed
in interface MailboxManager
userID
- ID of user
public void addSubscription(long userID, long mailboxID, String mailboxName)
MailboxManager
addSubscription
in interface MailboxManager
userID
- ID of the usermailboxID
- ID of the mailbox to subscribepublic void deleteSubscription(long userID, String mailboxName)
MailboxManager
deleteSubscription
in interface MailboxManager
public FetchData getMessageFetchData(long uid)
getMessageFetchData
in interface MailboxManager
public javax.mail.Flags getFlags(long uid)
getFlags
in interface MailboxManager
public List<Long> getMessageIDList(long mailboxID)
getMessageIDList
in interface MailboxManager
public void addMessage(long ownerID, MailMessage message, String mailboxName)
MailboxManager
addMessage
in interface MailboxManager
public void appendMessage(long mailboxID, Date internalDate, javax.mail.Flags flags, File file) throws IOException
MailboxManager
appendMessage
in interface MailboxManager
mailboxID
- ID of mailbox to append a messageinternalDate
- the time of addition to be setflags
- optionally set these flags on created message, or null when no
additional flags should be setfile
- the file containing the mail contents
IOException
public void deleteMessage(long uid)
MailboxManager
deleteMessage
in interface MailboxManager
uid
- ID of the message to deletepublic void copyMessage(long uid, long mailboxID)
MailboxManager
copyMessage
in interface MailboxManager
uid
- ID of the message to copymailboxID
- ID of mailbox where message will be copiedpublic void resetRecent(long mailboxID)
resetRecent
in interface MailboxManager
public void setFlags(long uid, javax.mail.Flags flags, boolean replace, boolean set)
MailboxManager
setFlags
in interface MailboxManager
uid
- ID of the message to set flagsflags
- flags to be setreplace
- true if to replaceset
- true if to set, false to resetpublic Map<String,String> getHeader(long physMessageID)
getHeader
in interface MailboxManager
physMessageID
- ID of the physical message
public Map<String,String> getHeader(long physMessageID, String[] fields)
MailboxManager
getHeader
in interface MailboxManager
physMessageID
- ID of the physical messagefields
- Array of fields to retrieve
public void destroy() throws Exception
destroy
in interface org.springframework.beans.factory.DisposableBean
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |