com.epam.fixengine
Class SessionParameters

java.lang.Object
  extended by com.epam.fixengine.SessionParameters
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
ScheduledSessionParameters

public class SessionParameters
extends Object
implements Cloneable

This bean contains all session level configuration for current session.

It is possible to confiniently define a list of custom FIX fields that will be added to each message. For more complex message customization take a look at

See Also:
for more precise customization

Field Summary
protected static boolean defUseBlockingSockets
           
protected static boolean defUseJavaNIO
           
protected static boolean defUseSpinningRead
           
 
Constructor Summary
SessionParameters()
           
SessionParameters(Configuration config)
           
 
Method Summary
 void addHeaderField(FIXField field)
          Add user defined field.
 void addIncomingLoginField(FIXField field)
          Added incoming login field.
 void addOutgoingLoginField(FIXField field)
          Deprecated. 
 void addOutgoingLoginField(int tag, byte value)
          Add field to outgoing login fields list.
 void addOutgoingLoginField(int tag, byte[] value)
          Add field to outgoing login fields list.
 void addOutgoingLoginField(int tag, byte[] value, int offset, int length)
          Add field to outgoing login fields list.
 void addOutgoingLoginField(int tag, Calendar value, FIXDateFormatterFactory.FIX_DATE_TYPE type)
          Add field to outgoing login fields list.
 void addOutgoingLoginField(int tag, CharSequence value)
          Add field to outgoing login fields list.
 void addOutgoingLoginField(int tag, double value, int precision)
          Add field to outgoing login fields list.
 void addOutgoingLoginField(int tag, long value)
          Add field to outgoing login fields list.
 Object clone()
          Creates and returns a copy of this object.
 FIXSession createNewFIXSession()
          Creates initiator fix session.
 void decrementIncomingSequenceNumber()
          Decrements incoming sequence number.
 void decrementOutgoingSequenceNumber()
          Decrements outgoing sequence number.
 void disableResetInSeqNumsOnNextConnect()
           
 void disableResetOutSeqNumsOnNextConnect()
           
 boolean equals(Object o)
           
 void fromProperties(Properties properties)
          Creates the SessionParameters from properties.
 FIXVersion getAppVersion()
          Gets App version.
 FIXVersionContainer getAppVersionContainer()
           
 String getBackupHost()
          Gets backup host.
 int getBackupPort()
          Gets backup port.
 Configuration getConfiguration()
           
 HashMap<String,Object> getConnectivityParams()
          Get additional configuration properties for transport.
 com.epam.fixengine.encryption.EncryptionType getEncryptionType()
          Gets encryption type.
 FIXFieldList getFixFieldList()
          Gets user defined fields.
 FIXVersion getFixVersion()
          Gets fix version.
 FIXVersionContainer getFixVersionContainer()
           
 ForceSeqNumReset getForceSeqNumReset()
          Gets force sequence reset.
 int getHeartbeatInterval()
          Gets heartbeat interval.
 String getHost()
          Gets host.
 FIXFieldList getIncomingLoginFixFieldList()
          Gets incoming login fields.
 String getIncomingPassword()
           
 long getIncomingSequenceNumber()
          Gets incoming sequence number.
 String getIncomingUserName()
           
 long getInSeqNumsForNextConnect()
           
 long getLastSeqNumResetTimestamp()
          Gets last seq num reset timestamp.
 FIXFieldList getOutgoingLoginFixFieldList()
          Gets outgoing login fields.
 long getOutgoingSequenceNumber()
          Gets outgoing sequence number.
 long getOutSeqNumsForNextConnect()
           
 String getPassword()
           
 int getPort()
          Gets port.
 long getProcessedIncomingSequenceNumber()
          Gets last valid incoming sequence number.
 String getSenderCompId()
          Gets sender comp id.
 String getSenderLocationId()
          Gets sender location id.
 String getSenderSubId()
          Gets sender sub id.
 SessionID getSessionId()
           
 String getSessionID()
           
 String getSessionQualifier()
           
 String getTargetCompId()
          Gets target comp id.
 String getTargetLocationId()
          Gets target location id.
 String getTargetSubId()
          Gets target sub id.
 String getUserName()
           
 int hashCode()
           
 void incrementIncomingSequenceNumber()
          Increment incoming sequence number.
 void incrementOutgoingSequenceNumber()
          Increment outgoing sequence number.
 boolean isCustomSessionID()
           
 boolean isNeedToIncludeLastProcessed()
           
 boolean isResetInSeqNumsOnNextConnect()
           
 boolean isResetOutSeqNumsOnNextConnect()
           
 boolean isResetSeqNumsOnNextConnect()
           
 boolean isSimilar(SessionParameters other)
          Return true if parameter object describe the same FIX session.
 boolean isSimilar(SessionParameters other, List<String> errors)
          Return true if parameter object describe the same FIX session.
