com.extrememessaging.ResponseMaster
Class CMessage

java.lang.Object
  extended by com.extrememessaging.ResponseMaster.CMessage

public class CMessage
extends java.lang.Object

Extreme Messaging's wrapper of a Java mail message Manages access to the message fields.


Constructor Summary
CMessage(javax.mail.Message oMsg)
          Create my message from a java mail message
 
Method Summary
 void Delete()
          Delete the message from the mailbox
 java.lang.String getField(int eMessageField)
          Get the value of the field as a string
 java.lang.String getField(int eMessageField, boolean convertToLowercase, boolean stripWhitespace)
          Get the value of the field as a string, optionally converting it to lowercase and/or stripping out the whitespace first.
 java.lang.String getField(java.lang.String FieldName)
          Get the value of the field as a string
 java.util.Date getFieldAsDate(int eMessageField)
          Get the value of the field as a date
 java.util.Date getFieldAsDate(java.lang.String FieldName)
          Get the value of the field as a date
 java.lang.Object getFieldAsObject(int eMessageField)
          Get the value of the field as an object (its native type)
 java.lang.Object getFieldAsObject(java.lang.String FieldName)
          Get the value of the field as an object (its native type)
 java.lang.String getFieldNonNull(int eMessageField)
          Gets the value of a field as a string.
 java.lang.String getFieldNonNull(java.lang.String FieldName)
          Gets the value of a field as a string.
 java.lang.String getInfoForLogging()
          Returns a string that you can use for logging so we know which message is causing a problem in the log.
 void SetField(java.lang.String FieldName, java.lang.Object newValue)
          Set the value of a field used by MessageField objects to set the value of another field.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CMessage

public CMessage(javax.mail.Message oMsg)
         throws javax.mail.MessagingException
Create my message from a java mail message

Parameters:
oMsg - The java message to create our message from
Throws:
javax.mail.MessagingException
Method Detail

SetField

public void SetField(java.lang.String FieldName,
                     java.lang.Object newValue)
Set the value of a field used by MessageField objects to set the value of another field. For example, the AttachmentBody is set by the Body message field.

Parameters:
FieldName - The name of the field to set
newValue - The new value to set it to

getField

public java.lang.String getField(int eMessageField)
Get the value of the field as a string

Parameters:
eMessageField - The integer identifier of the field

getField

public java.lang.String getField(int eMessageField,
                                 boolean convertToLowercase,
                                 boolean stripWhitespace)
Get the value of the field as a string, optionally converting it to lowercase and/or stripping out the whitespace first. This is used primarily by the categorization rule items. It uses a cache to avoid doing the work several times.

Parameters:
eMessageField - The integer identifier of the field
convertToLowercase - If true, the result is converted to lower case
stripWhitespace - If true, the whitespace is removed from the result

getFieldNonNull

public java.lang.String getFieldNonNull(int eMessageField)
Gets the value of a field as a string. If the field is null, it returns an empty string.

Parameters:
eMessageField - The integer identifier of the field

getFieldNonNull

public java.lang.String getFieldNonNull(java.lang.String FieldName)
Gets the value of a field as a string. If the field is null, it returns an empty string.

Parameters:
FieldName - The name of the field

getField

public java.lang.String getField(java.lang.String FieldName)
Get the value of the field as a string

Parameters:
FieldName - The name of the field

getFieldAsDate

public java.util.Date getFieldAsDate(int eMessageField)
Get the value of the field as a date

Parameters:
eMessageField - The integer identifier of the field

getFieldAsDate

public java.util.Date getFieldAsDate(java.lang.String FieldName)
Get the value of the field as a date

Parameters:
FieldName - The name of the field

getFieldAsObject

public java.lang.Object getFieldAsObject(java.lang.String FieldName)
Get the value of the field as an object (its native type)

Parameters:
FieldName - The name of the field

getFieldAsObject

public java.lang.Object getFieldAsObject(int eMessageField)
Get the value of the field as an object (its native type)

Parameters:
eMessageField - The integer identifier of the field

Delete

public void Delete()
Delete the message from the mailbox


getInfoForLogging

public java.lang.String getInfoForLogging()
Returns a string that you can use for logging so we know which message is causing a problem in the log.