public class FlatFileMessageStorage extends AbstractFileMessageStorage
Modifier and Type | Field and Description |
---|---|
protected ByteBuffer |
buffer |
protected long |
channelLength |
protected long |
channelPosition |
protected byte[] |
dateFormattedBuffer |
protected static long |
DELTA |
protected int |
maxBufferSize |
protected int |
maxStorageGrowSize |
protected boolean |
storageGrowSize |
protected long |
timestamp |
protected boolean |
timestampsInLogs |
protected static int |
WRITE_BUFFER_LENGTH_DEF |
accessFile, channel, configuration, isForcedFlush, maskedTags, NEW_LINE, storageTimestamp
Constructor and Description |
---|
FlatFileMessageStorage()
Deprecated.
|
FlatFileMessageStorage(com.epam.fixengine.configuration.Configuration config) |
Modifier and Type | Method and Description |
---|---|
void |
appendMessage(byte[] timestampFormatted,
byte[] message)
Appends message to storage with the given formatted timestampFormatted.
|
void |
appendMessage(byte[] timestampFormatted,
byte[] message,
int offset,
int length)
Appends message to storage with the given formatted timestamp.
|
long |
appendMessageInternal(byte[] timestampFormatted,
byte[] message,
int offset,
int length) |
long |
appendMessageInternal(long timestamp,
byte[] message,
int offset,
int length)
Appends message to storage
|
protected long |
getNextSequenceNumber()
Gets next sequence number.
|
boolean |
isEnabledTimestamp() |
protected void |
openStorageFile() |
void |
retrieveMessages(long from,
long to,
MessageStorageListener listener,
boolean blocking)
The method
retrieveMessages is not supported in this instance. |
static long |
retrieveSequenceNumber(String fileName)
Retrieves the last sequence number.
|
appendMessage, appendMessage, appendMessageInternal, backupFile, backupStorage, backupStorageFile, close, deleteFile, deleteStorageFile, getFile, getFormatLength, getPrefixFormat, initialize, initialized, isClosed, openStorage, retrieveMessage, setBackupFileLocator, setFile, setFileLocator
protected static final long DELTA
protected static final int WRITE_BUFFER_LENGTH_DEF
protected byte[] dateFormattedBuffer
protected ByteBuffer buffer
protected int maxBufferSize
protected long timestamp
protected boolean timestampsInLogs
protected int maxStorageGrowSize
protected boolean storageGrowSize
protected long channelPosition
protected long channelLength
@Deprecated public FlatFileMessageStorage()
FlatFileMessageStorage
.public FlatFileMessageStorage(com.epam.fixengine.configuration.Configuration config)
protected void openStorageFile() throws IOException
openStorageFile
in class AbstractFileMessageStorage
IOException
public void retrieveMessages(long from, long to, MessageStorageListener listener, boolean blocking) throws IOException
retrieveMessages
is not supported in this instance.retrieveMessages
in interface MessageStorage
retrieveMessages
in class AbstractFileMessageStorage
from
- the from sequence numberto
- the to sequence numberlistener
- the callback listenerblocking
- if parameter is true, the execution start in current
thread context, otherwise in the new thread context.IOException
- - Message retrieval is not possible for flat filesAbstractFileMessageStorage.retrieveMessages(long, long, com.epam.fixengine.storage.MessageStorageListener, boolean)
protected long getNextSequenceNumber() throws IOException
AbstractFileMessageStorage
getNextSequenceNumber
in class AbstractFileMessageStorage
IOException
- - if I/O error occurredpublic void appendMessage(byte[] timestampFormatted, byte[] message, int offset, int length) throws IOException
MessageStorage
timestampFormatted
- the message timestampmessage
- the messageoffset
- the initial offsetlength
- the lengthIOException
- - if error occurred.public void appendMessage(byte[] timestampFormatted, byte[] message) throws IOException
MessageStorage
timestampFormatted
- the message timestampFormattedmessage
- the messageIOException
- - if error occurred.public long appendMessageInternal(byte[] timestampFormatted, byte[] message, int offset, int length) throws IOException
IOException
public long appendMessageInternal(long timestamp, byte[] message, int offset, int length) throws IOException
appendMessageInternal
in class AbstractFileMessageStorage
timestamp
- the timestamp parametermessage
- the array of bytesoffset
- length
- @throws IOException - if I/O error occurredIOException
public boolean isEnabledTimestamp()
public static long retrieveSequenceNumber(String fileName) throws IOException
fileName
- the file nameIOException
- - if I/O error occurredCopyright © 2000–2022 EPAM Systems. All rights reserved.