protected  boolean isUseBlockingSocket()
           
 boolean isUseJavaNIO()
           
static boolean isUseJavaNIOByDefault()
           
protected  boolean isUseSpinningRead()
           
 void printConfiguration()
           
 void setAppVersion(FIXVersion appVersion)
          Sets App version.
 void setAppVersion(FIXVersionContainer appVersionContainer)
           
 void setBackupHost(String backupHost)
          Sets backup host.
 void setBackupPort(int backupPort)
          Sets backup port.
 void setConfiguration(Configuration configuration)
          Setter for Configuration.
 void setEncryptionType(com.epam.fixengine.encryption.EncryptionType encryptionType)
          Sets encryption type.
 void setFixFieldList(FIXFieldList fixFieldList)
          Sets user defined fields.
 void setFixVersion(FIXVersion fixVersion)
          Sets fix version.
 void setFixVersion(FIXVersionContainer fixVersionContainer)
           
 void setForceSeqNumReset(ForceSeqNumReset forceSeqNumReset)
          Sets force sequence reset.
 void setHeartbeatInterval(int heartbeatInterval)
          Sets heartbeat interval.
 void setHost(String host)
          Sets host.
 void setIncomingLoginFixFieldList(FIXFieldList incomingLoginFixFieldList)
          Sets incoming login fields.
 void setIncomingSequenceNumber(long incomingSequenceNumber)
          Sets incoming sequence number.
 void setInSeqNumsForNextConnect(long inSeqNumsForNextConnect)
           
 void setLastSeqNumResetTimestamp(long lastSeqNumResetTimestamp)
          Sets last seq num reset timestamp.
 void setOutgoingLoginFixFieldList(FIXFieldList outgoingLoginFixFieldList)
          Sets outgoing login fields.
 void setOutgoingSequenceNumber(long outgoingSequenceNumber)
          Sets outgoing sequence number.
 void setOutSeqNumsForNextConnect(long outSeqNumsForNextConnect)
           
 void setPassword(String password)
           
 void setPort(int port)
          Sets port.
 void setProcessedIncomingSequenceNumber(long lastProcessedIncomingSequenceNumber)
          Sets last valid incoming sequence number.
 void setSenderCompId(String senderCompId)
          Sets sender comp id.
 void setSenderLocationId(String senderLocationId)
          Sets sender location id.
 void setSenderSubId(String senderSubId)
          Sets sender sub id.
 void setSessionID(String sessionId)
          Change session identifier
 void setSessionQualifier(String qualifier)
           
 void setTargetCompId(String targetCompId)
          Sets target comp id.
 void setTargetLocationId(String targetLocationId)
          Sets target location id.
 void setTargetSubId(String targetSubId)
          Sets target sub id.
 void setUserName(String username)
           
 Properties toProperties()
          Creates and returns a copy of this object.
 String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

defUseSpinningRead

protected static boolean defUseSpinningRead

defUseBlockingSockets

protected static boolean defUseBlockingSockets

defUseJavaNIO

protected static boolean defUseJavaNIO
Constructor Detail

SessionParameters

public SessionParameters(Configuration config)

SessionParameters

public SessionParameters()
Method Detail

getConnectivityParams

