|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.btobits.fixengine.FIXEngineB2B
public class FIXEngineB2B
Implementation of interface FIXEngine.
Field Summary | |
---|---|
static String |
FIXAJ_HOME_NAME
|
static String |
FIXAJ_HOME_VALUE
|
Constructor Summary | |
---|---|
FIXEngineB2B(Application application,
Properties config,
boolean showMonitor)
Creates and starts a FIX Engine instance. |
|
FIXEngineB2B(Application application,
Properties config,
boolean showMonitor,
String homePath)
Creates and starts a FIX Engine instance. |
|
FIXEngineB2B(Application application,
String configFileName,
boolean showMonitor)
Creates and starts a FIX Engine instance. |
|
FIXEngineB2B(Properties config,
boolean showMonitor)
Creates and starts a FIX Engine instance. |
|
FIXEngineB2B(String configFileName,
boolean showMonitor)
Creates and starts a FIX Engine instance. |
Method Summary | |
---|---|
void |
addEventListener(String sessionID,
EventListener eventListener)
Adds event listener for listening specified session. |
void |
addGlobalEventListener(EventListener eventListener)
Adds global event listener for listening all sessions. |
void |
closeEngine()
Closes engine. |
void |
closeEngineSession(String sessionID)
Closes session with specifed ID. |
void |
closeEngineSession(String sessionID,
String reason)
Closes session with specifed ID. |
String |
connectToRemoteFIXEngine(String connectionString)
Establishes connection with remote FIX Engine. |
String |
connectToRemoteFIXEngine(String connectionString,
int heartBtInt,
String senderCompID,
String targetCompID,
int encryptionType)
Establishes connection with remote FIX Engine. |
String |
connectToRemoteFIXEngine(String connectionString,
int heartBtInt,
String senderCompID,
String targetCompID,
int encryptionType,
int startFromSeqNum)
Establishes connection with remote FIX Engine. |
String |
connectToRemoteFIXEngine(String connectionString,
int heartBtInt,
String senderCompID,
String targetCompID,
int encryptionMode,
int outgoingSeqNum,
int incomingSeqNum)
|
String |
connectToRemoteFIXEngine(String connectionString,
StdHdrParamStruct stdHdrParamStruct,
LogonParamStruct logonParamStruct,
int outgoingSeqNum)
Establishes connection with remote FIX Engine. |
String |
connectToRemoteFIXEngine(String connectionString,
StdHdrParamStruct stdHdrParamStruct,
LogonParamStruct logonParamStruct,
int outgoingSeqNum,
int incomingSeqNum)
|
Properties |
getConfig()
Gets FIX Engine's properies |
FIXVersion |
getFIXVersionBySessionID(String sessionID)
Gets the FIX Protocol version ID for specified session. |
int |
getHeartbeatIntervalBySessionID(String sessionID)
Gets the FIX Protocol version ID for specified session. |
int |
getIncomingSequenceBySessionID(String sessionID)
Gets incoming sequence number for session with indicated sessionID. |
FIXMessage |
getMessageFromMessageStore(MessageDirection messageType,
long seqNum,
String sessionID)
Retrieves FIX Message from the Message Storage. |
int |
getOutgoingSequenceBySessionID(String sessionID)
Gets outgoing sequence number for session with indicated sessionID. |
String |
getSenderCompIDbySession(String sessionID)
Gets SenderCompID of session with specifed ID. |
String |
getSessionIDbyCompIDs(String senderCompID,
String targetCompID)
Gets session ID by senderCompID and targetCompID. |
String |
getSessionIDBySenderAndTargetCompID2(String senderCompID,
String targetCompID)
|
String |
getSessionIDByTargetCompID2(String targetCompID)
|
List<ExtendedFIXSession> |
getSessions()
|
int |
getSessionsNumber()
Gets number of active sessions for current FIX Engine. |
String |
getTargetCompIDbySession(String sessionID)
Gets TargetCompID of session with specifed ID. |
boolean |
isSessionActive(String sessionID)
Checks if session is online. |
void |
registerApplication(Application application)
Registers application in FIX Engine instance. |
boolean |
removeEventListener(String sessionID,
EventListener eventListener)
Removes event listener for listening specified session. |
boolean |
removeGlobalEventListener(EventListener eventListener)
Removes global event listener for listening all session. |
void |
resetSequenceNumber(String sessionID)
Resets SeqNumber to 1 for session with indicated sessionID. |
void |
sendMessage(FIXMessage message,
String sessionID)
Put FIX message message to queue for sending to remote FIX Engine. |
void |
sendMessageOutOfTurn(FIXMessage message,
String sessionID)
Send FIXMessage to remote FIX Engine rigth now. |
void |
setIncomingSequence4SessionBySessionID(String sessionID,
int inSeq)
Sets IncomingSequence interval for session with indicated sessionID. |
void |
setOutgoingSequence4SessionBySessionID(String sessionID,
int outSeq)
Sets OutgoingSequence interval for session with indicated sessionID. |
void |
unregisterApplication()
Unregisters application in FIX Engine instance. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String FIXAJ_HOME_NAME
public static final String FIXAJ_HOME_VALUE
Constructor Detail |
---|
public FIXEngineB2B(String configFileName, boolean showMonitor) throws FIXEngineInitException
configFileName
- the name of configuration file.showMonitor
- the flag to show or not sessions browser.
FIXEngineInitException
- if the FIX Engine cannot be created or started.public FIXEngineB2B(Properties config, boolean showMonitor) throws FIXEngineInitException
config
- the configuration properties.showMonitor
- the flag to show or not sessions browser.
FIXEngineInitException
- if the FIX Engine cannot be created or started.public FIXEngineB2B(Application application, String configFileName, boolean showMonitor) throws FIXEngineInitException
application
- the application implementation.configFileName
- the name of configuration file.showMonitor
- the flag to show or not sessions browser.
FIXEngineInitException
- if the FIX Engine cannot be created or started.public FIXEngineB2B(Application application, Properties config, boolean showMonitor) throws FIXEngineInitException
application
- the application implementation.config
- the configuration properties.showMonitor
- the flag to show or not sessions browser.
FIXEngineInitException
- if the FIX Engine cannot be created or started.public FIXEngineB2B(Application application, Properties config, boolean showMonitor, String homePath) throws FIXEngineInitException
application
- the application implementation.config
- the configuration properties.showMonitor
- the flag to show or not sessions browser.homePath
- the absolute path to the FIXAJ installation directory or
the relative path to the same directory from the launching directory.
FIXEngineInitException
Method Detail |
---|
public void closeEngine() throws Exception
closeEngine
in interface FIXEngine
Exception
- if the FIX Engine cannot be properly closed.public void closeEngineSession(String sessionID) throws SessionNotFoundException
closeEngineSession
in interface FIXEngine
sessionID
- closing session ID
SessionNotFoundException
- if the session cannot be found or properly closed.public void closeEngineSession(String sessionID, String reason) throws SessionNotFoundException
closeEngineSession
in interface FIXEngine
reason
- the reason string that will be sent as text field value (tag=58) of logout message.
SessionNotFoundException
- if the session cannot be found or properly closed.public String connectToRemoteFIXEngine(String connectionString) throws EngineNotFoundException
connectToRemoteFIXEngine
in interface FIXEngine
connectionString
- the connestion string.
EngineNotFoundException
- if connection cannot be created or logon respose is not received
in pre-configured timeout interval.public String connectToRemoteFIXEngine(String connectionString, int heartBtInt, String senderCompID, String targetCompID, int encryptionType) throws EngineNotFoundException
connectToRemoteFIXEngine
in interface FIXEngine
heartBtInt
- the value of Heartbeat interval in seconds,
which will be placed in InitialProcess messagesenderCompID
- the SenderCompID, which will be placed in messages headerstargetCompID
- the TargetCompID, which will be placed in messages headersencryptionType
- the type of encryption.
EngineNotFoundException
- if connection cannot be created or logon respose is not received
in pre-configured timeout interval.public String connectToRemoteFIXEngine(String connectionString, int heartBtInt, String senderCompID, String targetCompID, int encryptionType, int startFromSeqNum) throws EngineNotFoundException
connectToRemoteFIXEngine
in interface FIXEngine
heartBtInt
- Value of Heartbeat interval in seconds,
which will be placed in InitialProcess messagesenderCompID
- the SenderCompID, which will be placed in messages headerstargetCompID
- the TargetCompID, which will be placed in messages headersencryptionType
- the type of encryption.startFromSeqNum
- the starting outgoing sequence number.
EngineNotFoundException
- if connection cannot be created or logon respose is not received
in pre-configured timeout interval.public String connectToRemoteFIXEngine(String connectionString, int heartBtInt, String senderCompID, String targetCompID, int encryptionMode, int outgoingSeqNum, int incomingSeqNum) throws EngineNotFoundException
EngineNotFoundException
public String connectToRemoteFIXEngine(String connectionString, StdHdrParamStruct stdHdrParamStruct, LogonParamStruct logonParamStruct, int outgoingSeqNum) throws EngineNotFoundException
connectToRemoteFIXEngine
in interface FIXEngine
stdHdrParamStruct
- structure, which contains Standard Message Header parameterslogonParamStruct
- structure, which contains InitialProcess Message parameters
EngineNotFoundException
- if connection cannot be created or logon respose is not received
in pre-configured timeout interval.public String connectToRemoteFIXEngine(String connectionString, StdHdrParamStruct stdHdrParamStruct, LogonParamStruct logonParamStruct, int outgoingSeqNum, int incomingSeqNum) throws EngineNotFoundException
EngineNotFoundException
public Properties getConfig()
public String getSenderCompIDbySession(String sessionID) throws SessionNotFoundException
getSenderCompIDbySession
in interface FIXEngine
sessionID
- session ID
SessionNotFoundException
- if session cannot be found.public String getSessionIDbyCompIDs(String senderCompID, String targetCompID) throws SessionNotFoundException
getSessionIDbyCompIDs
in interface FIXEngine
senderCompID
- senderCompIDtargetCompID
- targetCompID
SessionNotFoundException
- if session cannot be found.public int getSessionsNumber()
public String getTargetCompIDbySession(String sessionID) throws SessionNotFoundException
getTargetCompIDbySession
in interface FIXEngine
sessionID
- the session ID string
SessionNotFoundException
- if session cannot be found.public void registerApplication(Application application)
registerApplication
in interface FIXEngine
application
- the application, which will process application messages from remote FIX Engine.public void unregisterApplication()
unregisterApplication
in interface FIXEngine
public void sendMessage(FIXMessage message, String sessionID) throws ApplMessageTransmitException
sendMessage
in interface FIXEngine
message
- the message to be send.sessionID
- the ID of session in which message will be sent.
ApplMessageTransmitException
- if the message cannot be sent to the counterparty.public void sendMessageOutOfTurn(FIXMessage message, String sessionID) throws ApplMessageTransmitException
sendMessageOutOfTurn
in interface FIXEngine
message
- the message to be send in FIXMessage formatsessionID
- the ID of session in which message will be sent
ApplMessageTransmitException
- if the message cannot be sent to the counterparty.public FIXVersion getFIXVersionBySessionID(String sessionID) throws Exception
getFIXVersionBySessionID
in interface FIXEngine
sessionID
- the session ID.
Exception
- if the version cannot be retreived.public void resetSequenceNumber(String sessionID) throws Exception
sessionID
- ID of session
Exception
public int getHeartbeatIntervalBySessionID(String sessionID) throws Exception
getHeartbeatIntervalBySessionID
in interface FIXEngine
sessionID
- the session ID.
Exception
- if the heartbeat interval cannot be retreived.public int getIncomingSequenceBySessionID(String sessionID) throws Exception
getIncomingSequenceBySessionID
in interface FIXEngine
sessionID
- the ID of session.
Exception
- if the incoming sequence number cannot be retreived.public int getOutgoingSequenceBySessionID(String sessionID) throws Exception
getOutgoingSequenceBySessionID
in interface FIXEngine
sessionID
- the ID of session.
Exception
- if the outgoing sequence number cannot be retreived.public void setIncomingSequence4SessionBySessionID(String sessionID, int inSeq) throws Exception
sessionID
- ID of session
Exception
public void setOutgoingSequence4SessionBySessionID(String sessionID, int outSeq) throws Exception
sessionID
- ID of session
Exception
public String getSessionIDByTargetCompID2(String targetCompID)
public String getSessionIDBySenderAndTargetCompID2(String senderCompID, String targetCompID)
public FIXMessage getMessageFromMessageStore(MessageDirection messageType, long seqNum, String sessionID) throws Exception
getMessageFromMessageStore
in interface FIXEngine
messageType
- the type of message (1 - incoming, 2 - outgoing)seqNum
- the sequence number of the message.sessionID
- the ID of session, from which the message will be retrieved.
Exception
- if message cannot be retrieved or parsed.public boolean isSessionActive(String sessionID) throws Exception
isSessionActive
in interface FIXEngine
sessionID
- the session ID string.
Exception
- if session cannot be found.public void addGlobalEventListener(EventListener eventListener)
FIXEngine
addGlobalEventListener
in interface FIXEngine
eventListener
- the event listener implementation.public boolean removeGlobalEventListener(EventListener eventListener)
FIXEngine
removeGlobalEventListener
in interface FIXEngine
eventListener
- the event listener implementation.public void addEventListener(String sessionID, EventListener eventListener)
FIXEngine
addEventListener
in interface FIXEngine
sessionID
- the ID of session, which will be listened.eventListener
- the event listener implementation.public boolean removeEventListener(String sessionID, EventListener eventListener)
FIXEngine
removeEventListener
in interface FIXEngine
sessionID
- the ID of session, which will be listened.eventListener
- the event listener implementation.public List<ExtendedFIXSession> getSessions()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |