public class IndexedMessageStorage extends FlatFileMessageStorage
FilesystemStorageFactory
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_EXT |
buffer, channelLength, channelPosition, dateFormattedBuffer, DELTA, maxBufferSize, maxStorageGrowSize, storageGrowSize, timestamp, timestampsInLogs, WRITE_BUFFER_LENGTH_DEF
accessFile, channel, configuration, isForcedFlush, maskedTags, NEW_LINE, storageTimestamp
Constructor and Description |
---|
IndexedMessageStorage(com.epam.fixengine.configuration.Configuration config) |
Modifier and Type | Method and Description |
---|---|
long |
appendMessageInternal(long timestamp,
byte[] message,
int offset,
int length)
Appends message to storage
|
protected long |
appendMessageToFile(long timestamp,
byte[] message,
int offset,
int length) |
protected void |
backupStorageFile(String fullPathToStorageFile,
String fullPathToDestinationBackupFile)
Backups storage file.
|
void |
close()
Close the storage.
|
protected void |
deleteStorageFile(String fullPathToStorageFile)
Deletes storage file.
|
protected int |
getFormatLength() |
protected void |
openStorageFile()
Opens the indexed file.
|
protected byte[] |
readFromStorage(FileChannel readChannel,
long readFrom,
int msgLen) |
void |
retrieveMessages(long from,
long to,
MessageStorageListener listener,
boolean blocking)
Retrieves message from storage.
|
void |
setIndexFileExtension(String indexFileExtension)
Deprecated.
|
protected void |
setPrefixFormat(String prefixFormat)
Deprecated.
|
appendMessage, appendMessage, appendMessageInternal, getNextSequenceNumber, isEnabledTimestamp, retrieveSequenceNumber
appendMessage, appendMessage, appendMessageInternal, backupFile, backupStorage, deleteFile, getFile, getPrefixFormat, initialize, initialized, isClosed, openStorage, retrieveMessage, setBackupFileLocator, setFile, setFileLocator
public static final String DEFAULT_EXT
public IndexedMessageStorage(com.epam.fixengine.configuration.Configuration config)
@Deprecated public void setIndexFileExtension(String indexFileExtension)
@Deprecated protected void setPrefixFormat(String prefixFormat)
protected int getFormatLength()
getFormatLength
in class AbstractFileMessageStorage
public void retrieveMessages(long from, long to, MessageStorageListener listener, boolean blocking) throws IOException
retrieveMessages
in interface MessageStorage
retrieveMessages
in class FlatFileMessageStorage
from
- the start sequence positionto
- the end sequence positionlistener
- the callback listenerblocking
- if sets to true the method call not blockingIOException,
- IllegalArgumentExceptionIOException
- - Message retrieval is not possible for flat filesFlatFileMessageStorage
protected byte[] readFromStorage(FileChannel readChannel, long readFrom, int msgLen) throws IOException
IOException
protected void openStorageFile() throws IOException
openStorageFile
in class FlatFileMessageStorage
IOException
- - if I/O errors occurredpublic void close() throws IOException
close
in interface MessageStorage
close
in class AbstractFileMessageStorage
IOException
- - if I/O error occurredpublic long appendMessageInternal(long timestamp, byte[] message, int offset, int length) throws IOException
FlatFileMessageStorage
appendMessageInternal
in class FlatFileMessageStorage
timestamp
- the timestamp parametermessage
- the array of byteslength
- @throws IOException - if I/O error occurredIOException
AbstractFileMessageStorage.appendMessageInternal(long, byte[], int, int)
protected long appendMessageToFile(long timestamp, byte[] message, int offset, int length) throws IOException
IOException
protected void backupStorageFile(String fullPathToStorageFile, String fullPathToDestinationBackupFile) throws IOException
AbstractFileMessageStorage
backupStorageFile
in class AbstractFileMessageStorage
fullPathToStorageFile
- the path to file of in/out filefullPathToDestinationBackupFile
- the destination place to backup fileIOException
protected void deleteStorageFile(String fullPathToStorageFile)
AbstractFileMessageStorage
deleteStorageFile
in class AbstractFileMessageStorage
fullPathToStorageFile
- the path to in/out fileCopyright © 2000–2022 EPAM Systems. All rights reserved.