com.epam.fixengine.storage
Interface MessageStorage

All Known Implementing Classes:
AbstractFileMessageStorage, FlatFileMessageStorage, IndexedMessageStorage, MMFIndexedMessageStorage, MMFMessageStorage, SlicedFileMessageStorage, SlicedIndexedMessageStorage

public interface MessageStorage

The common message storage interface.


Method Summary
 void appendMessage(byte[] message)
          Appends message to storage.
 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()
          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 Detail

initialize

long initialize()
                throws IOException
Initialize the storage.

Returns:
the next sequence number
Throws:
IOException - - if error occurred.

appendMessage

void appendMessage(byte[] message,
                   int offset,
                   int length)
                   throws IOException
Appends message to storage.

Parameters:
message - the message
offset - the initial offset
length - the length
Throws:
IOException - - if error occurred.

appendMessage

void appendMessage(byte[] message)
                   throws IOException
Appends message to storage.

Parameters:
message - the message
Throws:
IOException - - if error occurred.

retrieveMessage

byte[] retrieveMessage(long seqNumber)
                       throws IOException
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 number
toSeqNun - the to sequence number
listener - the callback listener
blocking - if parameter is true, the execution start in current
thread context, otherwise in the new thread context.
Throws:
IOException - - if error occurred.

close

void close()
           throws IOException
Close the storage.

Throws:
IOException - - if error occurred.

backupStorage

void backupStorage(SessionParameters sessionParameters)
                   throws IOException
Backup the storage.

Parameters:
sessionParameters - the session parameters
Throws:
IOException


Copyright © 2000-2014 EPAM Systems. All Rights Reserved.