Package com.epam.fixengine.storage
Interface MessageStorage
- All Known Implementing Classes:
AbstractFileMessageStorage
,ChronicleQueueStorage
,FlatFileMessageStorage
,IndexedMessageStorage
,MMFIndexedMessageStorage
,MMFMessageStorage
,SlicedFileMessageStorage
,SlicedIndexedMessageStorage
public interface MessageStorage
The common message storage interface.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
appendMessage
(byte[] message) Appends message to storage.default void
appendMessage
(byte[] timestampFormatted, byte[] message) Appends message to storage with the given formatted timestampFormatted.default void
appendMessage
(byte[] timestampFormatted, byte[] message, int offset, int length) Appends message to storage with the given formatted timestamp.void
appendMessage
(byte[] message, int offset, int length) Appends message to storage.void
backupStorage
(SessionParameters sessionParameters) Backup the storage.void
close()
Close the storage.long
Initialize the storage.byte[]
retrieveMessage
(long seqNumber) Retrieves message from storage.void
retrieveMessages
(long fromSeqNum, long toSeqNun, MessageStorageListener listener, boolean blocking) Retrieves message from storage.
-
Method Details
-
initialize
Initialize the storage.- Returns:
- the next sequence number
- Throws:
IOException
- - if error occurred.
-
appendMessage
Appends message to storage.- Parameters:
message
- the messageoffset
- the initial offsetlength
- the length- Throws:
IOException
- - if error occurred.
-
appendMessage
Appends message to storage.- Parameters:
message
- the message- Throws:
IOException
- - if error occurred.
-
appendMessage
default void appendMessage(byte[] timestampFormatted, byte[] message, int offset, int length) throws IOException Appends message to storage with the given formatted timestamp.- Parameters:
timestampFormatted
- the message timestampmessage
- the messageoffset
- the initial offsetlength
- the length- Throws:
IOException
- - if error occurred.
-
appendMessage
Appends message to storage with the given formatted timestampFormatted.- Parameters:
timestampFormatted
- the message timestampFormattedmessage
- the message- Throws:
IOException
- - if error occurred.
-
retrieveMessage
Retrieves message from storage.- Parameters:
seqNumber
- the sequence number of message- Returns:
- the retrieved message
- Throws:
IOException
- - if error occurred.
-
retrieveMessages
void retrieveMessages(long fromSeqNum, long toSeqNun, MessageStorageListener listener, boolean blocking) throws IOException Retrieves message from storage.- Parameters:
fromSeqNum
- the from sequence numbertoSeqNun
- the to sequence numberlistener
- the callback listenerblocking
- if parameter is true, the execution start in current thread context, otherwise in the new thread context.- Throws:
IOException
- - if error occurred.
-
close
Close the storage.- Throws:
IOException
- - if error occurred.
-
backupStorage
Backup the storage.- Parameters:
sessionParameters
- the session parameters- Throws:
IOException
-