|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.openexchange.mail.MailServletInterface
public abstract class MailServletInterface
MailServletInterface - The mail interface which invokes the mail layer methods.
This interface's purpose is to be conform to other interfaces used in other groupware modules which are used throughout servlet instances.
| Field Summary | |
|---|---|
static com.openexchange.api2.MailInterfaceMonitor |
mailInterfaceMonitor
|
static int |
QUOTA_RESOURCE_MESSAGE
The constant for quota message resource |
static int |
QUOTA_RESOURCE_STORAGE
The constant for quota storage resource |
| Constructor Summary | |
|---|---|
MailServletInterface()
|
|
| Method Summary | |
|---|---|
abstract java.lang.String[] |
appendMessages(java.lang.String destFolder,
MailMessage[] msgs,
boolean force)
Appends given messages to given folder. |
abstract boolean |
clearFolder(java.lang.String folderArg)
Clears all messages out of given folder. |
abstract void |
close(boolean putIntoCache)
Closes the interface and releases all resources |
abstract java.lang.String[] |
copyMessages(java.lang.String sourceFolder,
java.lang.String destFolder,
java.lang.String[] msgUIDs,
boolean move)
Copies or moves (if move is set) the defined message from source folder to destination folder. |
abstract java.lang.String |
deleteFolder(java.lang.String folder)
Deletes given folder |
abstract boolean |
deleteMessages(java.lang.String folder,
java.lang.String[] msgUIDs,
boolean hardDelete)
Deletes the message located in given folder corresponding to given msgUID |
abstract int |
getAccountID()
Gets the account ID to which the (primary) mail access is connected |
abstract int[] |
getAllMessageCount(java.lang.String folder)
Returns all message counts in specified folder in an int array as follows: 0: Message Count, 1
: New Message Count, 2: Unread MessageCount, 3: Deleted Message Count |
abstract com.openexchange.tools.iterator.SearchIterator<MailMessage> |
getAllMessages(java.lang.String folder,
int sortCol,
int order,
int[] fields,
int[] fromToIndices)
Returns an instance of SearchIterator containing all messages located in given folder. |
abstract com.openexchange.tools.iterator.SearchIterator<MailMessage> |
getAllThreadedMessages(java.lang.String folder,
int sortCol,
int order,
int[] fields,
int[] fromToIndices)
Returns a thread-view-sorted instance of SearchIterator containing all messages located in given folder. |
abstract com.openexchange.tools.iterator.SearchIterator<MailFolder> |
getChildFolders(java.lang.String parentFolder,
boolean all)
Returns an instance of SearchIterator containing the subfolders of given folder |
abstract java.lang.String |
getConfirmedHamFolder(int accountId)
Returns user-defined confirmed ham folder |
abstract java.lang.String |
getConfirmedSpamFolder(int accountId)
Returns user-defined confirmed spam folder |
abstract int |
getDeletedMessageCount(java.lang.String folder)
Returns the number messages which are marked for deletion in folder |
abstract MailMessage[] |
getDeletedMessages(java.lang.String folder,
int[] fields)
Gets all deleted messages in given folder |
abstract java.lang.String |
getDraftsFolder(int accountId)
Returns user-defined drafts folder |
abstract MailFolder |
getFolder(java.lang.String folder,
boolean checkFolder)
Returns the store's folder identfied through given String instance |
abstract MailMessage |
getForwardMessageForDisplay(java.lang.String[] folders,
java.lang.String[] fowardMsgUIDs,
UserSettingMail usm)
Creates an instance of JSONMessageObject which contains the initial forward content of the message identifed through
fowardMsgUID. |
abstract java.lang.String |
getInboxFolder(int accountId)
Returns user-defined inbox folder |
static MailServletInterface |
getInstance(com.openexchange.session.Session session)
Gets a proper implementation of MailServletInterface
NOTE: Don't forget to invoke close(boolean) after usage
MailInterface mailInterface = MailInterface.getInstance(session);
try {
//Do some stuff here...
} finally {
mailInterface.close(true);
}
|
abstract MailConfig |
getMailConfig()
Returns user-specific mail configuration |
abstract java.lang.String |
getMailIDByMessageID(java.lang.String folder,
java.lang.String messageID)
Gets a mail's ID by specified "Message-Id" header. |
com.openexchange.groupware.importexport.MailImportResult[] |
getMailImportResults()
Get results of imported mails. |
abstract MailMessage |
getMessage(java.lang.String folder,
java.lang.String msgUID)
Gets the mail identified through given ID from store located in given folder. |
abstract MailPart |
getMessageAttachment(java.lang.String folder,
java.lang.String msgUID,
java.lang.String attachmentPosition,
boolean displayVersion)
Returns a message's attachment located at given attachmentPosition wrapped by an instance of
JSONMessageAttachmentObject for a convenient access to its attributes and content. |
abstract com.openexchange.filemanagement.ManagedFile |
getMessageAttachments(java.lang.String folder,
java.lang.String msgUID,
java.lang.String[] attachmentPositions)
Returns message's attachments as a ZIP file backed by returned managed file instance. |
abstract int |
getMessageCount(java.lang.String folder)
Returns the number of messages in folder |
abstract MailPart |
getMessageImage(java.lang.String folder,
java.lang.String msgUID,
java.lang.String cid)
Returns a message's inline image located identified with given cid wrapped by an instance of
JSONMessageAttachmentObject for a convenient access to its attributes and content. |
abstract MailMessage[] |
getMessageList(java.lang.String folder,
java.lang.String[] uids,
int[] fields,
java.lang.String[] headerFields)
Returns the an array of messages located in given folder. |
abstract com.openexchange.tools.iterator.SearchIterator<MailMessage> |
getMessages(java.lang.String folder,
int[] fromToIndices,
int sortCol,
int order,
int[] searchCols,
java.lang.String[] searchPatterns,
boolean linkSearchTermsWithOR,
int[] fields)
Returns an instance of SearchIterator containing a selection of messages located in given folder. |
abstract com.openexchange.tools.iterator.SearchIterator<MailMessage> |
getMessages(java.lang.String folder,
int[] fromToIndices,
int sortCol,
int order,
com.openexchange.search.SearchTerm<?> searchTerm,
boolean linkSearchTermsWithOR,
int[] fields)
Returns an instance of SearchIterator containing a selection of messages located in given folder. |
abstract int |
getNewMessageCount(java.lang.String folder)
Returns the number of new messages in folder |
abstract com.openexchange.tools.iterator.SearchIterator<MailMessage> |
getNewMessages(java.lang.String folder,
int sortCol,
int order,
int[] fields,
int limit)
Returns an instance of SearchIterator containing max. |
abstract com.openexchange.tools.iterator.SearchIterator<MailFolder> |
getPathToDefaultFolder(java.lang.String folder)
Returns an instance of SearchIterator containing all antecessor folders on path to mailbox's default folder |
abstract long |
getQuotaLimit(int type)
Returns the quota limit |
abstract long[][] |
getQuotas(int[] types)
Gets both quota limit and quota usage in an array with length set to 2 for each resource type |
abstract long |
getQuotaUsage(int type)
Returns the current quota usage |
abstract MailMessage |
getReplyMessageForDisplay(java.lang.String folder,
java.lang.String replyMsgUID,
boolean replyToAll,
UserSettingMail usm)
Creates an instance of JSONMessageObject which contains the initial reply content of the message identifed through
replyMsgUID. |
abstract com.openexchange.tools.iterator.SearchIterator<MailFolder> |
getRootFolders()
Returns an instance of SearchIterator containing the mailbox's default folder |
abstract java.lang.String |
getSentFolder(int accountId)
Returns user-defined sent folder |
abstract java.lang.String |
getSpamFolder(int accountId)
Returns user-defined spam folder |
abstract com.openexchange.tools.iterator.SearchIterator<MailMessage> |
getThreadedMessages(java.lang.String folder,
int[] fromToIndices,
int sortCol,
int order,
int[] searchCols,
java.lang.String[] searchPatterns,
boolean linkSearchTermsWithOR,
int[] fields)
Returns a thread-view-sorted instance of SearchIterator containing a selection of messages located in given folder. |
abstract java.lang.String |
getTrashFolder(int accountId)
Returns user-defined trash folder |
abstract int |
getUnreadMessageCount(java.lang.String folder)
Returns the number of unread messages in folder |
abstract MailMessage[] |
getUpdatedMessages(java.lang.String folder,
int[] fields)
Gets all updated messages in given folder |
abstract java.util.Collection<MailException> |
getWarnings()
Gets possible warnings. |
java.lang.String[] |
importMessages(java.lang.String destFolder,
MailMessage[] msgs,
boolean force)
Overwrite this to implement a different append behaviour for mail imports. |
abstract java.lang.String |
saveDraft(ComposedMailMessage draftMail,
boolean autosave,
int accountId)
Saves specified draft mail. |
abstract java.lang.String |
saveFolder(MailFolderDescription mailFolder)
Creates a new mail folder described by given MailFolderObject instance |
abstract void |
sendFormMail(ComposedMailMessage composedMail,
int groupId,
int accountId)
Sends a form mail. |
abstract java.lang.String |
sendMessage(ComposedMailMessage transportMail,
ComposeType sendType,
int accountId)
Sends a message described through given instance of msgObj and its possible file attachments contained in given instance
of uploadEvent. |
abstract void |
sendReceiptAck(java.lang.String folder,
java.lang.String msgUID,
java.lang.String fromAddr)
Sends a read acknowledgment to given message |
abstract void |
updateMessageColorLabel(java.lang.String folder,
java.lang.String[] msgUID,
int newColorLabel)
Updates the color label stored in message's user flags |
abstract void |
updateMessageFlags(java.lang.String folder,
java.lang.String[] msgUID,
int flagBits,
boolean flagVal)
Updates message's client-alterable system flags (e.g. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int QUOTA_RESOURCE_STORAGE
public static final int QUOTA_RESOURCE_MESSAGE
public static final com.openexchange.api2.MailInterfaceMonitor mailInterfaceMonitor
| Constructor Detail |
|---|
public MailServletInterface()
| Method Detail |
|---|
public static final MailServletInterface getInstance(com.openexchange.session.Session session)
throws MailException
MailServletInterface
NOTE: Don't forget to invoke close(boolean) after usage
MailInterface mailInterface = MailInterface.getInstance(session);
try {
//Do some stuff here...
} finally {
mailInterface.close(true);
}
session - The session
MailServletInterface
MailException
public abstract java.lang.String getMailIDByMessageID(java.lang.String folder,
java.lang.String messageID)
throws MailException
folder - The folder to search inmessageID - The "Message-Id" header
MailException - If no mauil could be found
public abstract int[] getAllMessageCount(java.lang.String folder)
throws MailException
int array as follows: 0: Message Count, 1
: New Message Count, 2: Unread MessageCount, 3: Deleted Message Count
MailException
public abstract int getMessageCount(java.lang.String folder)
throws MailException
MailException
public abstract int getNewMessageCount(java.lang.String folder)
throws MailException
MailException
public abstract int getUnreadMessageCount(java.lang.String folder)
throws MailException
MailException
public abstract int getDeletedMessageCount(java.lang.String folder)
throws MailException
MailException
public abstract long[][] getQuotas(int[] types)
throws MailException
2 for each resource type
types - The resource types; QUOTA_RESOURCE_STORAGE or QUOTA_RESOURCE_MESSAGE
2 for each resource type
MailException - If quotas cannot be retrieved
public abstract long getQuotaLimit(int type)
throws MailException
MailException
public abstract long getQuotaUsage(int type)
throws MailException
MailException
public abstract com.openexchange.tools.iterator.SearchIterator<MailMessage> getNewMessages(java.lang.String folder,
int sortCol,
int order,
int[] fields,
int limit)
throws MailException
SearchIterator containing max. limit new (unseen) messages located in given folder.
MailException
public abstract com.openexchange.tools.iterator.SearchIterator<MailMessage> getAllMessages(java.lang.String folder,
int sortCol,
int order,
int[] fields,
int[] fromToIndices)
throws MailException
SearchIterator containing all messages located in given folder.
MailException
public abstract com.openexchange.tools.iterator.SearchIterator<MailMessage> getMessages(java.lang.String folder,
int[] fromToIndices,
int sortCol,
int order,
int[] searchCols,
java.lang.String[] searchPatterns,
boolean linkSearchTermsWithOR,
int[] fields)
throws MailException
SearchIterator containing a selection of messages located in given folder.
fromToIndices can define a range of messages that should be returned. Moreover searchCols and
searchPatterns defines a search pattern to further confine returned messages.
MailException
public abstract com.openexchange.tools.iterator.SearchIterator<MailMessage> getMessages(java.lang.String folder,
int[] fromToIndices,
int sortCol,
int order,
com.openexchange.search.SearchTerm<?> searchTerm,
boolean linkSearchTermsWithOR,
int[] fields)
throws MailException
SearchIterator containing a selection of messages located in given folder.
fromToIndices can define a range of messages that should be returned. Moreover searchCols and
searchPatterns defines a search pattern to further confine returned messages.
MailException
public abstract com.openexchange.tools.iterator.SearchIterator<MailMessage> getAllThreadedMessages(java.lang.String folder,
int sortCol,
int order,
int[] fields,
int[] fromToIndices)
throws MailException
SearchIterator containing all messages located in given folder.
MailException
public abstract com.openexchange.tools.iterator.SearchIterator<MailMessage> getThreadedMessages(java.lang.String folder,
int[] fromToIndices,
int sortCol,
int order,
int[] searchCols,
java.lang.String[] searchPatterns,
boolean linkSearchTermsWithOR,
int[] fields)
throws MailException
SearchIterator containing a selection of messages located in given folder.
fromToIndices can define a range of messages that should be returned. Moreover searchCols and
searchPatterns defines a search pattern to further confine returned messages.
MailException
public abstract MailMessage[] getMessageList(java.lang.String folder,
java.lang.String[] uids,
int[] fields,
java.lang.String[] headerFields)
throws MailException
fromToUID is not null only messages fitting
into uid range will be returned.
MailException
public abstract MailMessage getMessage(java.lang.String folder,
java.lang.String msgUID)
throws MailException
folder - The folder pathmsgUID - The mail ID
MailException - If mail cannot be fetched from store
public abstract MailPart getMessageAttachment(java.lang.String folder,
java.lang.String msgUID,
java.lang.String attachmentPosition,
boolean displayVersion)
throws MailException
attachmentPosition wrapped by an instance of
JSONMessageAttachmentObject for a convenient access to its attributes and content.
displayVersion - true if returned object is for display purpose; otherwise false
MailException
public abstract com.openexchange.filemanagement.ManagedFile getMessageAttachments(java.lang.String folder,
java.lang.String msgUID,
java.lang.String[] attachmentPositions)
throws MailException
folder - The foldermsgUID - The message IDattachmentPositions - The attachment positions
MailException - If an error occurs
public abstract MailPart getMessageImage(java.lang.String folder,
java.lang.String msgUID,
java.lang.String cid)
throws MailException
cid wrapped by an instance of
JSONMessageAttachmentObject for a convenient access to its attributes and content.
MailException
public abstract java.lang.String saveDraft(ComposedMailMessage draftMail,
boolean autosave,
int accountId)
throws MailException
If specified draft mail holds a reference to an existing draft mail - MailPart.getMsgref() is not null - then
the referenced draft mail shall be replaced.
draftMail - The draft mailautosave - true to indicate an auto-save operation; otherwise false
MailException
public abstract void sendReceiptAck(java.lang.String folder,
java.lang.String msgUID,
java.lang.String fromAddr)
throws MailException
MailException
public abstract void sendFormMail(ComposedMailMessage composedMail,
int groupId,
int accountId)
throws MailException
composedMail - The form mail (without any recipients)groupId - The identifier of the group to whose members shall receive the mailaccountId - The account identifier
MailException - If mail transport fails
public abstract java.lang.String sendMessage(ComposedMailMessage transportMail,
ComposeType sendType,
int accountId)
throws MailException
msgObj and its possible file attachments contained in given instance
of uploadEvent.
MailException
public abstract java.lang.String[] appendMessages(java.lang.String destFolder,
MailMessage[] msgs,
boolean force)
throws MailException
destFolder - The destination foldermsgs - - The messages to append (must be completely pre-filled incl. content references)force - true to enforce append and to omit checks; otherwise false
MailException - If messages cannot be appended.
public java.lang.String[] importMessages(java.lang.String destFolder,
MailMessage[] msgs,
boolean force)
throws MailException
destFolder - The destination foldermsgs - - The messages to append (must be completely pre-filled incl. content references)force - true to enforce append and to omit checks; otherwise false
MailException - If messages cannot be appended.
public abstract MailMessage getReplyMessageForDisplay(java.lang.String folder,
java.lang.String replyMsgUID,
boolean replyToAll,
UserSettingMail usm)
throws MailException
JSONMessageObject which contains the initial reply content of the message identifed through
replyMsgUID. replyToAll defines whether to reply to all involved entities or just to main sender.
NOTE:This method is intended to support Open-Xchange GUI's display onyl and does not really send the reply.
MailException
public abstract MailMessage getForwardMessageForDisplay(java.lang.String[] folders,
java.lang.String[] fowardMsgUIDs,
UserSettingMail usm)
throws MailException
JSONMessageObject which contains the initial forward content of the message identifed through
fowardMsgUID. NOTE:This method is intended to support Open-Xchange GUI's display onyl and does not really send
the forward.
MailException
public abstract boolean deleteMessages(java.lang.String folder,
java.lang.String[] msgUIDs,
boolean hardDelete)
throws MailException
msgUID
MailException
public abstract boolean clearFolder(java.lang.String folderArg)
throws MailException
MailException
public abstract java.lang.String[] copyMessages(java.lang.String sourceFolder,
java.lang.String destFolder,
java.lang.String[] msgUIDs,
boolean move)
throws MailException
move is set) the defined message from source folder to destination folder.
MailException
public abstract void updateMessageColorLabel(java.lang.String folder,
java.lang.String[] msgUID,
int newColorLabel)
throws MailException
MailException
public abstract void updateMessageFlags(java.lang.String folder,
java.lang.String[] msgUID,
int flagBits,
boolean flagVal)
throws MailException
flagVal determines whether the affected
flags are set (true) or unset (false).
MailException
public abstract MailMessage[] getUpdatedMessages(java.lang.String folder,
int[] fields)
throws MailException
folder - The folder fullnamesince - The time stamp in UTC millisecondsfields - The desired fields to fill in returned messages
MailException - If updated messages cannot be returned
public abstract MailMessage[] getDeletedMessages(java.lang.String folder,
int[] fields)
throws MailException
folder - The folder fullnamesince - The time stamp in UTC millisecondsfields - The desired fields to fill in returned messages
MailException - If deleted messages cannot be returned
public abstract com.openexchange.tools.iterator.SearchIterator<MailFolder> getRootFolders()
throws MailException
SearchIterator containing the mailbox's default folder
MailException
public abstract com.openexchange.tools.iterator.SearchIterator<MailFolder> getChildFolders(java.lang.String parentFolder,
boolean all)
throws MailException
SearchIterator containing the subfolders of given folder
MailException
public abstract MailFolder getFolder(java.lang.String folder,
boolean checkFolder)
throws MailException
String instance
MailException
public abstract com.openexchange.tools.iterator.SearchIterator<MailFolder> getPathToDefaultFolder(java.lang.String folder)
throws MailException
SearchIterator containing all antecessor folders on path to mailbox's default folder
MailException
public abstract void close(boolean putIntoCache)
throws MailException
putIntoCache - - whether or not to put associated conenction into pool
MailException
public abstract java.lang.String saveFolder(MailFolderDescription mailFolder)
throws MailException
MailFolderObject instance
MailException
public abstract java.lang.String deleteFolder(java.lang.String folder)
throws MailException
MailException
public abstract java.lang.String getInboxFolder(int accountId)
throws MailException
MailException
public abstract java.lang.String getDraftsFolder(int accountId)
throws MailException
MailException
public abstract java.lang.String getSentFolder(int accountId)
throws MailException
MailException
public abstract java.lang.String getSpamFolder(int accountId)
throws MailException
MailException
public abstract java.lang.String getTrashFolder(int accountId)
throws MailException
MailException
public abstract java.lang.String getConfirmedSpamFolder(int accountId)
throws MailException
MailException
public abstract java.lang.String getConfirmedHamFolder(int accountId)
throws MailException
MailException
public abstract MailConfig getMailConfig()
throws MailException
MailExceptionpublic abstract int getAccountID()
public abstract java.util.Collection<MailException> getWarnings()
public com.openexchange.groupware.importexport.MailImportResult[] getMailImportResults()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||