Class ExchangeMailReader

java.lang.Object
de.muehlencord.shared.network.mail.exchange.ExchangeMailReader
All Implemented Interfaces:
MailReader

public class ExchangeMailReader extends Object implements MailReader
Author:
Joern Muehlencord (joern@muehlencord.de)
  • Constructor Details

  • Method Details

    • connect

      public void connect() throws MailReaderConnectionException
      Description copied from interface: MailReader
      connects to the mailbox
      Specified by:
      connect in interface MailReader
      Throws:
      MailReaderConnectionException - if he connection cannot be established
    • disconnect

      public void disconnect()
      Description copied from interface: MailReader
      disconnects from mailbox
      Specified by:
      disconnect in interface MailReader
    • getDefaultFolder

      public String getDefaultFolder() throws MailReaderException
      Description copied from interface: MailReader
      returns the default folder
      Specified by:
      getDefaultFolder in interface MailReader
      Returns:
      the default folder
      Throws:
      MailReaderException - if the folder cannot be retrieved
    • getSubFolder

      public List<String> getSubFolder(String sourceFolder) throws MailReaderException
      Description copied from interface: MailReader
      returns the list of subfolders of the specified source folder
      Specified by:
      getSubFolder in interface MailReader
      Parameters:
      sourceFolder - the folder to return the folder list for
      Returns:
      the list of subfolders of the specified source folder
      Throws:
      MailReaderException - if the folder list cannot be retrieved
    • getFolder

      public String getFolder(String folderPath) throws MailReaderException
      Description copied from interface: MailReader
      returns the folder, if folder path is a valid path to an existing folder
      Specified by:
      getFolder in interface MailReader
      Parameters:
      folderPath - the folder to return
      Returns:
      the folder, if folder path is a valid path to an existing folder
      Throws:
      MailReaderException - if the folder cannot be found
    • getMessageCount

      public int getMessageCount(String holdFolder) throws MailReaderException
      Description copied from interface: MailReader
      returns the amount of message in the given folder
      Specified by:
      getMessageCount in interface MailReader
      Parameters:
      holdFolder - the folder to return the amount of messages for
      Returns:
      the amount of message in the given folder
      Throws:
      MailReaderException - if the folder cannot be accessed or the amount of messages cannot be determined
    • getMessages

      public List<MailMessage> getMessages(String folderName) throws MailReaderException
      Description copied from interface: MailReader
      retrieves the list of messages stored in the given folder
      Specified by:
      getMessages in interface MailReader
      Parameters:
      folderName - the folder to search return the emails for
      Returns:
      list of messages stored in the given folder
      Throws:
      MailReaderException - if the message list cannot be retrieved
    • getMessages

      public List<MailMessage> getMessages(String folderName, int start, int end) throws MailReaderException
      Description copied from interface: MailReader
      retrieves the list of messages stored in the given folder
      Specified by:
      getMessages in interface MailReader
      Parameters:
      folderName - the folder to search return the emails for
      start - the number of the first message
      end - the number of the last message
      Returns:
      list of messages stored in the given folder
      Throws:
      MailReaderException - if the message list cannot be retrieved
    • copyMessage

      public void copyMessage(MailMessage mm, String sourceFolder, String destFolder) throws MailReaderException
      Description copied from interface: MailReader
      copies the given message from the source folder to the destination folder
      Specified by:
      copyMessage in interface MailReader
      Parameters:
      mm - the message to copy
      sourceFolder - the folder the message currently resists in
      destFolder - the folder the message should be copied to
      Throws:
      MailReaderException - if the operation fails
    • moveMessage

      public void moveMessage(MailMessage mm, String sourceFolder, String destFolder) throws MailReaderException
      Description copied from interface: MailReader
      moves the given message from the source folder to the destination folder
      Specified by:
      moveMessage in interface MailReader
      Parameters:
      mm - the message to move
      sourceFolder - the folder the message currently resists in
      destFolder - the folder the message should be moved to
      Throws:
      MailReaderException - if the operation fails
    • setSeenFlag

      public void setSeenFlag(String folder, MailMessage mm, boolean flagValue) throws MailReaderException
      Description copied from interface: MailReader
      marks the messages as seen
      Specified by:
      setSeenFlag in interface MailReader
      Parameters:
      folder - the folder to search for the email
      mm - the message to mark as seen
      flagValue - if set to true, the seen flag is set; otherwise it is removed (unset)
      Throws:
      MailReaderException - if the flag cannot be set
    • getConfiguration

      public MailReaderConfiguration getConfiguration()