|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.alfresco.repo.imap.AbstractImapFolder
org.alfresco.repo.imap.AlfrescoImapFolder
public class AlfrescoImapFolder
Implementation of greenmail MailFolder. It represents an Alfresco content folder and handles appendMessage, copyMessage, expunge (delete), getMessages, getMessage and so requests.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.alfresco.repo.imap.AbstractImapFolder |
|---|
AbstractImapFolder.CommandCallback |
| Field Summary |
|---|
| Fields inherited from class org.alfresco.repo.imap.AbstractImapFolder |
|---|
MAX_RETRIES, serviceRegistry |
| Constructor Summary | |
|---|---|
AlfrescoImapFolder(java.lang.String qualifiedMailboxName,
FileInfo folderInfo,
java.lang.String folderName,
AlfrescoImapConst.ImapViewMode viewMode,
org.alfresco.service.cmr.repository.NodeRef rootNodeRef,
java.lang.String mountPointName,
boolean extractAttachmentsEnabled,
ServiceRegistry serviceRegistry)
Constructs AlfrescoImapFolder object. |
|
AlfrescoImapFolder(java.lang.String qualifiedMailboxName,
FileInfo folderInfo,
java.lang.String folderName,
AlfrescoImapConst.ImapViewMode viewMode,
org.alfresco.service.cmr.repository.NodeRef rootNodeRef,
java.lang.String mountPointName,
ServiceRegistry serviceRegistry,
java.lang.Boolean selectable,
boolean extractAttachmentsEnabled)
Constructs AlfrescoImapFolder object. |
|
| Method Summary | |
|---|---|
protected long |
appendMessageInternal(javax.mail.internet.MimeMessage message,
javax.mail.Flags flags,
java.util.Date internalDate)
Appends message to the folder. |
protected void |
copyMessageInternal(long uid,
com.icegreen.greenmail.store.MailFolder toFolder)
Copies message with the given UID to the specified MailFolder. |
protected com.icegreen.greenmail.store.SimpleStoredMessage |
createImapMessage(FileInfo fileInfo,
java.lang.Long key,
boolean generateBody)
|
void |
deleteAllMessagesInternal()
Marks all messages in the folder as deleted using Flags.Flag#DELETED flag. |
protected void |
expungeInternal()
Deletes messages marked with Flags.Flag#DELETED. |
protected int |
getFirstUnseenInternal()
Returns the number of the first unseen message. |
FileInfo |
getFolderInfo()
|
protected java.lang.String |
getFullNameInternal()
Returns full name of the folder with namespace and full path delimited with the hierarchy delimiter (see AlfrescoImapConst.HIERARCHY_DELIMITER)
E.g.: #mail.admin."Repository_archive.Data Dictionary.Space Templates.Software Engineering Project" This is required by GreenMail implementation. |
protected int |
getMessageCountInternal()
Returns count of the messages in the folder. |
protected com.icegreen.greenmail.store.SimpleStoredMessage |
getMessageInternal(long uid)
Returns message by its UID. |
protected java.util.List |
getMessagesInternal()
Returns list of all messages in the folder. |
protected java.util.List |
getMessagesInternal(com.icegreen.greenmail.foedus.util.MsgRangeFilter msgRangeFilter)
Returns list of messages by filter. |
protected long[] |
getMessageUidsInternal()
Returns UIDs of all messages in the folder. |
protected int |
getMsnInternal(long uid)
Returns message sequence number in the folder by its UID. |
protected java.lang.String |
getNameInternal()
Returns folder name. |
protected java.util.List |
getNonDeletedMessagesInternal()
Returns the list of messages that have no Flags.Flag#DELETED flag set for current user. |
protected javax.mail.Flags |
getPermanentFlagsInternal()
Returns permanent flags. |
protected int |
getRecentCountInternal(boolean reset)
Returns count of messages with Flags.Flag#RECENT flag. |
protected long |
getUidNextInternal()
Returns UIDNEXT value of the folder. |
protected long |
getUidValidityInternal()
Returns UIDVALIDITY value of the folder. |
protected int |
getUnseenCountInternal()
Returns count of the messages with Flags.Flag#SEEN in the folder for the current user. |
AlfrescoImapConst.ImapViewMode |
getViewMode()
|
boolean |
isExtractAttachmentsEnabled()
|
protected boolean |
isReadOnly()
Whether the folder is read-only for user. |
protected boolean |
isSelectableInternal()
Whether the folder is selectable. |
protected void |
replaceFlagsInternal(javax.mail.Flags flags,
long uid,
com.icegreen.greenmail.store.FolderListener silentListener,
boolean addUid)
Replaces flags for the message with the given UID. |
protected void |
setFlagsInternal(javax.mail.Flags flags,
boolean value,
long uid,
com.icegreen.greenmail.store.FolderListener silentListener,
boolean addUid)
Sets flags for the message with the given UID. |
void |
setFolderName(java.lang.String folderName)
|
void |
setMountParent(org.alfresco.service.cmr.repository.NodeRef mountParent)
|
void |
setMountPointName(java.lang.String mountPointName)
|
void |
setSelectable(boolean selectable)
Sets AlfrescoImapFolder.selectable property. |
void |
setViewMode(AlfrescoImapConst.ImapViewMode viewMode)
|
| Methods inherited from class org.alfresco.repo.imap.AbstractImapFolder |
|---|
addListener, appendMessage, checkParameter, copyMessage, deleteAllMessages, expunge, getFirstUnseen, getFullName, getMessage, getMessageCount, getMessages, getMessages, getMessageUids, getMsn, getName, getNonDeletedMessages, getPermanentFlags, getRecentCount, getUidNext, getUidValidity, getUnseenCount, isSelectable, notifyFlagUpdate, removeListener, replaceFlags, search, setFlags, signalDeletion, store, store |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AlfrescoImapFolder(java.lang.String qualifiedMailboxName,
FileInfo folderInfo,
java.lang.String folderName,
AlfrescoImapConst.ImapViewMode viewMode,
org.alfresco.service.cmr.repository.NodeRef rootNodeRef,
java.lang.String mountPointName,
boolean extractAttachmentsEnabled,
ServiceRegistry serviceRegistry)
AlfrescoImapFolder object.
qualifiedMailboxName - - name of the mailbox (e.g. "admin" for admin user).folderInfo - - reference to the FileInfo object representing the folder.folderName - - name of the folder.viewMode - - defines view mode. Can be one of the following: AlfrescoImapConst#MODE_ARCHIVE or AlfrescoImapConst#MODE_VIRTUAL.rootNodeRef - - reference to the root node of the store where folder is placed.mountPointName - - name of the mount point.
public AlfrescoImapFolder(java.lang.String qualifiedMailboxName,
FileInfo folderInfo,
java.lang.String folderName,
AlfrescoImapConst.ImapViewMode viewMode,
org.alfresco.service.cmr.repository.NodeRef rootNodeRef,
java.lang.String mountPointName,
ServiceRegistry serviceRegistry,
java.lang.Boolean selectable,
boolean extractAttachmentsEnabled)
AlfrescoImapFolder object.
qualifiedMailboxName - - name of the mailbox (e.g. "admin" for admin user).folderInfo - - reference to the FileInfo object representing the folder.folderName - - name of the folder.viewMode - - defines view mode. Can be one of the following: AlfrescoImapConst#MODE_ARCHIVE or AlfrescoImapConst#MODE_VIRTUAL.rootNodeRef - - reference to the root node of the store where folder is placed.mountPointName - - name of the mount point.imapService - - reference to the ImapHelper object.selectable - - defines whether the folder is selectable or not.| Method Detail |
|---|
public boolean isExtractAttachmentsEnabled()
protected long appendMessageInternal(javax.mail.internet.MimeMessage message,
javax.mail.Flags flags,
java.util.Date internalDate)
throws FileExistsException,
FileNotFoundException,
java.io.IOException,
javax.mail.MessagingException
appendMessageInternal in class AbstractImapFoldermessage - - message.flags - - message flags.internalDate - - not used. Current date used instead.
FileExistsException
FileNotFoundException
java.io.IOException
javax.mail.MessagingException
protected void copyMessageInternal(long uid,
com.icegreen.greenmail.store.MailFolder toFolder)
throws javax.mail.MessagingException,
FileExistsException,
FileNotFoundException,
java.io.IOException
MailFolder.
copyMessageInternal in class AbstractImapFolderuid - - UID of the messagetoFolder - - reference to the destination folder.
javax.mail.MessagingException
java.io.IOException
FileNotFoundException
FileExistsException
public void deleteAllMessagesInternal()
throws com.icegreen.greenmail.store.FolderException
Flags.Flag#DELETED flag.
deleteAllMessagesInternal in class AbstractImapFoldercom.icegreen.greenmail.store.FolderException
protected void expungeInternal()
throws com.icegreen.greenmail.store.FolderException
Flags.Flag#DELETED. Note that this message deletes all messages with this flag.
expungeInternal in class AbstractImapFoldercom.icegreen.greenmail.store.FolderExceptionprotected int getFirstUnseenInternal()
getFirstUnseenInternal in class AbstractImapFolder
protected java.lang.String getFullNameInternal()
throws FileNotFoundException
AlfrescoImapConst.HIERARCHY_DELIMITER)
E.g.:
getFullNameInternal in class AbstractImapFolderFileNotFoundException
protected com.icegreen.greenmail.store.SimpleStoredMessage getMessageInternal(long uid)
throws javax.mail.MessagingException
getMessageInternal in class AbstractImapFolderuid - - UID of the message.
javax.mail.MessagingExceptionprotected int getMessageCountInternal()
getMessageCountInternal in class AbstractImapFolderprotected long[] getMessageUidsInternal()
getMessageUidsInternal in class AbstractImapFolderprotected java.util.List getMessagesInternal()
getMessagesInternal in class AbstractImapFolderSimpleStoredMessage objects.
protected com.icegreen.greenmail.store.SimpleStoredMessage createImapMessage(FileInfo fileInfo,
java.lang.Long key,
boolean generateBody)
throws javax.mail.MessagingException
javax.mail.MessagingExceptionprotected java.util.List getMessagesInternal(com.icegreen.greenmail.foedus.util.MsgRangeFilter msgRangeFilter)
getMessagesInternal in class AbstractImapFoldermsgRangeFilter - - MsgRangeFilter object representing filter.
protected int getMsnInternal(long uid)
throws com.icegreen.greenmail.store.FolderException
getMsnInternal in class AbstractImapFolderuid - - message UID.
com.icegreen.greenmail.store.FolderException - if no message with given UID.protected java.lang.String getNameInternal()
getNameInternal in class AbstractImapFolderprotected java.util.List getNonDeletedMessagesInternal()
Flags.Flag#DELETED flag set for current user.
getNonDeletedMessagesInternal in class AbstractImapFolderprotected javax.mail.Flags getPermanentFlagsInternal()
getPermanentFlagsInternal in class AbstractImapFolderFlags object containing flags.protected int getRecentCountInternal(boolean reset)
Flags.Flag#RECENT flag.
If reset parameter is true - removes Flags.Flag#RECENT flag from
the message for current user.
getRecentCountInternal in class AbstractImapFolderreset - - if true the Flags.Flag#RECENT will be deleted for current user if exists.
protected long getUidNextInternal()
getUidNextInternal in class AbstractImapFolderprotected long getUidValidityInternal()
getUidValidityInternal in class AbstractImapFolderprotected int getUnseenCountInternal()
Flags.Flag#SEEN in the folder for the current user.
getUnseenCountInternal in class AbstractImapFolder
protected void replaceFlagsInternal(javax.mail.Flags flags,
long uid,
com.icegreen.greenmail.store.FolderListener silentListener,
boolean addUid)
throws com.icegreen.greenmail.store.FolderException,
javax.mail.MessagingException
addUid is set to true
FolderListener objects defined for this folder will be notified.
silentListener can be provided - this listener wouldn't be notified.
replaceFlagsInternal in class AbstractImapFolderflags - - new flags.uid - - message UID.silentListener - - listener that shouldn't be notified.addUid - - defines whether or not listeners be notified.
com.icegreen.greenmail.store.FolderException
javax.mail.MessagingException
protected void setFlagsInternal(javax.mail.Flags flags,
boolean value,
long uid,
com.icegreen.greenmail.store.FolderListener silentListener,
boolean addUid)
throws javax.mail.MessagingException,
com.icegreen.greenmail.store.FolderException
addUid is set to true
FolderListener objects defined for this folder will be notified.
silentListener can be provided - this listener wouldn't be notified.
setFlagsInternal in class AbstractImapFolderflags - - new flags.value - - flags value.uid - - message UID.silentListener - - listener that shouldn't be notified.addUid - - defines whether or not listeners be notified.
javax.mail.MessagingException
com.icegreen.greenmail.store.FolderExceptionpublic FileInfo getFolderInfo()
public void setFolderName(java.lang.String folderName)
public void setViewMode(AlfrescoImapConst.ImapViewMode viewMode)
public void setMountPointName(java.lang.String mountPointName)
public void setMountParent(org.alfresco.service.cmr.repository.NodeRef mountParent)
protected boolean isSelectableInternal()
isSelectableInternal in class AbstractImapFolderboolean.public void setSelectable(boolean selectable)
AlfrescoImapFolder.selectable property.
selectable - - boolean.protected boolean isReadOnly()
isReadOnly in class AbstractImapFolderbooleanpublic AlfrescoImapConst.ImapViewMode getViewMode()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||