public HashMap<String,Object> getConnectivityParams()
Get additional configuration properties for transport.

Returns:

isUseBlockingSocket

protected boolean isUseBlockingSocket()

isUseSpinningRead

protected boolean isUseSpinningRead()

getConfiguration

public Configuration getConfiguration()

setConfiguration

public void setConfiguration(Configuration configuration)
Setter for Configuration.

Parameters:
configuration - the configuration

getFixVersion

public FIXVersion getFixVersion()
Gets fix version.


setFixVersion

public void setFixVersion(FIXVersion fixVersion)
Sets fix version.

if fix version is above FIX.5.0 the app version should be FIXT.1.1

Parameters:
fixVersion - the fix version

getAppVersion

public FIXVersion getAppVersion()
Gets App version.


setAppVersion

public void setAppVersion(FIXVersion appVersion)
Sets App version.

Parameters:
appVersion - the app version

getFixVersionContainer

public FIXVersionContainer getFixVersionContainer()

setFixVersion

public void setFixVersion(FIXVersionContainer fixVersionContainer)

getAppVersionContainer

public FIXVersionContainer getAppVersionContainer()

setAppVersion

public void setAppVersion(FIXVersionContainer appVersionContainer)

getFixFieldList

public FIXFieldList getFixFieldList()
Gets user defined fields.

If this list is not empty, Engine add it to each outgoing message.


setFixFieldList

public void setFixFieldList(FIXFieldList fixFieldList)
Sets user defined fields.

If this list is not empty, Engine add it to each outgoing message.

Parameters:
fixFieldList - the user defined fields

addHeaderField

public void addHeaderField(FIXField field)
Add user defined field.

Parameters:
field - the field

getIncomingSequenceNumber

public long getIncomingSequenceNumber()
Gets incoming sequence number.


setIncomingSequenceNumber

public void setIncomingSequenceNumber(long incomingSequenceNumber)
Sets incoming sequence number.

Parameters:
incomingSequenceNumber - the incoming seq number

getOutgoingSequenceNumber

public long getOutgoingSequenceNumber()
Gets outgoing sequence number.


setOutgoingSequenceNumber

public void setOutgoingSequenceNumber(long outgoingSequenceNumber)
Sets outgoing sequence number.

Parameters:
outgoingSequenceNumber - the outgoing seq number

getProcessedIncomingSequenceNumber

public long getProcessedIncomingSequenceNumber()
Gets last valid incoming sequence number.


setProcessedIncomingSequenceNumber

public void setProcessedIncomingSequenceNumber(long lastProcessedIncomingSequenceNumber)
Sets last valid incoming sequence number.

Parameters:
lastProcessedIncomingSequenceNumber -

getSenderCompId

public String getSenderCompId()
Gets sender comp id.


setSenderCompId

public void setSenderCompId(String senderCompId)
Sets sender comp id.

Parameters:
senderCompId - the sender comp id

getTargetCompId

public String getTargetCompId()
Gets target comp id.


setTargetCompId

public void setTargetCompId(String targetCompId)
Sets target comp id.

Parameters:
targetCompId - the target comp id

getSenderSubId

public String getSenderSubId()
Gets sender sub id.


setSenderSubId

public void setSenderSubId(String senderSubId)
Sets sender sub id.

Parameters:
senderSubId - the sender sub id

getTargetSubId

public String getTargetSubId()
Gets target sub id.


setTargetSubId

public void setTargetSubId(String targetSubId)
Sets target sub id.

Parameters:
targetSubId - the target sub id

getSenderLocationId

public String getSenderLocationId()
Gets sender location id.


setSenderLocationId

public void setSenderLocationId(String senderLocationId)
Sets sender location id.

Parameters:
senderLocationId - the sender location id

getTargetLocationId

public String getTargetLocationId()
Gets target location id.


setTargetLocationId

public void setTargetLocationId(String targetLocationId)
Sets target location id.

Parameters:
targetLocationId - the target location id

getSessionID

public String getSessionID()

getSessionId

public SessionID getSessionId()

setSessionID

