public class InboundEmailMessage extends DASMessage
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
protected static boolean |
DEBUG_MODE |
protected static int |
INVALID_MESSAGE |
protected boolean |
mBounced
Whether or not this email was bounced
|
protected java.lang.String |
mBouncedEmailAddress
The email address of the bounced recipient
|
protected java.lang.String |
mBouncedErrorMessage
The error message of the bounced email
|
protected java.lang.String |
mBouncedReplyCode
The reply code of the bounced email
|
protected java.lang.String |
mBouncedStatusCode
The status code of the bounced email
|
protected boolean |
mCalculatedAllRecipients
Whether or not we've already attempted to calculate the total
number of recipients.
|
protected javax.mail.Message |
mMessage
The JavaMail Message object that represents the entire email
|
protected java.lang.String[] |
mMessageCc
An array of email address that this email was copied to
|
protected java.lang.String |
mMessageFrom
The email address of the email sender
|
protected java.lang.String[] |
mMessageRecipients
A combination of all the address specified in the "To" and
the "Cc" headers
|
protected java.lang.String |
mMessageReplyTo
The email address that any replies should be sent to
|
protected java.lang.String |
mMessageSubject
The subject of the email
|
protected java.lang.String[] |
mMessageTo
An array of email addresses that this email was sent to
|
protected java.lang.String |
mOriginalSubject
The original subject of the email, disregarding the standard "Re:"
String that accompanies replies
|
protected java.util.Date |
mReceivedDate
The date that this email was received
|
protected java.lang.String |
mReportingBouncedEmailAddressDomain
The email address domain of the bounced recipient
|
protected boolean |
mSoftBounced
Whether or not this email was soft bounced
|
protected java.util.Map |
mTrackingData
The tracking data contained in the email
|
protected static int |
SERIAL_COMPATIBLE_V2 |
protected static int |
VALID_MESSAGE |
Constructor and Description |
---|
InboundEmailMessage() |
InboundEmailMessage(javax.mail.Message pMessage,
boolean pBounced)
Constructs an instance of InboundEmailMessage
|
InboundEmailMessage(javax.mail.Message pMessage,
boolean pBounced,
EmailExaminer pExaminer)
Constructs an instance of InboundEmailMessage
|
InboundEmailMessage(java.lang.String pMessageSubject,
java.lang.String pOriginalSubject,
java.lang.String pMessageFrom,
java.lang.String[] pMessageTo,
java.lang.String[] pMessageCc,
java.lang.String pMessageReplyTo,
java.util.Date pReceivedDate,
boolean pBounced,
javax.mail.Message pMessage)
Constructs an instance of InboundEmailMessage
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.String[] |
convertAddressToStringArray(javax.mail.Address[] pAddresses)
Takes an array of javax.mail.Address objects and converts it into
a String array of email addresses.
|
java.lang.String |
getBouncedEmailAddress()
Gets the BouncedEmailAddress property
|
java.lang.String |
getBouncedErrorMessage()
Gets the BouncedErrorMessage property
|
java.lang.String |
getBouncedReplyCode()
Gets the BouncedReplyCode property
|
java.lang.String |
getBouncedStatusCode()
Gets the BouncedStatusCode property
|
javax.mail.Message |
getMessage()
Gets the message property
|
java.lang.String[] |
getMessageCc()
Gets the messageCc property
|
java.lang.String |
getMessageFrom()
Gets the messageFrom property
|
java.lang.String[] |
getMessageRecipients()
Gets the messageRecipients property
|
java.lang.String |
getMessageReplyTo()
Gets the messageReplyTo property
|
java.lang.String |
getMessageSubject()
Gets the messageSubject property
|
java.lang.String[] |
getMessageTo()
Gets the messageTo property
|
java.lang.String |
getOriginalSubject()
Gets the originalSubject property
|
java.lang.String |
getProfileId()
Returns the profile id from the tracking data if it exists
|
java.util.Date |
getReceivedDate()
Gets the receivedDate property
|
java.lang.String |
getReportingBounced()
Returns a string representation of the bounced property,
for reporting purposes only
|
java.lang.Boolean |
getReportingBouncedAsBoolean()
Returns a Boolean representation of the bounced property,
for reporting purposes only
|
java.lang.String |
getReportingBouncedEmailAddressDomain()
Gets the ReportingBouncedEmailAddressDomain property
|
java.lang.String |
getReportingMessageCc() |
java.lang.String |
getReportingMessageTo() |
java.lang.Long |
getReportingReceivedDate()
Returns a java.lang.Long of the time represented by
the current receivedDate property, for use in the
reporting engine
|
java.lang.String |
getReportingSoftBounced()
Returns a string representation of the softBounced property,
for reporting purposes only
|
java.lang.Boolean |
getReportingSoftBouncedAsBoolean()
Returns a Boolean representation of the softBounced property,
for reporting purposes only
|
java.util.Map |
getTrackingData()
Gets the TrackingData property
|
void |
initBounceProperties(EmailExaminer pExaminer)
This method initializes all of the bounced email properties
for this message, if the email is indeed bounced.
|
protected void |
initFromMessage(javax.mail.Message pMessage)
Utility method for extracting information out of a javax.mail.Message
and populating this object's properties with it
|
boolean |
isBounced()
Gets the bounced property
|
boolean |
isSoftBounced()
Gets the softBounced property
|
static void |
main(java.lang.String[] pArgs) |
protected java.util.Date |
parseRFC822String(java.lang.String pStringDate)
Utility method to turn a String representing a date into an
actual java.util.Date object, using the syntax specifications
from dates in rcf822.
|
void |
setBounced(boolean pBounced)
Sets the bounced property
|
void |
setBouncedEmailAddress(java.lang.String pBouncedEmailAddress)
Sets the BouncedEmailAddress property
|
void |
setBouncedErrorMessage(java.lang.String pBouncedErrorMessage)
Sets the BouncedErrorMessage property
|
void |
setBouncedReplyCode(java.lang.String pBouncedReplyCode)
Sets the BouncedReplyCode property
|
void |
setBouncedStatusCode(java.lang.String pBouncedStatusCode)
Sets the BouncedStatusCode property
|
void |
setMessage(javax.mail.Message pMessage)
Sets the message property
|
void |
setMessageCc(java.lang.String[] pMessageCc)
Sets the messageCc property
|
void |
setMessageFrom(java.lang.String pMessageFrom)
Sets the messageFrom property
|
void |
setMessageRecipients(java.lang.String[] pMessageRecipients)
Sets the messageRecipients property
|
void |
setMessageReplyTo(java.lang.String pMessageReplyTo)
Sets the messageReplyTo property
|
void |
setMessageSubject(java.lang.String pMessageSubject)
Sets the messageSubject property
|
void |
setMessageTo(java.lang.String[] pMessageTo)
Sets the messageTo property
|
void |
setOriginalSubject(java.lang.String pOriginalSubject)
Sets the original subject of the email
|
void |
setReceivedDate(java.util.Date pReceivedDate)
Sets the receivedDate property
|
void |
setReportingBouncedEmailAddressDomain(java.lang.String pReportingBouncedEmailAddressDomain)
Sets the ReportingBouncedEmailAddressDomain property
|
void |
setSoftBounced(boolean pSoftBounced)
Sets the softBounced property
|
void |
setTrackingData(java.util.Map pTrackingData)
Sets the TrackingData property
|
protected java.lang.String |
toStringProperties()
Returns the String representation of all the public properties of
this message.
|
limitSize, toString
public static java.lang.String CLASS_VERSION
protected static boolean DEBUG_MODE
protected static int VALID_MESSAGE
protected static int INVALID_MESSAGE
protected static int SERIAL_COMPATIBLE_V2
protected boolean mCalculatedAllRecipients
protected java.lang.String mMessageSubject
protected java.lang.String mOriginalSubject
protected java.lang.String mMessageFrom
protected java.lang.String[] mMessageTo
protected java.lang.String[] mMessageCc
protected java.lang.String[] mMessageRecipients
protected java.lang.String mMessageReplyTo
protected java.util.Date mReceivedDate
protected boolean mBounced
protected boolean mSoftBounced
protected java.lang.String mBouncedEmailAddress
protected java.lang.String mReportingBouncedEmailAddressDomain
protected java.lang.String mBouncedStatusCode
protected java.lang.String mBouncedReplyCode
protected java.lang.String mBouncedErrorMessage
protected java.util.Map mTrackingData
protected javax.mail.Message mMessage
public InboundEmailMessage()
public InboundEmailMessage(javax.mail.Message pMessage, boolean pBounced)
pMessage
- the JavaMail Message representing the inbound
email. This Message will be used to set the values for this Object's
properties not passed in to this constructor.pBounced
- indicates whether or not this email was bouncedpublic InboundEmailMessage(javax.mail.Message pMessage, boolean pBounced, EmailExaminer pExaminer)
pMessage
- the JavaMail Message representing the inbound
email. This Message will be used to set the values for this Object's
properties not passed in to this constructor.pBounced
- indicates whether or not this email was bouncedpExaminer
- the email examiner that will get bounced properties
from the given message, if anypublic InboundEmailMessage(java.lang.String pMessageSubject, java.lang.String pOriginalSubject, java.lang.String pMessageFrom, java.lang.String[] pMessageTo, java.lang.String[] pMessageCc, java.lang.String pMessageReplyTo, java.util.Date pReceivedDate, boolean pBounced, javax.mail.Message pMessage)
pMessageSubject
- the subject of the email messagepOriginalSubject
- the original subject of the email
message i.e. with the "Re:" String stripped, if it existspMessageFrom
- the email address of the senderpMessageTo
- an array of addresses listed in the "To" headerpMessageCc
- an array of addresses listed in the "Cc" headerpMessageReplyTo
- the email address that all replies should
be sent topReceivedDate
- the date the email message was received by the
POP3 clientpBounced
- indicates whether or not the email was bouncedpMessage
- the JavaMail Message containing all of the headers
and content/attachmentspublic void setMessageSubject(java.lang.String pMessageSubject)
public java.lang.String getMessageSubject()
public void setOriginalSubject(java.lang.String pOriginalSubject)
public java.lang.String getOriginalSubject()
public void setMessageFrom(java.lang.String pMessageFrom)
public java.lang.String getMessageFrom()
public void setMessageTo(java.lang.String[] pMessageTo)
public java.lang.String[] getMessageTo()
public void setMessageCc(java.lang.String[] pMessageCc)
public java.lang.String[] getMessageCc()
public void setMessageRecipients(java.lang.String[] pMessageRecipients)
public java.lang.String[] getMessageRecipients()
public void setMessageReplyTo(java.lang.String pMessageReplyTo)
public java.lang.String getMessageReplyTo()
public void setReceivedDate(java.util.Date pReceivedDate)
public java.util.Date getReceivedDate()
public void setBounced(boolean pBounced)
public boolean isBounced()
public void setSoftBounced(boolean pSoftBounced)
public boolean isSoftBounced()
public void setBouncedEmailAddress(java.lang.String pBouncedEmailAddress)
public java.lang.String getBouncedEmailAddress()
public void setReportingBouncedEmailAddressDomain(java.lang.String pReportingBouncedEmailAddressDomain)
public java.lang.String getReportingBouncedEmailAddressDomain()
public void setBouncedStatusCode(java.lang.String pBouncedStatusCode)
public java.lang.String getBouncedStatusCode()
public void setBouncedErrorMessage(java.lang.String pBouncedErrorMessage)
public java.lang.String getBouncedErrorMessage()
public void setBouncedReplyCode(java.lang.String pBouncedReplyCode)
public java.lang.String getBouncedReplyCode()
public void setTrackingData(java.util.Map pTrackingData)
public java.util.Map getTrackingData()
public java.lang.String getProfileId()
public void setMessage(javax.mail.Message pMessage)
pMessage
- the javax.mail.Message object representing the
inbound emailpublic javax.mail.Message getMessage()
protected java.lang.String toStringProperties()
toStringProperties
in class DASMessage
protected void initFromMessage(javax.mail.Message pMessage)
pMessage
- the javax.mail.Message that will be used to populate
this objectpublic void initBounceProperties(EmailExaminer pExaminer)
pExaminer
- the examiner used to parse this object's
message for bounce informationprotected java.lang.String[] convertAddressToStringArray(javax.mail.Address[] pAddresses)
pAddresses
- an array of javax.mail.Address objectsprotected java.util.Date parseRFC822String(java.lang.String pStringDate)
pStringDate
- the string representation of the datepublic java.lang.String getReportingMessageTo()
public java.lang.String getReportingMessageCc()
public java.lang.Long getReportingReceivedDate()
public java.lang.String getReportingBounced()
public java.lang.String getReportingSoftBounced()
public java.lang.Boolean getReportingBouncedAsBoolean()
public java.lang.Boolean getReportingSoftBouncedAsBoolean()
public static void main(java.lang.String[] pArgs)