com.jmo.mailmessager.utils.mail
Class MailAccount

java.lang.Object
  extended by com.jmo.mailmessager.utils.mail.MailAccount
All Implemented Interfaces:
java.io.Serializable

public class MailAccount
extends java.lang.Object
implements java.io.Serializable

Class to store an email provider's settings and email messages

Version:
0.0.1
Author:
John Morales
See Also:
MailMessage, Serialized Form

Constructor Summary
MailAccount()
          Creates new blank MailAccount
 
Method Summary
 java.lang.Exception getException()
          Getter for Exception that was saved during an errored mail retrieval.
 java.lang.String getExceptionMessage()
          Getter for exception error message for use on Announcement
 java.lang.String getMailEncPassword()
          Getter for encrypted password used to authenticate to this mail provider
 MailMessage[] getMailMessages()
          Returns an array of the new Mail Messages that were retrieved from this account
 java.lang.String getMailProviderName()
          Getter for Mail Provider's name
 int getMailProviderPort()
          Getter for Mail provider's mail server port
 java.lang.String getMailProviderProtocol()
          Getter for Mail Provider's mail server protocol
 java.lang.String getMailProviderServer()
          Getter for Mail provider's incoming mail server
 java.lang.String getMailUsername()
          Getter for username used to authenticate to this mail provider
 boolean hadException()
          Returns if an error was encountered while attempting to retrieve email from this mail account
 void hadException(boolean ENCOUNTERED_EXCEPTION, java.lang.Exception EXCEPTION)
          Setter for an Exception that occurred while attempting to retrieve mail from this mail account
 boolean isMailProviderSSL()
          Returns if this mail provider's mail server requires SSL
 void isMailProviderSSL(boolean MAIL_PROVIDER_SSL)
          Setter for whether the mail provider requires SSL
 void setExceptionMessage(java.lang.String E_MESSAGE)
          Setter for custom exception message
 void setMailEncPassword(java.lang.String MAIL_ENC_PASSWORD)
          Setter for the encrypted password to authenticate to this mail provider
 void setMailMessages(MailMessage[] MAIL_MESSAGES)
          Setter for the new email messages on this mail account
 void setMailProviderName(java.lang.String MAIL_PROVIDER_NAME)
          Setter for Mail Provider Name
 void setMailProviderPort(int MAIL_PROVIDER_PORT)
          Setter for incoming mail server's port number
 void setMailProviderProtocol(java.lang.String MAIL_PROVIDER_PROTOCOL)
          Setter for Mail provider incoming mail server's protocol
 void setMailProviderServer(java.lang.String MAIL_PROVIDER_SERVER)
          Setter for the mail provider's mail server
 void setMailUsername(java.lang.String MAIL_USERNAME)
          Setter for the username used to authenticate to this mail provider
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MailAccount

public MailAccount()
Creates new blank MailAccount

Method Detail

getMailProviderName

public java.lang.String getMailProviderName()
Getter for Mail Provider's name

Returns:
String of Mail Provider's name of this mail account

getMailProviderProtocol

public java.lang.String getMailProviderProtocol()
Getter for Mail Provider's mail server protocol

Returns:
String of mail server's protocol

getMailProviderPort

public int getMailProviderPort()
Getter for Mail provider's mail server port

Returns:
Port number of incoming mail server as integer

isMailProviderSSL

public boolean isMailProviderSSL()
Returns if this mail provider's mail server requires SSL

Returns:
True if SSL is required, false otherwise

getMailProviderServer

public java.lang.String getMailProviderServer()
Getter for Mail provider's incoming mail server

Returns:
String of mail server

getMailUsername

public java.lang.String getMailUsername()
Getter for username used to authenticate to this mail provider

Returns:
String of username

getMailEncPassword

public java.lang.String getMailEncPassword()
Getter for encrypted password used to authenticate to this mail provider

Returns:
AES ciphertext of password for this account

getMailMessages

public MailMessage[] getMailMessages()
Returns an array of the new Mail Messages that were retrieved from this account

Returns:
MailMessage array of new email messages, never returns null

hadException

public boolean hadException()
Returns if an error was encountered while attempting to retrieve email from this mail account

Returns:
True if an exception occurred, False otherwise

getException

public java.lang.Exception getException()
Getter for Exception that was saved during an errored mail retrieval.

Returns:
Exception if one occurred during mail fetch, null otherwise.

getExceptionMessage

public java.lang.String getExceptionMessage()
Getter for exception error message for use on Announcement

Returns:
Custom error message

setMailProviderName

public void setMailProviderName(java.lang.String MAIL_PROVIDER_NAME)
Setter for Mail Provider Name


setMailProviderProtocol

public void setMailProviderProtocol(java.lang.String MAIL_PROVIDER_PROTOCOL)
Setter for Mail provider incoming mail server's protocol


setMailProviderPort

public void setMailProviderPort(int MAIL_PROVIDER_PORT)
Setter for incoming mail server's port number


isMailProviderSSL

public void isMailProviderSSL(boolean MAIL_PROVIDER_SSL)
Setter for whether the mail provider requires SSL


setMailProviderServer

public void setMailProviderServer(java.lang.String MAIL_PROVIDER_SERVER)
Setter for the mail provider's mail server


setMailUsername

public void setMailUsername(java.lang.String MAIL_USERNAME)
Setter for the username used to authenticate to this mail provider


setMailEncPassword

public void setMailEncPassword(java.lang.String MAIL_ENC_PASSWORD)
Setter for the encrypted password to authenticate to this mail provider


setMailMessages

public void setMailMessages(MailMessage[] MAIL_MESSAGES)
Setter for the new email messages on this mail account


hadException

public void hadException(boolean ENCOUNTERED_EXCEPTION,
                         java.lang.Exception EXCEPTION)
Setter for an Exception that occurred while attempting to retrieve mail from this mail account


setExceptionMessage

public void setExceptionMessage(java.lang.String E_MESSAGE)
Setter for custom exception message