biz.onixs.fix.fastnew
Class Decoder

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

public class Decoder
extends Object

FAST-to-FIX Decoder.


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
Decoder(TemplateLibrary templateLibrary, FastVersion fastVersion, Version fixVersion)
          Constructor.
Decoder(TemplateLibrary templateLibrary, FastVersion fastVersion, Version fixVersion, boolean codeEachMessageIndependently)
          Constructor.
 
Method Summary
 Message decode(byte[] buffer)
          Decodes the given FAST stream chunk into the corresponding FIX Message.
 Message decode(byte[] buffer, int offset)
          Decodes the given FAST stream chunk into the corresponding FIX Message.
 Message decode(byte[] buffer, int offset, int count)
          Decodes the given FAST stream chunk into the corresponding FIX Message.
 Message decode(biz.onixs.util.ByteBuffer buffer)
          Decodes the given FAST stream chunk into the corresponding FIX Message.
 Message decode(biz.onixs.util.ByteBuffer buffer, int offset)
          Decodes the given FAST stream chunk into the corresponding FIX Message.
 void decode(DecodeResult result, byte[] buffer)
          Decodes the given FAST stream chunk into the corresponding FIX Message.
 void decode(DecodeResult result, byte[] buffer, int offset)
          Decodes the given FAST stream chunk into the corresponding FIX Message.
 void decode(DecodeResult result, byte[] buffer, int offset, int count)
          Decodes the given FAST stream chunk into the corresponding FIX Message.
 void decode(DecodeResult result, biz.onixs.util.ByteBuffer buffer)
          Decodes the given FAST stream chunk into the corresponding FIX Message.
 void decode(DecodeResult result, biz.onixs.util.ByteBuffer buffer, int offset)
          Decodes the given FAST stream chunk into the corresponding FIX Message.
 FastVersion getFastVersion()
          Returns source FAST version.
 FixMessageFactory getFixMessageFactory()
          Returns message factory to use for creating decoded FIX message instance.
 Version getFixVersion()
          Returns target FIX version.
 int getMaximumNumberOfRepeatingGroupEntries()
          Returns maximum allowed number of repeating group entries.
 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).
 void setFixMessageFactory(FixMessageFactory messageFactory)
          Sets message factory to use for creating decoded FIX message instance.
 void setMaximumNumberOfRepeatingGroupEntries(int maximumNumberOfRepeatingGroupEntries)
          Sets maximum allowed number of repeating group entries.
 
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

Decoder

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

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

Decoder

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

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

getMaximumNumberOfRepeatingGroupEntries

public int getMaximumNumberOfRepeatingGroupEntries()
Returns maximum allowed number of repeating group entries. If the limit is exceeded then the exception is thrown. The default value is 1000.

Returns:
max number of repeating group entries

setMaximumNumberOfRepeatingGroupEntries

public void setMaximumNumberOfRepeatingGroupEntries(int maximumNumberOfRepeatingGroupEntries)
Sets maximum allowed number of repeating group entries. If the limit is exceeded then the exception is thrown. The default value is 1000.

Parameters:
maximumNumberOfRepeatingGroupEntries - max number of repeating group entries

getFixMessageFactory

public FixMessageFactory getFixMessageFactory()
Returns message factory to use for creating decoded FIX message instance.

Returns:
FIX message factory

setFixMessageFactory

public void setFixMessageFactory(FixMessageFactory messageFactory)
Sets message factory to use for creating decoded FIX message instance.

Parameters:
messageFactory - FIX message factory

decode

public Message decode(biz.onixs.util.ByteBuffer buffer)
               throws FastException
Decodes the given FAST stream chunk into the corresponding FIX Message.

Parameters:
buffer - an array of bytes that contains the source FAST stream chunk
Returns:
decoded FIX message or null if message cannot be decoded
Throws:
FastException - if error occurs

decode

public Message decode(biz.onixs.util.ByteBuffer buffer,
                      int offset)
               throws FastException
Decodes the given FAST stream chunk into the corresponding FIX Message.

Parameters:
buffer - an array of bytes that contains the source FAST stream chunk
offset - the zero-based byte offset in buffer at which to begin decoding
Returns:
decoded FIX message or null if message cannot be decoded
Throws:
FastException - if error occurs

decode

public Message decode(byte[] buffer,
                      int offset,
                      int count)
               throws FastException
Decodes the given FAST stream chunk into the corresponding FIX Message.

Parameters:
buffer - an array of bytes that contains the source FAST stream chunk
offset - the zero-based byte offset in buffer at which to begin decoding
count - the number of bytes to process
Returns:
decoded FIX message or null if message cannot be decoded
Throws:
FastException - if error occurs

decode

public Message decode(byte[] buffer,
                      int offset)
               throws FastException
Decodes the given FAST stream chunk into the corresponding FIX Message.

Parameters:
buffer - input FAST data
offset - the number of bytes from the beginning of the byte array to skip
Returns:
decoded FIX message or null if message cannot be decoded
Throws:
FastException - if decoding failed

decode

public Message decode(byte[] buffer)
               throws FastException
Decodes the given FAST stream chunk into the corresponding FIX Message.

Parameters:
buffer - an array of bytes that contains the source FAST stream chunk
Returns:
decoded FIX message or null if message cannot be decoded
Throws:
FastException - if decoding failed

decode

public void decode(DecodeResult result,
                   biz.onixs.util.ByteBuffer buffer)
            throws FastException
Decodes the given FAST stream chunk into the corresponding FIX Message.

Parameters:
result - decode result to fill
buffer - an array of bytes that contains the source FAST stream chunk
Throws:
FastException - if error occurs

decode

public void decode(DecodeResult result,
                   biz.onixs.util.ByteBuffer buffer,
                   int offset)
            throws FastException
Decodes the given FAST stream chunk into the corresponding FIX Message.

Parameters:
result - decode result to fill
buffer - an array of bytes that contains the source FAST stream chunk
offset - the zero-based byte offset in buffer at which to begin decoding
Throws:
FastException - if error occurs

decode

public void decode(DecodeResult result,
                   byte[] buffer,
                   int offset,
                   int count)
            throws FastException
Decodes the given FAST stream chunk into the corresponding FIX Message.

Parameters:
result - decode result to fill
buffer - an array of bytes that contains the source FAST stream chunk
offset - the zero-based byte offset in buffer at which to begin decoding
count - the number of bytes to process
Throws:
FastException - if error occurs

decode

public void decode(DecodeResult result,
                   byte[] buffer,
                   int offset)
            throws FastException
Decodes the given FAST stream chunk into the corresponding FIX Message.

Parameters:
result - decode result to fill
buffer - input FAST data
offset - the number of bytes from the beginning of the byte array to skip
Throws:
FastException - if decoding failed

decode

public void decode(DecodeResult result,
                   byte[] buffer)
            throws FastException
Decodes the given FAST stream chunk into the corresponding FIX Message.

Parameters:
result - decode result to fill
buffer - an array of bytes that contains the source FAST stream chunk
Throws:
FastException - if decoding 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.