com.teraspaces.qwfix
Class FIXHistoricalApplication

java.lang.Object
  extended by com.teraspaces.qwfix.FIXApplication
      extended by com.teraspaces.qwfix.FIXHistoricalApplication

public final class FIXHistoricalApplication
extends FIXApplication

Provides methods and properties to manage a historical QWFIX application, such as methods to initialize a historical FIX engine and method to "replay" the historical FIX message communications. This class cannot be inherited.


Constructor Summary
FIXHistoricalApplication(com.teraspaces.qwfix.repository.FIXRepository repository)
           
FIXHistoricalApplication(com.teraspaces.qwframework.io.SecureUri repositoryUri)
           
FIXHistoricalApplication(String repositoryUriString, String repositoryLoginName, String repositoryLoginPassword)
           
 
Method Summary
 FIXEngine addFIXEngine(String persistenceName, String logDir)
          Adds a FIX engine to the system.
 void close()
           
 void replay(FIXEngine engine)
          Replays the business logics by passing the application messages in MessageLog (see FIXEngine.getMessageLog()) to registered message handlers.
 
Methods inherited from class com.teraspaces.qwfix.FIXApplication
getEngineSettingsLoader, getRepositoryUri, getSchedulerLoader, getSchemaLoader, getSessionSettingsLoader, getVisualLambdaLoader
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FIXHistoricalApplication

public FIXHistoricalApplication(com.teraspaces.qwfix.repository.FIXRepository repository)

FIXHistoricalApplication

public FIXHistoricalApplication(com.teraspaces.qwframework.io.SecureUri repositoryUri)

FIXHistoricalApplication

public FIXHistoricalApplication(String repositoryUriString,
                                String repositoryLoginName,
                                String repositoryLoginPassword)
Method Detail

addFIXEngine

public FIXEngine addFIXEngine(String persistenceName,
                              String logDir)
                       throws IOException
Adds a FIX engine to the system.

The persistenceName should be the file name in the result set of "dir *.StateInfo" in the logDir, trimming off the ".stateinfo" extension.

For example, if "20081130.Engine.Tutorial_OrderMan_Client" is a valid name, the file "20081130.Engine.Tutorial_OrderMan_Client.StateInfo" should exist in the log directory.

The above persistence name indicates that the name of the engine is "Tutorial_OrderMan_Client". The engine was started on day of "20081130" (local time, depending on the time zone of the scheduler). If multiple sessions per day is allowed by the scheduler, the persistence may have name of "20081130.Engine.Tutorial_OrderMan_Client", "20081130.Engine.Tutorial_OrderMan_Client_1", "20081130.Engine.Tutorial_OrderMan_Client_2", etc.

If this method returns successfully, the FIX engine has been successfully initialized. Application should make calls to FIXEngine.setEngineMessageHandler(FIXSession, FIXEngineMessageHandler, String...) or FIXEngine.setEngineMessageDefaultHandler(FIXSession, FIXEngineMessageHandler) to register appropriate message handlers.

replay(FIXEngine) should be called after the message handlers are registered.

If the intraday log file is big, this method takes a while to load the index files.

Parameters:
persistenceName - the FIX engine persistence name
logDir - the log directory
Returns:
the initialized FIX engine
Throws:
IOException - Signals that an I/O exception has occurred.

replay

public void replay(FIXEngine engine)
Replays the business logics by passing the application messages in MessageLog (see FIXEngine.getMessageLog()) to registered message handlers.

Parameters:
engine - the FIX engine returned from addFIXEngine(String, String)

close

public void close()