Package org.alfresco.repo.imap
Class AlfrescoImapHostManager
java.lang.Object
org.alfresco.repo.imap.AlfrescoImapHostManager
- All Implemented Interfaces:
com.icegreen.greenmail.imap.ImapHostManager
public class AlfrescoImapHostManager
extends Object
implements com.icegreen.greenmail.imap.ImapHostManager
This Host Manager is assumed to be session local, i.e. there is one instance per IMAP TCP connection. This means that it can locally cache items being interacted with during the session and its knowledge of which folders / messages do or do not exist will match that of the client.
- Author:
- Mike Shavnev, David Ward
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.icegreen.greenmail.store.MailFoldercreateMailbox(com.icegreen.greenmail.user.GreenMailUser user, String mailboxName) Returns a reference to a newly created mailbox.voidcreatePrivateMailAccount(com.icegreen.greenmail.user.GreenMailUser user) Not supported.voiddeleteMailbox(com.icegreen.greenmail.user.GreenMailUser user, String mailboxName) Deletes an existing MailBox.List<?>Not supported.com.icegreen.greenmail.store.MailFolderReturns a reference to an existing Mailbox.com.icegreen.greenmail.store.MailFolderSimply callsgetFolder(GreenMailUser, String).charReturns the hierarchy delimiter for mailboxes on this host.com.icegreen.greenmail.store.MailFoldergetInbox(com.icegreen.greenmail.user.GreenMailUser user) Returns a reference to the user's INBOX.Collection<com.icegreen.greenmail.store.MailFolder>listMailboxes(com.icegreen.greenmail.user.GreenMailUser user, String mailboxPattern) Returns an collection of mailboxes.Collection<com.icegreen.greenmail.store.MailFolder>listSubscribedMailboxes(com.icegreen.greenmail.user.GreenMailUser user, String mailboxPattern) Returns an collection of subscribed mailboxes.voidrenameMailbox(com.icegreen.greenmail.user.GreenMailUser user, String oldMailboxName, String newMailboxName) Renames an existing mailbox.voidSubscribes a user to a mailbox.voidunsubscribe(com.icegreen.greenmail.user.GreenMailUser user, String mailbox) Unsubscribes from a given mailbox.
-
Constructor Details
-
AlfrescoImapHostManager
- Parameters:
imapService- ImapService
-
-
Method Details
-
getHierarchyDelimiter
public char getHierarchyDelimiter()Returns the hierarchy delimiter for mailboxes on this host.- Specified by:
getHierarchyDelimiterin interfacecom.icegreen.greenmail.imap.ImapHostManager- Returns:
- The hierarchy delimiter character.
-
listMailboxes
public Collection<com.icegreen.greenmail.store.MailFolder> listMailboxes(com.icegreen.greenmail.user.GreenMailUser user, String mailboxPattern) throws com.icegreen.greenmail.store.FolderException Returns an collection of mailboxes. Method searches mailboxes under mount points defined for a specific user. Mount points include user's IMAP Virtualised Views and Email Archive Views. This method serves LIST command of the IMAP protocol.- Specified by:
listMailboxesin interfacecom.icegreen.greenmail.imap.ImapHostManager- Parameters:
user- User making the requestmailboxPattern- String name of a mailbox possible including a wildcard.- Returns:
- Collection of mailboxes matching the pattern.
- Throws:
com.icegreen.greenmail.store.FolderException
-
listSubscribedMailboxes
public Collection<com.icegreen.greenmail.store.MailFolder> listSubscribedMailboxes(com.icegreen.greenmail.user.GreenMailUser user, String mailboxPattern) throws com.icegreen.greenmail.store.FolderException Returns an collection of subscribed mailboxes. To appear in search result mailboxes should have {http://www.alfresco.org/model/imap/1.0}subscribed property specified for user. Method searches subscribed mailboxes under mount points defined for a specific user. Mount points include user's IMAP Virtualised Views and Email Archive Views. This method serves LSUB command of the IMAP protocol.- Specified by:
listSubscribedMailboxesin interfacecom.icegreen.greenmail.imap.ImapHostManager- Parameters:
user- User making the requestmailboxPattern- String name of a mailbox possible including a wildcard.- Returns:
- Collection of mailboxes matching the pattern.
- Throws:
com.icegreen.greenmail.store.FolderException
-
renameMailbox
public void renameMailbox(com.icegreen.greenmail.user.GreenMailUser user, String oldMailboxName, String newMailboxName) throws com.icegreen.greenmail.store.FolderException, com.icegreen.greenmail.imap.AuthorizationException Renames an existing mailbox. The specified mailbox must already exist, the requested name must not exist already but must be able to be created and the user must have rights to delete the existing mailbox and create a mailbox with the new name. Any inferior hierarchical names must also be renamed. If INBOX is renamed, the contents of INBOX are transferred to a new mailbox with the new name, but INBOX is not deleted. If INBOX has inferior mailbox these are not renamed. This method serves RENAME command of the IMAP protocol. Method searches mailbox under mount points defined for a specific user. Mount points include user's IMAP Virtualised Views and Email Archive Views.- Specified by:
renameMailboxin interfacecom.icegreen.greenmail.imap.ImapHostManager- Parameters:
user- User making the request.oldMailboxName- String name of the existing foldernewMailboxName- String target new name- Throws:
com.icegreen.greenmail.store.FolderException- if an existing folder with the new name.AlfrescoImapFolderException- if user does not have rights to create the new mailbox.com.icegreen.greenmail.imap.AuthorizationException
-
createMailbox
public com.icegreen.greenmail.store.MailFolder createMailbox(com.icegreen.greenmail.user.GreenMailUser user, String mailboxName) throws com.icegreen.greenmail.imap.AuthorizationException, com.icegreen.greenmail.store.FolderException Returns a reference to a newly created mailbox. The request should specify a mailbox that does not already exist on this server, that could exist on this server and that the user has rights to create. This method serves CREATE command of the IMAP protocol.- Specified by:
createMailboxin interfacecom.icegreen.greenmail.imap.ImapHostManager- Parameters:
user- User making the request.mailboxName- String name of the target- Returns:
- an Mailbox reference.
- Throws:
com.icegreen.greenmail.store.FolderException- if mailbox already existsAlfrescoImapFolderException- if user does not have rights to create the new mailbox.com.icegreen.greenmail.imap.AuthorizationException
-
deleteMailbox
public void deleteMailbox(com.icegreen.greenmail.user.GreenMailUser user, String mailboxName) throws com.icegreen.greenmail.store.FolderException, com.icegreen.greenmail.imap.AuthorizationException Deletes an existing MailBox. Specified mailbox must already exist on this server, and the user must have rights to delete it. This method serves DELETE command of the IMAP protocol.- Specified by:
deleteMailboxin interfacecom.icegreen.greenmail.imap.ImapHostManager- Parameters:
user- User making the request.mailboxName- String name of the target- Throws:
com.icegreen.greenmail.store.FolderException- if mailbox has a non-selectable store with childrencom.icegreen.greenmail.imap.AuthorizationException
-
getFolder
public com.icegreen.greenmail.store.MailFolder getFolder(com.icegreen.greenmail.user.GreenMailUser user, String mailboxName) Returns a reference to an existing Mailbox. The requested mailbox must already exists on this server and the requesting user must have at least lookup rights. It is also can be used by to obtain hierarchy delimiter by the LIST command: C: 2 list "" "" S: * LIST () "." "" S: 2 OK LIST completed. Method searches mailbox under mount points defined for a specific user. Mount points include user's IMAP Virtualised Views and Email Archive Views.- Specified by:
getFolderin interfacecom.icegreen.greenmail.imap.ImapHostManager- Parameters:
user- User making the request.mailboxName- String name of the target.- Returns:
- an Mailbox reference.
-
getFolder
public com.icegreen.greenmail.store.MailFolder getFolder(com.icegreen.greenmail.user.GreenMailUser user, String mailboxName, boolean mustExist) throws com.icegreen.greenmail.store.FolderException Simply callsgetFolder(GreenMailUser, String). Added to implementImapHostManager.- Specified by:
getFolderin interfacecom.icegreen.greenmail.imap.ImapHostManager- Throws:
com.icegreen.greenmail.store.FolderException
-
getInbox
public com.icegreen.greenmail.store.MailFolder getInbox(com.icegreen.greenmail.user.GreenMailUser user) throws com.icegreen.greenmail.store.FolderException Returns a reference to the user's INBOX.- Specified by:
getInboxin interfacecom.icegreen.greenmail.imap.ImapHostManager- Parameters:
user- The user making the request.- Returns:
- The user's Inbox.
- Throws:
com.icegreen.greenmail.store.FolderException
-
createPrivateMailAccount
public void createPrivateMailAccount(com.icegreen.greenmail.user.GreenMailUser user) throws com.icegreen.greenmail.store.FolderException Not supported. May be used by GreenMailUser.create() method. Added to implementImapHostManager.- Specified by:
createPrivateMailAccountin interfacecom.icegreen.greenmail.imap.ImapHostManager- Throws:
com.icegreen.greenmail.store.FolderException
-
subscribe
public void subscribe(com.icegreen.greenmail.user.GreenMailUser user, String mailbox) throws com.icegreen.greenmail.store.FolderException Subscribes a user to a mailbox. The mailbox must exist locally and the user must have rights to modify it. This method serves SUBSCRIBE command of the IMAP protocol.- Specified by:
subscribein interfacecom.icegreen.greenmail.imap.ImapHostManager- Parameters:
user- User making the requestmailbox- String representation of a mailbox name.- Throws:
com.icegreen.greenmail.store.FolderException
-
unsubscribe
public void unsubscribe(com.icegreen.greenmail.user.GreenMailUser user, String mailbox) throws com.icegreen.greenmail.store.FolderException Unsubscribes from a given mailbox. This method serves UNSUBSCRIBE command of the IMAP protocol.- Specified by:
unsubscribein interfacecom.icegreen.greenmail.imap.ImapHostManager- Parameters:
user- User making the requestmailbox- String representation of a mailbox name.- Throws:
com.icegreen.greenmail.store.FolderException
-
getAllMessages
Not supported. Used by GreenMail class.- Specified by:
getAllMessagesin interfacecom.icegreen.greenmail.imap.ImapHostManager
-