com.extrememessaging.ResponseMaster.MessageFields
Interface IMessageField

All Superinterfaces:
IConfigurableItem
All Known Implementing Classes:
AllStringParts, AttachmentOfType, AttachmentsOfType, Body, BodyWithoutOriginalMessage, Coalesce, DecodeBase64, From, FromName, FromPostmaster, MessageAsRFC822ByteArray, MessageGUID, MessageHeader, MessageObject, OriginalDate, OriginalFrom, OriginalSubject, OriginalToAddress, ProcessedTimestamp, ReceivedTimestamp, RegexExtractor, RegularExpression, SentTimestamp, SetByOther, SizeOfMessage, StatusCode, StringToDate, Subject, ToAddress

public interface IMessageField
extends IConfigurableItem

The interface that message fields must support.


Method Summary
 java.lang.Object GetValue()
          Get the value of the field
 void PassMessages(CMessage parentMessage, javax.mail.Message javaMailMsg)
          Called once for each message.
 void SetValue(java.lang.Object newValue)
          Called if the value for this field is set externally.
 void Verify()
          This function is called once, just after the first time Initialize is called.
 
Methods inherited from interface com.extrememessaging.ResponseMaster.IConfigurableItem
Initialize, Shutdown
 

Method Detail

GetValue

java.lang.Object GetValue()
Get the value of the field

Returns:
The value of the field. It should have the type set in the DataTypeClassName field of the MessageFields.xml file. It is ok to return null.

SetValue

void SetValue(java.lang.Object newValue)
Called if the value for this field is set externally. It you are implementing your own message fields, this call shouldn't need to do anything


PassMessages

void PassMessages(CMessage parentMessage,
                  javax.mail.Message javaMailMsg)
                  throws javax.mail.MessagingException
Called once for each message. Called after Initialize, before GetValue and SetValue Passes the information you may need to get your value

Parameters:
parentMessage - Do NOT use the parentMessage in this call. You can store a reference to it to use later in GetValue, but do not access the values of any other fields during this function.
javaMailMsg - The raw Java Mail message that the parentMessage is based upon You can freely read from this object, but do not modify it. If it throws a messaging exception that you cannot handle, you should re-throw it to let ResponseMaster re-cycle the connection to the mail server.
Throws:
This - function throws a MessagingException if there is a problem accessing the javaMailMsg
javax.mail.MessagingException

Verify

void Verify()
            throws InvalidMessageFieldName,
                   java.lang.IllegalArgumentException
This function is called once, just after the first time Initialize is called. It is used to determine if any dependencies are missing or the parameter is invalid. It throws an exception if something is wrong.

Throws:
This - function throws an InvalidMessageFieldName if it depends on a field that isn't available. It throws an IllegalArgumentException if the parameter passed earlier is invalid.
InvalidMessageFieldName
java.lang.IllegalArgumentException
See Also:
InvalidMessageFieldName, IllegalArgumentException