ResponseMaster Advanced Topics
Parameterized Message Fields
Contents
  1. Overview
  2. Set By Other
  3. Message Header
  4. Regex Extractor
  5. Attachment Of Type
  6. String To Date
  7. Coalesce
1. Overview
This document describes the Message Field Classes that are provided with ResponseMaster that can be configured to provide custom fields without writing code.
2. Set By Other
This message field class doesn't do anything...it just waits for another message field to set its value.
Example config:
<MessageField>
 <Name>MyField</Name>
 <DataTypeClassName>java.lang.String</DataTypeClassName>
 <FetchingClassName>com.extrememessaging.ResponseMaster.MessageFields.SetByOther</FetchingClassName>
 <Parameter>
  <FieldParameters>
   <FieldName>MyField</FieldName>
   <ExpectedType>java.lang.String</ExpectedType>
   <SettingFieldName>OtherField</SettingFieldName>
  </FieldParameters>
 </Parameter>
 <NotNull>0</NotNull>
 <ConstantLength>0</ConstantLength>
 <DefaultLength>100</DefaultLength>
 <ExcludeFromFieldList>0</ExcludeFromFieldList>
</MessageField>
FieldName
Must match the entry in "Name"
Required.
ExpectedType
The datatype of the data the field will contain.
Default=java.lang.String
Optional.
SettingFieldName
The name of the field that sets the value of this field.
Default=null
Optional.
3. Message Header
This message field class extracts headers from the bounce and any messages attached to it.
Example config:
<MessageField>
 <Name>MyHeader</Name>
 <DataTypeClassName>java.lang.String</DataTypeClassName>
 <FetchingClassName>com.extrememessaging.ResponseMaster.MessageFields.MessageHeader</FetchingClassName>
 <Parameter>
  <FieldParameters>
   <HeaderName>X-MyHeader</HeaderName>
   <Delimiter>,</Delimiter>
   <Algorithm>All</Algorithm>
  </FieldParameters>
 </Parameter>
 <NotNull>0</NotNull>
 <ConstantLength>0</ConstantLength>
 <DefaultLength>100</DefaultLength>
 <ExcludeFromFieldList>0</ExcludeFromFieldList>
</MessageField>
HeaderName
The name of the header to look for.
Required.
Delimiter
The separator to use between items if there are more than one.
Default= ;
Optional.
Algorithm
Determines which header(s) are returned.  Possible values:
First - Return the first one that is found.
All - Return all of the items that are found.
OnlyResponse - Return only the items that are found in the headers of the response.
OnlyOriginal - Return only the items that are found in the headers of the original message.
FirstFromOriginal - Return only the first item that is found in the headers of the original message.
Default=First
Optional.
4. Regex Extractor
This message field applies a user-specified regular expression to one of the other message fields.
Example config:
<MessageField>
 <Name>MyRegex</Name>
 <DataTypeClassName>java.lang.String</DataTypeClassName>
 <FetchingClassName>com.extrememessaging.ResponseMaster.MessageFields.RegexExtractor</FetchingClassName>
 <Parameter>
  <FieldParameters>
   <SourceFieldName>Body</SourceFieldName>
   <Delimiter>;</Delimiter>
   <Regex>MessageID:([0-9a-f]{1,20}) </Regex>
   <FirstMatchOnly>0</FirstMatchOnly>
  </FieldParameters>
 </Parameter>
 <NotNull>0</NotNull>
 <ConstantLength>0</ConstantLength>
 <DefaultLength>100</DefaultLength>
 <ExcludeFromFieldList>0</ExcludeFromFieldList>
</MessageField>
SourceFieldName
The name of the field that the regex should be applied to.
You may want to use the special "AllStringParts" field, which concatenates the Body, HtmlBody, Attachment, DeliveryStatusData, and NestedMessageString fields for this message an any nested messages if you are looking for a value that you included in the original, outgoing, message. Required.
Regex
The regular expression to apply to the source field.
Note: You MUST indicate the group to extract by using parentheses.
Note: The regex uses Perl5 syntax.
Required.
FirstMatchOnly
If there is more than one match, should they all be returned, separated by the Delimiter, or should just the first match be returned.
Default=0
Optional.
Delimiter
The separator to use between items if there are more than one and FirstMatchOnly is 0.
Default= ;
Optional.
5. Attachment Of Type
This message field applies finds an attachment with a certain MIME type, and returns it as an array of bytes.
Note: The DataTypeClassName should be "[B" for this message field.
Example config:
<MessageField>
 <Name>PDFAttachment</Name>
 <DataTypeClassName>[B</DataTypeClassName>
 <FetchingClassName>com.extrememessaging.ResponseMaster.MessageFields.AttachmentOfType</FetchingClassName>
 <Parameter>
  <FieldParameters>
   <MimeType>application/pdf</MimeType>
   <OnlyDispositionAttachment>1</OnlyDispositionAttachment>
  </FieldParameters>
 </Parameter>
 <NotNull>0</NotNull>
 <ConstantLength>0</ConstantLength>
 <DefaultLength>100</DefaultLength>
 <ExcludeFromFieldList>0</ExcludeFromFieldList>
</MessageField>
MimeType
The MIME type that ResponseMaster should look for. Wildcards (eg image/*) are allowed.
Required.
OnlyDispositionAttachment
Should ResponseMaster look at all MIME parts, or only those parts with disposition=attachment.
Optional.
Default=0
6. String To Date
This message field converts a string from another field into a date. It is typically used in conjunction witha a Message Header field to get a date from a header.
Example config:
<MessageField>
 <Name>OriginalSentDate</Name>
 <DataTypeClassName>java.util.Date</DataTypeClassName>
 <FetchingClassName>com.extrememessaging.ResponseMaster.MessageFields.StringToDate</FetchingClassName>
 <Parameter>
  <FieldParameters>
   <SourceFieldName>OriginalSentDateString</SourceFieldName>
  </FieldParameters>
 </Parameter>
 <NotNull>0</NotNull>
 <ConstantLength>0</ConstantLength>
 <DefaultLength>100</DefaultLength>
 <ExcludeFromFieldList>0</ExcludeFromFieldList>
</MessageField>

This would be used in conjunction with a field like this:
<MessageField>
 <Name>OriginalSentDateString</Name>
 <DataTypeClassName>java.lang.String</DataTypeClassName>
 <FetchingClassName>com.extrememessaging.ResponseMaster.MessageFields.MessageHeader</FetchingClassName>
 <Parameter>
  <FieldParameters>
   <HeaderName>Date</HeaderName>
   <Delimiter>,</Delimiter>
   <Algorithm>FirstFromOriginal</Algorithm>
  </FieldParameters>
 </Parameter>
 <NotNull>0</NotNull>
 <ConstantLength>0</ConstantLength>
 <DefaultLength>100</DefaultLength>
 <ExcludeFromFieldList>1</ExcludeFromFieldList>
</MessageField>
SourceFieldName
The name of the field that contains the string to parse.
Required.
7. Coalesce
This message field takes the first non-null/empty value from a list of fields.
Example config:
<MessageField>
 <Name>BestHeader</Name>
 <DataTypeClassName>java.lang.String</DataTypeClassName>
 <FetchingClassName>com.extrememessaging.ResponseMaster.MessageFields.Coalesce</FetchingClassName>
 <Parameter>
  <FieldParameters>
   <SourceFieldNames>MyHeader1,MyHeader2</SourceFieldNames>
   <DefaultValue>Unknown</DefaultValue>
  </FieldParameters>
 </Parameter>
 <NotNull>0</NotNull>
 <ConstantLength>0</ConstantLength>
 <DefaultLength>100</DefaultLength>
 <ExcludeFromFieldList>0</ExcludeFromFieldList>
</MessageField>

SourceFieldNames
A comma separated list of field names to search.
Required.
DefaultValue
The value to return if all the fields are empty.
Optional.
Default = "" (empty string)

Please contact support@extreme-messaging.com if you have any questions.