org.marketcetera.ors.filters
Class DefaultMessageModifier

java.lang.Object
  extended by org.marketcetera.ors.filters.DefaultMessageModifier
All Implemented Interfaces:
MessageModifier

public class DefaultMessageModifier
extends Object
implements MessageModifier

Takes in a collection of message/header/trailer fields to always modify on a passed-in message

Version:
$Id: DefaultMessageModifier.java 16154 2012-07-14 16:34:05Z colin $
Author:
gmiller

Nested Class Summary
static class DefaultMessageModifier.MessageFieldType
           
 
Constructor Summary
DefaultMessageModifier()
           
 
Method Summary
 void addDefaultField(int field, Object defaultValue, DefaultMessageModifier.MessageFieldType fieldType)
           
 void addDefaultField(int field, Object defaultValue, DefaultMessageModifier.MessageFieldType fieldType, String predicate)
           
 boolean modifyMessage(Message message, ReportHistoryServices historyServices, FIXMessageAugmentor augmentor)
          Implement the function to make in-line modifications to the incoming message.
protected  void setFieldsHelper(Map<String,String> fields, DefaultMessageModifier.MessageFieldType fieldType)
          The fields are of form: (predicate)= Where fieldName is an integer number.
 void setHeaderFields(Map<String,String> fields)
           
 void setMsgFields(Map<String,String> fields)
           
 void setTrailerFields(Map<String,String> fields)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultMessageModifier

public DefaultMessageModifier()
Method Detail

setMsgFields

public void setMsgFields(Map<String,String> fields)
                  throws CoreException
Throws:
CoreException

setHeaderFields

public void setHeaderFields(Map<String,String> fields)
                     throws CoreException
Throws:
CoreException

setTrailerFields

public void setTrailerFields(Map<String,String> fields)
                      throws CoreException
Throws:
CoreException

modifyMessage

public boolean modifyMessage(Message message,
                             ReportHistoryServices historyServices,
                             FIXMessageAugmentor augmentor)
                      throws CoreException
Description copied from interface: MessageModifier
Implement the function to make in-line modifications to the incoming message.

Specified by:
modifyMessage in interface MessageModifier
Parameters:
message - the message to be modified
augmentor - FIX-version specific augmentor to apply to this message
Returns:
true if the modifier has modified the message, false otherwise
Throws:
CoreException

addDefaultField

public void addDefaultField(int field,
                            Object defaultValue,
                            DefaultMessageModifier.MessageFieldType fieldType)

addDefaultField

public void addDefaultField(int field,
                            Object defaultValue,
                            DefaultMessageModifier.MessageFieldType fieldType,
                            String predicate)

setFieldsHelper

protected void setFieldsHelper(Map<String,String> fields,
                               DefaultMessageModifier.MessageFieldType fieldType)
                        throws CoreException
The fields are of form: (predicate)= Where fieldName is an integer number. So we parse out the field name, store it as an int, and store the value as an object. The predicate is optional

Parameters:
fields - Map of key-value pairs
fieldType - Which particular kind of field we are modifying: trailer/header/message
Throws:
CoreException


Copyright © 2012. All Rights Reserved.