|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.epam.fixengine.storage.file.AbstractFileMessageStorage com.epam.fixengine.storage.file.FlatFileMessageStorage com.epam.fixengine.storage.file.IndexedMessageStorage
public class IndexedMessageStorage
Indexed message storage implementation.
FilesystemStorageFactory
Field Summary | |
---|---|
static String |
DEFAULT_EXT
|
Fields inherited from class com.epam.fixengine.storage.file.FlatFileMessageStorage |
---|
buffer, channelLength, channelPosition, dateFormattedBuffer, DELTA, maxBufferSize, maxStorageGrowSize, NEW_LINE, storageGrowSize, timestamp, timestampsInLogs, WRITE_BUFFER_LENGTH_DEF |
Fields inherited from class com.epam.fixengine.storage.file.AbstractFileMessageStorage |
---|
accessFile, calendar, channel, configuration |
Constructor Summary | |
---|---|
IndexedMessageStorage(Configuration config)
|
Method Summary | |
---|---|
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 long |
getNextSequenceNumber()
Gets next sequence number. |
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. |
Methods inherited from class com.epam.fixengine.storage.file.FlatFileMessageStorage |
---|
isEnabledTimestamp, retrieveSequenceNumber |
Methods inherited from class com.epam.fixengine.storage.file.AbstractFileMessageStorage |
---|
appendMessage, appendMessage, appendMessageInternal, backupFile, backupStorage, deleteFile, getFile, getPrefixFormat, initialize, initialized, isClosed, retrieveMessage, setBackupFileLocator, setFile |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DEFAULT_EXT
Constructor Detail |
---|
public IndexedMessageStorage(Configuration config)
Method Detail |
---|
@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 blocking
IOException,
- IllegalArgumentException
IOException
- - if error occurred.FlatFileMessageStorage
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 occurredprotected long getNextSequenceNumber() throws IOException
AbstractFileMessageStorage
getNextSequenceNumber
in class FlatFileMessageStorage
IOException
- - if I/O error occurredAbstractFileMessageStorage.getNextSequenceNumber()
public 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 occurred
IOException
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 file
IOException
protected void deleteStorageFile(String fullPathToStorageFile)
AbstractFileMessageStorage
deleteStorageFile
in class AbstractFileMessageStorage
fullPathToStorageFile
- the path to in/out file
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |