logo

 

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
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>
  </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.
Required.
Delimiter
The separator to use between items if there are more than one.
Default= ;
Optional.
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.
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>
  </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.
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.

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