biz.onixs.fix.fastnew
Class Encoder

java.lang.Object
  extended by biz.onixs.fix.fastnew.Encoder

public class Encoder
extends Object

FIX-to-FAST Encoder.


Field Summary
protected  boolean codeEachMessageIndependently
           
protected  FastVersion fastVersion
           
protected  FixBlock fixBlock
           
protected  Version fixVersion
           
protected  biz.onixs.fix.fastnew.ScaledDecimal lastScaledDecimal
           
protected  int lastTemplateId
           
protected  TemplateLibrary templateLibrary
           
 
Constructor Summary
Encoder(TemplateLibrary templateLibrary, Version fixVersion, FastVersion fastVersion)
          Constructor.
Encoder(TemplateLibrary templateLibrary, Version fixVersion, FastVersion fastVersion, boolean codeEachMessageIndependently)
          Constructor.
 
Method Summary
 byte[] encode(Message message)
          Encodes the given FIX message into a FAST stream chunk.
The template is selected automatically with the max id for the specific FIX message type.
 byte[] encode(Message message, int templateId)
          Encodes the given FIX message into a FAST stream chunk.
 FastVersion getFastVersion()
          Returns source FAST version.
 Version getFixVersion()
          Returns target FIX version.
 TemplateLibrary getTemplateLibrary()
          Returns associated template library.
 boolean isCodeEachMessageIndependently()
           
 void reset()
          Resets the state of the previous values dictionaries (sets the state of the previous values to undefined).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

codeEachMessageIndependently

protected boolean codeEachMessageIndependently

templateLibrary

protected TemplateLibrary templateLibrary

fixVersion

protected Version fixVersion

fastVersion

protected FastVersion fastVersion

fixBlock

protected FixBlock fixBlock

lastScaledDecimal

protected biz.onixs.fix.fastnew.ScaledDecimal lastScaledDecimal

lastTemplateId

protected int lastTemplateId
Constructor Detail

Encoder

public Encoder(TemplateLibrary templateLibrary,
               Version fixVersion,
               FastVersion fastVersion)
Constructor.

Parameters:
templateLibrary - template library to use
fixVersion - source FIX version
fastVersion - target FAST version

Encoder

public Encoder(TemplateLibrary templateLibrary,
               Version fixVersion,
               FastVersion fastVersion,
               boolean codeEachMessageIndependently)
Constructor.

Parameters:
templateLibrary - template library to use
fixVersion - source FIX version
fastVersion - target FAST version
codeEachMessageIndependently - option to reset the previous values dictionaries (default is true)
Method Detail

encode

public byte[] encode(Message message)
              throws FastException
Encodes the given FIX message into a FAST stream chunk.
The template is selected automatically with the max id for the specific FIX message type.

Parameters:
message - input FIX message
Returns:
encoded FAST stream chunk
Throws:
FastException - if encoding failed

encode

public byte[] encode(Message message,
                     int templateId)
              throws FastException
Encodes the given FIX message into a FAST stream chunk.

Parameters:
message - input FIX message
templateId - template id to use
Returns:
encoded FAST stream chunk
Throws:
FastException - if encoding failed

getTemplateLibrary

public TemplateLibrary getTemplateLibrary()
Returns associated template library.

Returns:
associated template library

getFastVersion

public FastVersion getFastVersion()
Returns source FAST version.

Returns:
source FAST version

getFixVersion

public Version getFixVersion()
Returns target FIX version.

Returns:
target FIX version

isCodeEachMessageIndependently

public boolean isCodeEachMessageIndependently()

reset

public void reset()
Resets the state of the previous values dictionaries (sets the state of the previous values to undefined).



Copyright © 2005-2012 Onix Solutions. All Rights Reserved.