Package com.epam.fixengine
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final String
protected com.epam.fixengine.configuration.FIXVersionContainer
static final String
static final String
protected com.epam.fixengine.configuration.Configuration
static final int
protected static boolean
protected static boolean
protected static boolean
protected List<InetSocketAddress>
static final String
static final String
protected FIXFieldList
protected com.epam.fixengine.configuration.FIXVersionContainer
static final String
protected int
protected String
static final String
static final String
static final String
static final String
protected FIXFieldList
protected long
static final String
protected long
static final String
static final String
static final String
protected FIXFieldList
protected long
static final String
protected Integer
static final String
static final String
static final String
static final String
protected String
protected String
static final String
static final String
protected SessionID
protected String
protected Certificate[]
protected String
static final String
static final String
static final String
static final String
protected String
protected String
protected TimeZone
protected CronExpression
protected CronExpression
static final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAllDestinations
(Collection<InetSocketAddress> destinations) Add alternative(backup) destinations for initiator.void
addDestination
(String host, int port) Add alternative(backup) destination for initiator.void
addDestination
(InetSocketAddress destination) Add alternative(backup) destination for initiator.void
addHeaderField
(FIXField field) Add user defined field.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, double value, int precision) Add field to outgoing login fields list.void
addOutgoingLoginField
(int tag, long value) Add field to outgoing login fields list.void
addOutgoingLoginField
(int tag, CharSequence value) 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
(FIXField field) Deprecated.clone()
Creates and returns a copy of this object.Creates acceptor session in disconnected stateCreates initiator sessionDeprecated.void
void
boolean
void
fromConfiguration
(com.epam.fixengine.configuration.Configuration configuration) void
fromProperties
(Properties properties) Creates the SessionParameters from properties.Gets App version.com.epam.fixengine.configuration.FIXVersionContainer
Deprecated.usegetDestinations
method.int
Deprecated.usegetDestinations
method.com.epam.fixengine.configuration.Configuration
Get additional configuration properties for transport.The loader is used for loading configurable classes.Gets alternative(backup) destinations for initiator.com.epam.fixengine.encryption.EncryptionType
Gets encryption type.Gets user defined fields.Gets fix version.com.epam.fixengine.configuration.FIXVersionContainer
Gets force sequence reset.int
Gets heartbeat interval.getHost()
Gets host.Gets incoming login fields.long
long
Gets last seq num reset timestamp.Gets outgoing login fields.long
int
getPort()
Gets port.Gets sender comp id.Gets sender location id.Gets sender sub id.Gets target comp id.Gets target location id.Gets target sub id.int
hashCode()
boolean
hasPort()
boolean
boolean
isFIXT()
boolean
boolean
boolean
boolean
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
boolean
static boolean
protected boolean
void
void
removeAllDestinations
(Collection<InetSocketAddress> destinations) Remove alternative(backup) destinations from connections list.void
removeDestination
(String host, int port) Remove alternative(backup) destination from connections list.void
removeDestination
(InetSocketAddress destination) Remove alternative(backup) destination from connections list.com.epam.fixengine.configuration.FIXVersionContainer
searchAppVersion
(String appVersion) void
setAppVersion
(FIXVersion appVersion) Sets App version.void
setAppVersion
(com.epam.fixengine.configuration.FIXVersionContainer appVersionContainer) void
setAppVersion
(String appVersion) Sets App version.void
setBackupHost
(String backupHost) Deprecated.useaddDestination
method.void
setBackupPort
(int backupPort) Deprecated.useaddDestination
method.void
setConfiguration
(com.epam.fixengine.configuration.Configuration configuration) Setter for Configuration.void
setCustomLoader
(Function<String, Object> handlersLoader) The loader is used for loading configurable classes.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
(com.epam.fixengine.configuration.FIXVersionContainer fixVersionContainer) void
setFixVersion
(String fixVersion) Sets fix version.void
setForceSeqNumReset
(ForceSeqNumReset forceSeqNumReset) Sets force sequence reset.void
setHeartbeatInterval
(int heartbeatInterval) Sets heartbeat interval.void
Sets host.void
setIncomingLoginFixFieldList
(FIXFieldList incomingLoginFixFieldList) Sets incoming login fields.void
setIncomingSequenceNumber
(long incomingSequenceNumber) void
setLastSeqNumResetTimestamp
(long lastSeqNumResetTimestamp) Sets last seq num reset timestamp.void
setOutgoingLoginFixFieldList
(FIXFieldList outgoingLoginFixFieldList) Sets outgoing login fields.void
setOutgoingSequenceNumber
(long outgoingSequenceNumber) void
setPassword
(String password) void
Sets port.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 identifiervoid
setSessionQualifier
(String qualifier) void
setSessionSSLCipherSuite
(String sessionSSLCipherSuite) void
setSessionSSLPeerCertificates
(Certificate[] sessionSSLPeerCertificates) void
setSessionSSLProtocol
(String sessionSSLProtocol) 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
setTimeZone
(TimeZone timeZone) void
setTradePeriodBegin
(CronExpression cronExpression) void
setTradePeriodEnd
(CronExpression cronExpression) void
setUserName
(String username) Creates and returns a copy of this object.toString()
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.epam.fixengine.session.TradingSessionParameters
clearTradePeriod, clearTradePeriodBegin, clearTradePeriodEnd, isOnlyPeriodBeginDefined, isTimestampAfterTradingPeriodBegin, isTimestampAfterTradingPeriodBegin, isTimestampAfterTradingPeriodEnd, isTimestampInTradingPeriod, isTradingPeriodDefined
-
Field Details
-
DEFAULT_SEQUENCE_NUM
public static final int DEFAULT_SEQUENCE_NUM- See Also:
-
SESSION_ID_PROPERTY
- See Also:
-
SENDER_COMP_ID_PROPERTY
- See Also:
-
TARGET_COMP_ID_PROPERTY
- See Also:
-
SESSION_QUALIFIER_PROPERTY
- See Also:
-
SENDER_SUB_ID_PROPERTY
- See Also:
-
SENDER_LOCATION_ID_PROPERTY
- See Also:
-
TARGET_SUB_ID_PROPERTY
- See Also:
-
TARGET_LOCATION_ID_PROPERTY
- See Also:
-
HOST_PROPERTY
- See Also:
-
PORT_PROPERTY
- See Also:
-
APP_VERSION_PROPERTY
- See Also:
-
FIX_VERSION_PROPERTY
- See Also:
-
HEARTBEAT_INTERVAL_PROPERTY
- See Also:
-
LAST_SEQ_NUM_RESET_TIMESTAMP_PROPERTY
- See Also:
-
FIX_FIELD_LIST_PROPERTY
- See Also:
-
INCOMING_LOGIN_FIX_FIELD_LIST_PROPERTY
- See Also:
-
OUTGOING_LOGIN_FIX_FIELD_LIST_PROPERTY
- See Also:
-
USERNAME_PROPERTY
- See Also:
-
PASSWORD_PROPERTY
- See Also:
-
IN_SEQ_NUMS_FOR_NEXT_CONNECT_PROPERTY
- See Also:
-
INCOMING_SEQUENCE_NUMBER_PROPERTY
- See Also:
-
OUT_SEQ_NUMS_FOR_NEXT_CONNECT_PROPERTY
- See Also:
-
OUTGOING_SEQUENCE_NUMBER_PROPERTY
- See Also:
-
SOCKET_CONNECT_ADDRESS_PREFIX_PROPERTY
- See Also:
-
BACKUP_HOST_PROPERTY
- See Also:
-
BACKUP_PORT_PROPERTY
- See Also:
-
defUseSpinningRead
protected static boolean defUseSpinningRead -
defUseBlockingSockets
protected static boolean defUseBlockingSockets -
defUseJavaNIO
protected static boolean defUseJavaNIO -
senderSubId
-
targetSubId
-
senderLocationId
-
targetLocationId
-
sessionID
-
heartbeatInterval
protected int heartbeatInterval -
fixVersionContainer
protected com.epam.fixengine.configuration.FIXVersionContainer fixVersionContainer -
appVersionContainer
protected com.epam.fixengine.configuration.FIXVersionContainer appVersionContainer -
host
-
port
-
fixFieldList
-
incomingLoginFixFieldList
-
outgoingLoginFixFieldList
-
configuration
protected com.epam.fixengine.configuration.Configuration configuration -
destinations
-
lastSeqNumResetTimestamp
protected long lastSeqNumResetTimestamp -
incomingSequenceNumber
protected long incomingSequenceNumber -
outgoingSequenceNumber
protected long outgoingSequenceNumber -
tradePeriodBegin
-
tradePeriodEnd
-
timeZone
-
sessionSSLProtocol
-
sessionSSLCipherSuite
-
sessionSSLPeerCertificates
-
-
Constructor Details
-
SessionParameters
public SessionParameters(com.epam.fixengine.configuration.Configuration config) -
SessionParameters
public SessionParameters()
-
-
Method Details
-
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
Gets fix version. -
setFixVersion
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
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
Gets App version. -
setAppVersion
Sets App version.- Parameters:
appVersion
- the app version
-
setAppVersion
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
-
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
Gets user defined fields.If this list is not empty, Engine add it to each outgoing message.
-
setFixFieldList
Sets user defined fields.If this list is not empty, Engine add it to each outgoing message.
- Parameters:
fixFieldList
- the user defined fields
-
addHeaderField
Add user defined field.- Parameters:
field
- the field
-
getSenderCompId
Gets sender comp id. -
setSenderCompId
Sets sender comp id.- Parameters:
senderCompId
- the sender comp id
-
getTargetCompId
Gets target comp id. -
setTargetCompId
Sets target comp id.- Parameters:
targetCompId
- the target comp id
-
getSenderSubId
Gets sender sub id. -
setSenderSubId
Sets sender sub id.- Parameters:
senderSubId
- the sender sub id
-
getTargetSubId
Gets target sub id. -
setTargetSubId
Sets target sub id.- Parameters:
targetSubId
- the target sub id
-
getSenderLocationId
Gets sender location id. -
setSenderLocationId
Sets sender location id.- Parameters:
senderLocationId
- the sender location id
-
getTargetLocationId
Gets target location id. -
setTargetLocationId
Sets target location id.- Parameters:
targetLocationId
- the target location id
-
getSessionID
-
getSessionId
-
setSessionID
Change session identifier- Parameters:
sessionId
- unique string value. maximum 200 characters length. Allowed characters: a-z, A-Z, 0-9, '.', '-', '_', ' '(space) and '!'
-
setSessionQualifier
-
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
Gets host. -
setHost
Sets host.- Parameters:
host
- the host
-
hasPort
public boolean hasPort() -
getPort
public int getPort()Gets port. -
setPort
Sets port.- Parameters:
port
- the port
-
getSessionSSLProtocol
-
setSessionSSLProtocol
-
getSessionSSLCipherSuite
-
setSessionSSLCipherSuite
-
getSessionSSLPeerCertificates
-
setSessionSSLPeerCertificates
-
getForceSeqNumReset
Gets force sequence reset. -
setForceSeqNumReset
Sets force sequence reset.- Parameters:
forceSeqNumReset
- the forceSeqNumReset
-
setUserName
-
getUserName
-
setPassword
-
getPassword
-
getIncomingUserName
-
getIncomingPassword
-
getIncomingLoginFixFieldList
Gets incoming login fields.- Returns:
- FIXFieldList list of field
-
setIncomingLoginFixFieldList
Sets incoming login fields. Engine used incomingLoginFixFieldList only for acceptor session.- Parameters:
incomingLoginFixFieldList
- the incoming login fix field list
-
getOutgoingLoginFixFieldList
Gets outgoing login fields.This parameter used only for initiator session, Engine added outgoingLoginFixFieldList to login message.
- Returns:
- list of fields
-
setOutgoingLoginFixFieldList
Sets outgoing login fields.- Parameters:
outgoingLoginFixFieldList
- the list of outgoing fields
-
addOutgoingLoginField
Deprecated.Add field to outgoing login fields list.- Parameters:
field
- login field
-
addOutgoingLoginField
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
Creates and returns a copy of this object.- Overrides:
clone
in classObject
- Returns:
- SessionParameters
- Throws:
CloneNotSupportedException
-
toProperties
Creates and returns a copy of this object. The engine calls this method when the specific parameters should be serialized to properties. -
fromProperties
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
-
equals
-
hashCode
public int hashCode() -
getBackupHost
Deprecated.usegetDestinations
method.Gets backup host. -
getBackupPort
Deprecated.usegetDestinations
method.Gets backup port. -
setBackupHost
Deprecated.useaddDestination
method.Sets backup host.- Parameters:
backupHost
- the backup port
-
setBackupPort
Deprecated.useaddDestination
method.Sets backup port.- Parameters:
backupPort
- the backup port
-
getDestinations
Gets alternative(backup) destinations for initiator.- Returns:
- list of alternative destinations.
-
addDestination
Add alternative(backup) destination for initiator.- Parameters:
host
- backup hostport
- backup port
-
addDestination
Add alternative(backup) destination for initiator.- Parameters:
destination
- backup address
-
addAllDestinations
Add alternative(backup) destinations for initiator.- Parameters:
destinations
- backup addresses
-
removeDestination
Remove alternative(backup) destination from connections list.- Parameters:
host
- backup hostport
- backup port
-
removeDestination
Remove alternative(backup) destination from connections list.- Parameters:
destination
- backup address
-
removeAllDestinations
Remove alternative(backup) destinations from connections list.- Parameters:
destinations
- backup addresses
-
createNewFIXSession
Deprecated.usecreateAcceptorSession()
orcreateInitiatorSession()
insteadCreates initiator fix session.User can use StandardFIXSessionFactory.getFactory(SessionParameters).createInitiatorSession(SessionParameters) instead this method.
- Throws:
IOException
-
createAcceptorSession
Creates acceptor session in disconnected state- Returns:
- FIX session
- Throws:
IOException
-
createInitiatorSession
Creates initiator session- Returns:
- FIX session
- Throws:
IOException
-
printConfiguration
public void printConfiguration() -
isNeedToIncludeLastProcessed
public boolean isNeedToIncludeLastProcessed() -
setCustomLoader
The loader is used for loading configurable classes.- Parameters:
handlersLoader
-
-
getCustomLoader
The loader is used for loading configurable classes. -
isUseJavaNIO
public boolean isUseJavaNIO() -
isUseJavaNIOByDefault
public static boolean isUseJavaNIOByDefault() -
isSimilar
Return true if parameter object describe the same FIX session.- Parameters:
other
-- Returns:
-
isSimilar
Return true if parameter object describe the same FIX session.- Parameters:
other
-- Returns:
-
getTradePeriodBegin
- Specified by:
getTradePeriodBegin
in interfacecom.epam.fixengine.session.TradingSessionParameters
-
setTradePeriodBegin
- Specified by:
setTradePeriodBegin
in interfacecom.epam.fixengine.session.TradingSessionParameters
-
getTradePeriodEnd
- Specified by:
getTradePeriodEnd
in interfacecom.epam.fixengine.session.TradingSessionParameters
-
setTradePeriodEnd
- Specified by:
setTradePeriodEnd
in interfacecom.epam.fixengine.session.TradingSessionParameters
-
getTimeZone
- Specified by:
getTimeZone
in interfacecom.epam.fixengine.session.TradingSessionParameters
-
setTimeZone
- Specified by:
setTimeZone
in interfacecom.epam.fixengine.session.TradingSessionParameters
-
isFIXT
public boolean isFIXT()
-
createAcceptorSession()
orcreateInitiatorSession()
instead