public class FileBasedSessionStorage extends AbstractSessionStorage
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears session storage state.
|
void |
close(boolean terminated)
Closes session storage.
|
void |
flush(boolean flushMetadata)
Flushes pending session data to persistent storage.
|
FileFlushPolicy |
getFileFlushPolicyPerMessage()
Returns the file flush policy applied after processing each message.
|
String |
getId()
Returns session storage unique id.
|
long |
getInSeqNum()
Returns last inbound message sequence number or 0 if no inbound message is stored.
|
List<FixMessage> |
getOutboundMessages(long beginSequenceNumber,
long endSequenceNumber)
Returns outbound messages with the specified sequence number interval.
|
long |
getOutSeqNum()
Returns last outbound sequence number or 0 if no outbound message is stored.
|
long |
getRotateStorageSize()
Returns the size at which the storage file is rotated.
|
SessionId |
getSessionId() |
String |
getStorageFolder()
Returns the storage folder.
|
TimestampProvider |
getTimestampProvider()
Returns the current timestamp provider.
|
boolean |
isArchiveStorage()
Returns whether to archive terminated storage.
|
void |
setArchiveStorage(boolean archiveStorage)
Sets whether to archive terminated storage.
|
void |
setFileFlushPolicyPerMessage(FileFlushPolicy fileFlushPolicyPerMessage)
Sets the file flush policy applied after processing each message.
|
void |
setInSeqNum(long msgSeqNum)
Sets last inbound message sequence number
|
void |
setMaxStorageSize(int maxStorageSize)
Sets the maximum size of the message storage.
|
void |
setOutSeqNum(long msgSeqNum)
Sets last outbound message sequence number.
|
void |
setRotateStorageSize(long rotateStorageSize)
Sets the size at which the storage file is rotated.
|
void |
setStorageFolder(String storageFolder)
Sets the storage folder.
|
void |
setTimestampProvider(TimestampProvider timestampProvider)
Sets the timestamp provider which is used to get timestamp when writing the logs.
|
void |
storeInboundMessage(ByteBuffer rawMessage,
long msgSeqNum,
boolean isOriginal)
Stores inbound message.
|
void |
storeOutboundMessage(ByteBuffer rawMessage,
long msgSeqNum,
boolean isOriginal,
boolean warmUp)
Stores outbound message.
|
String |
toString() |
getMaxStorageSizepublic SessionId getSessionId()
public boolean isArchiveStorage()
public void setArchiveStorage(boolean archiveStorage)
archiveStorage - archive terminated storagepublic long getRotateStorageSize()
public void setRotateStorageSize(long rotateStorageSize)
rotateStorageSize - storage rotation size, in bytespublic String getStorageFolder()
public void setStorageFolder(String storageFolder)
storageFolder - storage folderpublic TimestampProvider getTimestampProvider()
public void setTimestampProvider(TimestampProvider timestampProvider)
timestampProvider - timestamp providerpublic FileFlushPolicy getFileFlushPolicyPerMessage()
FileFlushPolicy, or FileFlushPolicy.NONE if unavailablepublic void setFileFlushPolicyPerMessage(FileFlushPolicy fileFlushPolicyPerMessage)
fileFlushPolicyPerMessage - per-message FileFlushPolicypublic void clear()
SessionStoragepublic void close(boolean terminated)
SessionStorageterminated set to true means that after closing this session storage can not be restored.
Its state is vanished. The session with the same parameters will be started from scratch.
terminated set to false means that after closing this session can be restored at some point in the
future. The session state need to be kept - sequence numbers, etc.terminated - controls whether this session storage state should be kept or cleanedpublic List<FixMessage> getOutboundMessages(long beginSequenceNumber, long endSequenceNumber)
SessionStoragebeginSequenceNumber - sequence number to begin with, 0 means the minimum availableendSequenceNumber - sequence number to end with, 0 means the maximum availablepublic void storeInboundMessage(ByteBuffer rawMessage, long msgSeqNum, boolean isOriginal)
SessionStoragerawMessage - message to storemsgSeqNum - message sequence numberisOriginal - whether message is original or notpublic void storeOutboundMessage(ByteBuffer rawMessage, long msgSeqNum, boolean isOriginal, boolean warmUp)
SessionStoragerawMessage - message to storemsgSeqNum - message sequence numberisOriginal - whether message is original or notwarmUp - indicates whether it is a warmUp messagepublic String getId()
SessionStoragepublic long getInSeqNum()
SessionStoragepublic void setInSeqNum(long msgSeqNum)
SessionStoragemsgSeqNum - inbound message sequence numberpublic long getOutSeqNum()
SessionStoragepublic void setOutSeqNum(long msgSeqNum)
SessionStoragemsgSeqNum - last outbound message sequence numberpublic void setMaxStorageSize(int maxStorageSize)
SessionStoragesetMaxStorageSize in interface SessionStoragesetMaxStorageSize in class AbstractSessionStoragemaxStorageSize - maximum size of the message storagepublic void flush(boolean flushMetadata)
throws IOException
SessionStorageflushMetadata - if true, flushes data and metadata; if false, flushes data onlyIOException - if the flush operation failsCopyright © 2005–2025 Onix Solutions. All rights reserved.