Class SessionParameters

java.lang.Object
com.epam.fixengine.SessionParameters
All Implemented Interfaces:
com.epam.fixengine.session.TradingSessionParameters, Cloneable
Direct Known Subclasses:
ScheduledSessionParameters

public class SessionParameters extends Object implements Cloneable, com.epam.fixengine.session.TradingSessionParameters
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:
  • Field Details

    • DEFAULT_SEQUENCE_NUM

      public static final int DEFAULT_SEQUENCE_NUM
      See Also:
    • SESSION_ID_PROPERTY

      public static final String SESSION_ID_PROPERTY
      See Also:
    • SENDER_COMP_ID_PROPERTY

      public static final String SENDER_COMP_ID_PROPERTY
      See Also:
    • TARGET_COMP_ID_PROPERTY

      public static final String TARGET_COMP_ID_PROPERTY
      See Also:
    • SESSION_QUALIFIER_PROPERTY

      public static final String SESSION_QUALIFIER_PROPERTY
      See Also:
    • SENDER_SUB_ID_PROPERTY

      public static final String SENDER_SUB_ID_PROPERTY
      See Also:
    • SENDER_LOCATION_ID_PROPERTY

      public static final String SENDER_LOCATION_ID_PROPERTY
      See Also:
    • TARGET_SUB_ID_PROPERTY

      public static final String TARGET_SUB_ID_PROPERTY
      See Also:
    • TARGET_LOCATION_ID_PROPERTY

      public static final String TARGET_LOCATION_ID_PROPERTY
      See Also:
    • HOST_PROPERTY

      public static final String HOST_PROPERTY
      See Also:
    • PORT_PROPERTY

      public static final String PORT_PROPERTY
      See Also:
    • APP_VERSION_PROPERTY

      public static final String APP_VERSION_PROPERTY
      See Also:
    • FIX_VERSION_PROPERTY

      public static final String FIX_VERSION_PROPERTY
      See Also:
    • HEARTBEAT_INTERVAL_PROPERTY

      public static final String HEARTBEAT_INTERVAL_PROPERTY
      See Also:
    • LAST_SEQ_NUM_RESET_TIMESTAMP_PROPERTY

      public static final String LAST_SEQ_NUM_RESET_TIMESTAMP_PROPERTY
      See Also:
    • FIX_FIELD_LIST_PROPERTY

      public static final String FIX_FIELD_LIST_PROPERTY
      See Also:
    • INCOMING_LOGIN_FIX_FIELD_LIST_PROPERTY

      public static final String INCOMING_LOGIN_FIX_FIELD_LIST_PROPERTY
      See Also:
    • OUTGOING_LOGIN_FIX_FIELD_LIST_PROPERTY

      public static final String OUTGOING_LOGIN_FIX_FIELD_LIST_PROPERTY
      See Also:
    • USERNAME_PROPERTY

      public static final String USERNAME_PROPERTY
      See Also:
    • PASSWORD_PROPERTY

      public static final String PASSWORD_PROPERTY
      See Also:
    • IN_SEQ_NUMS_FOR_NEXT_CONNECT_PROPERTY

      public static final String IN_SEQ_NUMS_FOR_NEXT_CONNECT_PROPERTY
      See Also:
    • INCOMING_SEQUENCE_NUMBER_PROPERTY

      public static final String INCOMING_SEQUENCE_NUMBER_PROPERTY
      See Also:
    • OUT_SEQ_NUMS_FOR_NEXT_CONNECT_PROPERTY

      public static final String OUT_SEQ_NUMS_FOR_NEXT_CONNECT_PROPERTY
      See Also:
    • OUTGOING_SEQUENCE_NUMBER_PROPERTY

      public static final String OUTGOING_SEQUENCE_NUMBER_PROPERTY
      See Also:
    • SOCKET_CONNECT_ADDRESS_PREFIX_PROPERTY

      public static final String SOCKET_CONNECT_ADDRESS_PREFIX_PROPERTY
      See Also:
    • BACKUP_HOST_PROPERTY

      public static final String BACKUP_HOST_PROPERTY
      See Also:
    • BACKUP_PORT_PROPERTY

      public static final String BACKUP_PORT_PROPERTY
      See Also:
    • defUseSpinningRead

      protected static boolean defUseSpinningRead
    • defUseBlockingSockets

      protected static boolean defUseBlockingSockets
    • defUseJavaNIO

      protected static boolean defUseJavaNIO
    • senderSubId

      protected String senderSubId
    • targetSubId

      protected String targetSubId
    • senderLocationId

      protected String senderLocationId
    • targetLocationId

      protected String targetLocationId
    • sessionID

      protected SessionID sessionID
    • heartbeatInterval

      protected int heartbeatInterval
    • fixVersionContainer

      protected com.epam.fixengine.configuration.FIXVersionContainer fixVersionContainer
    • appVersionContainer

      protected com.epam.fixengine.configuration.FIXVersionContainer appVersionContainer
    • host

      protected String host
    • port

      protected Integer port
    • fixFieldList

      protected FIXFieldList fixFieldList
    • incomingLoginFixFieldList

      protected FIXFieldList incomingLoginFixFieldList
    • outgoingLoginFixFieldList

      protected FIXFieldList outgoingLoginFixFieldList
    • configuration

      protected com.epam.fixengine.configuration.Configuration configuration
    • destinations

      protected List<InetSocketAddress> destinations
    • lastSeqNumResetTimestamp

      protected long lastSeqNumResetTimestamp
    • incomingSequenceNumber

      protected long incomingSequenceNumber
    • outgoingSequenceNumber

      protected long outgoingSequenceNumber
    • tradePeriodBegin

      protected CronExpression tradePeriodBegin
    • tradePeriodEnd

      protected CronExpression tradePeriodEnd
    • timeZone

      protected TimeZone timeZone
    • sessionSSLProtocol

      protected String sessionSSLProtocol
    • sessionSSLCipherSuite

      protected String sessionSSLCipherSuite
    • sessionSSLPeerCertificates

      protected Certificate[] sessionSSLPeerCertificates
  • Constructor Details

    • SessionParameters

      public SessionParameters(com.epam.fixengine.configuration.Configuration config)
    • SessionParameters

      public SessionParameters()
  • Method Details

    • getConnectivityParams

      public Map<String,Object> getConnectivityParams()
      Get additional configuration properties for transport.
      Returns:
    • isUseBlockingSocket

      protected boolean isUseBlockingSocket()
    • isUseSpinningRead

      protected boolean isUseSpinningRead()
    • getConfiguration

      public com.epam.fixengine.configuration.Configuration getConfiguration()
    • setConfiguration

      public void setConfiguration(com.epam.fixengine.configuration.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
    • setFixVersion

      public void setFixVersion(String 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
    • setAppVersion

      public void setAppVersion(String appVersion)
      Sets App version. The parameter can be a name of FIX version like "FIX.4.2" or a numeric representation from 2 to 9(FIX.4.0 ... FIX.5.0 sp2).
      Parameters:
      appVersion - the app version
    • searchAppVersion

      public com.epam.fixengine.configuration.FIXVersionContainer searchAppVersion(String appVersion)
    • getFixVersionContainer

      public com.epam.fixengine.configuration.FIXVersionContainer getFixVersionContainer()
    • setFixVersion

      public void setFixVersion(com.epam.fixengine.configuration.FIXVersionContainer fixVersionContainer)
    • getAppVersionContainer

      public com.epam.fixengine.configuration.FIXVersionContainer getAppVersionContainer()
    • setAppVersion

      public void setAppVersion(com.epam.fixengine.configuration.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
    • 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
    • hasPort

      public boolean hasPort()
    • getPort

      public int getPort()
      Gets port.
    • setPort

      public void setPort(Integer port)
      Sets port.
      Parameters:
      port - the port
    • getSessionSSLProtocol

      public String getSessionSSLProtocol()
    • setSessionSSLProtocol

      public void setSessionSSLProtocol(String sessionSSLProtocol)
    • getSessionSSLCipherSuite

      public String getSessionSSLCipherSuite()
    • setSessionSSLCipherSuite

      public void setSessionSSLCipherSuite(String sessionSSLCipherSuite)
    • getSessionSSLPeerCertificates

      public Certificate[] getSessionSSLPeerCertificates()
    • setSessionSSLPeerCertificates

      public void setSessionSSLPeerCertificates(Certificate[] sessionSSLPeerCertificates)
    • getForceSeqNumReset

      public ForceSeqNumReset getForceSeqNumReset()
      Gets force sequence reset.
    • setForceSeqNumReset

      public void setForceSeqNumReset(ForceSeqNumReset forceSeqNumReset)
      Sets force sequence reset.
      Parameters:
      forceSeqNumReset - the forceSeqNumReset
    • 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()
    • 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
    • fromConfiguration

      public void fromConfiguration(com.epam.fixengine.configuration.Configuration configuration)
    • 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
    • isSetSeqNumsOnNextConnect

      public boolean isSetSeqNumsOnNextConnect()
    • isSetInSeqNumsOnNextConnect

      public boolean isSetInSeqNumsOnNextConnect()
    • isSetOutSeqNumsOnNextConnect

      public boolean isSetOutSeqNumsOnNextConnect()
    • setIncomingSequenceNumber

      public void setIncomingSequenceNumber(long incomingSequenceNumber)
    • setOutgoingSequenceNumber

      public void setOutgoingSequenceNumber(long outgoingSequenceNumber)
    • getIncomingSequenceNumber

      public long getIncomingSequenceNumber()
    • getOutgoingSequenceNumber

      public long getOutgoingSequenceNumber()
    • disableInSeqNumsOnNextConnect

      public void disableInSeqNumsOnNextConnect()
    • disableOutSeqNumsOnNextConnect

      public void disableOutSeqNumsOnNextConnect()
    • 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

      @Deprecated public String getBackupHost()
      Deprecated.
      use getDestinations method.
      Gets backup host.
    • getBackupPort

      @Deprecated public int getBackupPort()
      Deprecated.
      use getDestinations method.
      Gets backup port.
    • setBackupHost

      @Deprecated public void setBackupHost(String backupHost)
      Deprecated.
      use addDestination method.
      Sets backup host.
      Parameters:
      backupHost - the backup port
    • setBackupPort

      @Deprecated public void setBackupPort(int backupPort)
      Deprecated.
      use addDestination method.
      Sets backup port.
      Parameters:
      backupPort - the backup port
    • getDestinations

      public List<InetSocketAddress> getDestinations()
      Gets alternative(backup) destinations for initiator.
      Returns:
      list of alternative destinations.
    • addDestination

      public void addDestination(String host, int port)
      Add alternative(backup) destination for initiator.
      Parameters:
      host - backup host
      port - backup port
    • addDestination

      public void addDestination(InetSocketAddress destination)
      Add alternative(backup) destination for initiator.
      Parameters:
      destination - backup address
    • addAllDestinations

      public void addAllDestinations(Collection<InetSocketAddress> destinations)
      Add alternative(backup) destinations for initiator.
      Parameters:
      destinations - backup addresses
    • removeDestination

      public void removeDestination(String host, int port)
      Remove alternative(backup) destination from connections list.
      Parameters:
      host - backup host
      port - backup port
    • removeDestination

      public void removeDestination(InetSocketAddress destination)
      Remove alternative(backup) destination from connections list.
      Parameters:
      destination - backup address
    • removeAllDestinations

      public void removeAllDestinations(Collection<InetSocketAddress> destinations)
      Remove alternative(backup) destinations from connections list.
      Parameters:
      destinations - backup addresses
    • createNewFIXSession

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

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

      Throws:
      IOException
    • createAcceptorSession

      public FIXSession createAcceptorSession() throws IOException
      Creates acceptor session in disconnected state
      Returns:
      FIX session
      Throws:
      IOException
    • createInitiatorSession

      public FIXSession createInitiatorSession() throws IOException
      Creates initiator session
      Returns:
      FIX session
      Throws:
      IOException
    • printConfiguration

      public void printConfiguration()
    • isNeedToIncludeLastProcessed

      public boolean isNeedToIncludeLastProcessed()
    • setCustomLoader

      public void setCustomLoader(Function<String,Object> handlersLoader)
      The loader is used for loading configurable classes.
      Parameters:
      handlersLoader -
    • getCustomLoader

      public Function<String,Object> getCustomLoader()
      The loader is used for loading configurable classes.
    • 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:
    • getTradePeriodBegin

      public CronExpression getTradePeriodBegin()
      Specified by:
      getTradePeriodBegin in interface com.epam.fixengine.session.TradingSessionParameters
    • setTradePeriodBegin

      public void setTradePeriodBegin(CronExpression cronExpression)
      Specified by:
      setTradePeriodBegin in interface com.epam.fixengine.session.TradingSessionParameters
    • getTradePeriodEnd

      public CronExpression getTradePeriodEnd()
      Specified by:
      getTradePeriodEnd in interface com.epam.fixengine.session.TradingSessionParameters
    • setTradePeriodEnd

      public void setTradePeriodEnd(CronExpression cronExpression)
      Specified by:
      setTradePeriodEnd in interface com.epam.fixengine.session.TradingSessionParameters
    • getTimeZone

      public TimeZone getTimeZone()
      Specified by:
      getTimeZone in interface com.epam.fixengine.session.TradingSessionParameters
    • setTimeZone

      public void setTimeZone(TimeZone timeZone)
      Specified by:
      setTimeZone in interface com.epam.fixengine.session.TradingSessionParameters
    • isFIXT

      public boolean isFIXT()