public void setSessionID(String sessionId)
Change session identifier

Parameters:
sessionId - unique string value. maximum 200 characters length. Allowed characters: a-z, A-Z, 0-9, '.', '-', '_', ' '(space) and '!'

setSessionQualifier

public void setSessionQualifier(String qualifier)

getSessionQualifier

public String getSessionQualifier()

isCustomSessionID

public boolean isCustomSessionID()

getHeartbeatInterval

public int getHeartbeatInterval()
Gets heartbeat interval.


setHeartbeatInterval

public void setHeartbeatInterval(int heartbeatInterval)
Sets heartbeat interval.

Parameters:
heartbeatInterval - the HBI, default value is 30.

getHost

public String getHost()
Gets host.


setHost

public void setHost(String host)
Sets host.

Parameters:
host - the host

getPort

public int getPort()
Gets port.


setPort

public void setPort(int port)
Sets port.

Parameters:
port - the port

getForceSeqNumReset

public ForceSeqNumReset getForceSeqNumReset()
Gets force sequence reset.


setForceSeqNumReset

public void setForceSeqNumReset(ForceSeqNumReset forceSeqNumReset)
Sets force sequence reset.

Parameters:
forceSeqNumReset - the forceSeqNumReset

incrementIncomingSequenceNumber

public void incrementIncomingSequenceNumber()
Increment incoming sequence number. This method Engine call when message received.


incrementOutgoingSequenceNumber

public void incrementOutgoingSequenceNumber()
Increment outgoing sequence number. This method Engine call when message will send.


setUserName

public void setUserName(String username)

getUserName

public String getUserName()

setPassword

public void setPassword(String password)

getPassword

public String getPassword()

getIncomingUserName

public String getIncomingUserName()

getIncomingPassword

public String getIncomingPassword()

addIncomingLoginField

public void addIncomingLoginField(FIXField field)
Added incoming login field.

Parameters:
field - the login field

getIncomingLoginFixFieldList

public FIXFieldList getIncomingLoginFixFieldList()
Gets incoming login fields.

Returns:
FIXFieldList list of field

setIncomingLoginFixFieldList

public void setIncomingLoginFixFieldList(FIXFieldList incomingLoginFixFieldList)
Sets incoming login fields. Engine used incomingLoginFixFieldList only for acceptor session.

Parameters:
incomingLoginFixFieldList - the incoming login fix field list

getOutgoingLoginFixFieldList

public FIXFieldList getOutgoingLoginFixFieldList()
Gets outgoing login fields.

This parameter used only for initiator session, Engine added outgoingLoginFixFieldList to login message.

Returns:
list of fields

setOutgoingLoginFixFieldList

public void setOutgoingLoginFixFieldList(FIXFieldList outgoingLoginFixFieldList)
Sets outgoing login fields.

Parameters:
outgoingLoginFixFieldList - the list of outgoing fields

addOutgoingLoginField

@Deprecated
public void addOutgoingLoginField(FIXField field)
Deprecated. 

Add field to outgoing login fields list.

Parameters:
field - login field

addOutgoingLoginField

public void addOutgoingLoginField(int tag,
                                  CharSequence value)
Add field to outgoing login fields list.

Parameters:
tag -
value -

addOutgoingLoginField

public void addOutgoingLoginField(int tag,
                                  byte value)
Add field to outgoing login fields list.

Parameters:
tag -
value -

addOutgoingLoginField

public void addOutgoingLoginField(int tag,
                                  byte[] value)
Add field to outgoing login fields list.

Parameters:
tag -
value -

addOutgoingLoginField

public void addOutgoingLoginField(int tag,
                                  byte[] value,
                                  int offset,
                                  int length)
Add field to outgoing login fields list.

Parameters:
tag -
value -

addOutgoingLoginField

public void addOutgoingLoginField(int tag,
                                  long value)
Add field to outgoing login fields list.

Parameters:
tag -
value -

addOutgoingLoginField

public void addOutgoingLoginField(int tag,
                                  double value,
                                  int precision)
Add field to outgoing login fields list.

Parameters:
tag -
value -

addOutgoingLoginField

public void addOutgoingLoginField(int tag,
                                  Calendar value,
                                  FIXDateFormatterFactory.FIX_DATE_TYPE type)
Add field to outgoing login fields list.

Parameters:
tag -
value -

getEncryptionType

public com.epam.fixengine.encryption.EncryptionType getEncryptionType()
Gets encryption type.

Returns:
EncryptionType

setEncryptionType

public void setEncryptionType(com.epam.fixengine.encryption.EncryptionType encryptionType)
Sets encryption type.

Parameters:
encryptionType - the encryption type

clone

public Object clone()
             throws CloneNotSupportedException
Creates and returns a copy of this object.

Overrides:
clone in class Object
Returns:
SessionParameters
Throws:
CloneNotSupportedException

toProperties

public Properties toProperties()
Creates and returns a copy of this object.
The engine calls this method when the specific parameters should be serialized to properties.


fromProperties

public void fromProperties(Properties properties)
Creates the SessionParameters from properties.
The engine calls this method when the stored parameters should be de-serialized from properties.

Parameters:
properties - the properties

decrementIncomingSequenceNumber

public void decrementIncomingSequenceNumber()
Decrements incoming sequence number. This method Engine call when message is rejected.


decrementOutgoingSequenceNumber

public void decrementOutgoingSequenceNumber()
Decrements outgoing sequence number.


getLastSeqNumResetTimestamp

public long getLastSeqNumResetTimestamp()
Gets last seq num reset timestamp.


setLastSeqNumResetTimestamp

public void setLastSeqNumResetTimestamp(long lastSeqNumResetTimestamp)
Sets last seq num reset timestamp.

Parameters:
lastSeqNumResetTimestamp - the timestamp

isResetSeqNumsOnNextConnect

public boolean isResetSeqNumsOnNextConnect()

isResetInSeqNumsOnNextConnect

public boolean isResetInSeqNumsOnNextConnect()

isResetOutSeqNumsOnNextConnect

public boolean isResetOutSeqNumsOnNextConnect()

setInSeqNumsForNextConnect

public void setInSeqNumsForNextConnect(long inSeqNumsForNextConnect)

setOutSeqNumsForNextConnect

public void setOutSeqNumsForNextConnect(long outSeqNumsForNextConnect)

getInSeqNumsForNextConnect

public long getInSeqNumsForNextConnect()

getOutSeqNumsForNextConnect

public long getOutSeqNumsForNextConnect()

disableResetInSeqNumsOnNextConnect

public void disableResetInSeqNumsOnNextConnect()

disableResetOutSeqNumsOnNextConnect

public void disableResetOutSeqNumsOnNextConnect()

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

getBackupHost

public String getBackupHost()
Gets backup host.


getBackupPort

public int getBackupPort()
Gets backup port.


setBackupHost

public void setBackupHost(String backupHost)
Sets backup host.

Parameters:
backupHost - the backup port

setBackupPort

public void setBackupPort(int backupPort)
Sets backup port.

Parameters:
backupPort - the backup port

createNewFIXSession

public FIXSession createNewFIXSession()
                               throws IOException
Creates initiator fix session.

User can use StandardFIXSessionFactory.getFactory(SessionParameters).createInitiatorSession(SessionParameters) instead this method.

Throws:
IOException

printConfiguration

public void printConfiguration()

isNeedToIncludeLastProcessed

public boolean isNeedToIncludeLastProcessed()

isUseJavaNIO

public boolean isUseJavaNIO()

isUseJavaNIOByDefault

public static boolean isUseJavaNIOByDefault()

isSimilar

public boolean isSimilar(SessionParameters other)
Return true if parameter object describe the same FIX session.

Parameters:
other -
Returns:

isSimilar

public boolean isSimilar(SessionParameters other,
                         List<String> errors)
Return true if parameter object describe the same FIX session.

Parameters:
other -
Returns:


Copyright © 2000-2014 EPAM Systems. All Rights Reserved.