com.teraspaces.qwfix
Class FIXMessageTokenHelper

java.lang.Object
  extended by com.teraspaces.qwfix.FIXMessageTokenHelper

public final class FIXMessageTokenHelper
extends Object

The helper class to get information associated with a FIX message token.

Because Java doesn't support value type. We use a plain long integer to represent a FIX message token.

Use methods defined in this class to decode more detail information associated with a FIX message token, such as "Direction", "SessionPersistence" or "MsgSeqNum".


Field Summary
static long INVALID_TOKEN
          Represents an invalid token
static long NULL_TOKEN
          Represents a null token
 
Constructor Summary
FIXMessageTokenHelper()
           
 
Method Summary
static FIXMessageDirection getDirection(long token)
          Gets the direction.
static int getMsgSeq(long token)
           
static FIXSessionPersistence getPersistence(long token)
          Gets the session persistence.
static long getRemoteToken(long token)
          Gets the remote token.
static boolean isValid(long token)
          Checks if the input token is valid.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INVALID_TOKEN

public static final long INVALID_TOKEN
Represents an invalid token


NULL_TOKEN

public static final long NULL_TOKEN
Represents a null token

Constructor Detail

FIXMessageTokenHelper

public FIXMessageTokenHelper()
Method Detail

getMsgSeq

public static int getMsgSeq(long token)

getDirection

public static FIXMessageDirection getDirection(long token)
Gets the direction.

Parameters:
token - the token
Returns:
the direction

getRemoteToken

public static long getRemoteToken(long token)
Gets the remote token.

Parameters:
token - the token
Returns:
the remote token

getPersistence

public static FIXSessionPersistence getPersistence(long token)
Gets the session persistence.

Parameters:
token - the token
Returns:
the session persistence

isValid

public static boolean isValid(long token)
Checks if the input token is valid.

Parameters:
token - the token
Returns:
true, if is valid