Class FilesystemStorageFactory

java.lang.Object
com.epam.fixengine.storage.FilesystemStorageFactory
All Implemented Interfaces:
StorageFactory
Direct Known Subclasses:
ChronicleStorageFactory, MMFStorageFactory, SlicedFileStorageFactory

public class FilesystemStorageFactory extends Object implements StorageFactory
Provides ability to store messages in the file.
  • Field Details

    • outgoingLogFileLocator

      protected LogFileLocator outgoingLogFileLocator
      Locator for outgoing storage file
    • incomingLogFileLocator

      protected LogFileLocator incomingLogFileLocator
      Locator for incoming storage file
    • backupOutgoingLogFileLocator

      protected LogFileLocator backupOutgoingLogFileLocator
      Locator for backup files of outgoing storage
    • backupIncomingLogFileLocator

      protected LogFileLocator backupIncomingLogFileLocator
      Locator for backup files of incoming storage
    • propertyFileLocator

      protected LogFileLocator propertyFileLocator
      Locator for session property file
    • stateFileLocator

      protected LogFileLocator stateFileLocator
    • queueFileLocator

      protected LogFileLocator queueFileLocator
      Locator for outgoing queue
    • config

      protected com.epam.fixengine.session.util.ConfigurationAdaptor config
  • Constructor Details

    • FilesystemStorageFactory

      @Deprecated public FilesystemStorageFactory()
      Deprecated.
      Creates the FilesystemStorageFactory storage.
    • FilesystemStorageFactory

      public FilesystemStorageFactory(com.epam.fixengine.configuration.Configuration configuration)
      Creates the FilesystemStorageFactory storage.
      Parameters:
      configuration - incoming configuration
  • Method Details

    • createLocators

      protected void createLocators()
    • checkDirectories

      protected void checkDirectories()
    • getOutgoingLogFileLocator

      public LogFileLocator getOutgoingLogFileLocator()
    • setOutgoingLogFileLocator

      public void setOutgoingLogFileLocator(LogFileLocator outgoingLogFileLocator)
    • getIncomingLogFileLocator

      public LogFileLocator getIncomingLogFileLocator()
    • setIncomingLogFileLocator

      public void setIncomingLogFileLocator(LogFileLocator incomingLogFileLocator)
    • getBackupOutgoingLogFileLocator

      public LogFileLocator getBackupOutgoingLogFileLocator()
    • setBackupOutgoingLogFileLocator

      public void setBackupOutgoingLogFileLocator(LogFileLocator backupOutgoingLogFileLocator)
    • getBackupIncomingLogFileLocator

      public LogFileLocator getBackupIncomingLogFileLocator()
    • setBackupIncomingLogFileLocator

      public void setBackupIncomingLogFileLocator(LogFileLocator backupIncomingLogFileLocator)
    • setPropertyFileLocator

      public void setPropertyFileLocator(LogFileLocator propertyFileLocator)
    • getPropertyFileLocator

      public LogFileLocator getPropertyFileLocator()
    • setQueueFileLocator

      public void setQueueFileLocator(LogFileLocator queueFileLocator)
    • getQueueFileLocator

      public LogFileLocator getQueueFileLocator()
    • getStateFileLocator

      protected LogFileLocator getStateFileLocator()
    • setStateFileLocator

      protected void setStateFileLocator(LogFileLocator stateFileLocator)
    • getQueue

      public Queue<FIXFieldListWithType> getQueue(SessionParameters sessionParameters)
      Gets queue for session. If parameter inMemoryQueue configured, the queue will be InMemoryQueue, otherwise PersistentInMemoryQueue.
      Specified by:
      getQueue in interface StorageFactory
      Parameters:
      sessionParameters - the parameter for session
      Returns:
      the outgoing queue of messages
    • getIncomingMessageStorage

      public MessageStorage getIncomingMessageStorage(SessionParameters sessionParameters)
      Gets incoming message storage. Method returns FlatFileMessageStorage implementation.
      Specified by:
      getIncomingMessageStorage in interface StorageFactory
      Parameters:
      sessionParameters - the session parameters
      Returns:
      the incoming message storage
      See Also:
    • getOutgoingMessageStorage

      public MessageStorage getOutgoingMessageStorage(SessionParameters sessionParameters)
      Gets outgoing message storage. If parameter outgoingStorageIndexed configured, the message storage will be IndexedMessageStorage, otherwise FlatFileMessageStorage
      Specified by:
      getOutgoingMessageStorage in interface StorageFactory
      Parameters:
      sessionParameters - the session parameters
      Returns:
      the outgoing message storage
    • saveSessionParameters

      public void saveSessionParameters(SessionParameters sessionParameters, FIXSessionRuntimeState state) throws IOException
      Stores session parameters to file.
      Specified by:
      saveSessionParameters in interface StorageFactory
      Parameters:
      sessionParameters - the session parameters
      Throws:
      IOException - - if I/O error occurred
    • loadSessionParameters

      public boolean loadSessionParameters(SessionParameters sessionParameters, FIXSessionRuntimeState state)
      Loads session parameters from file.
      Specified by:
      loadSessionParameters in interface StorageFactory
      Parameters:
      sessionParameters - the session parameters

      return true if loaded

      Returns:
      true if parameters loaded