|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.epam.fixengine.storage.file.AbstractFileMessageStorage
public abstract class AbstractFileMessageStorage
Abstract file storage implementation. The base functionality of this class.
| Field Summary | |
|---|---|
protected RandomAccessFile |
accessFile
|
protected Calendar |
calendar
|
protected FileChannel |
channel
|
protected Configuration |
configuration
|
| Constructor Summary | |
|---|---|
protected |
AbstractFileMessageStorage()
Deprecated. |
protected |
AbstractFileMessageStorage(Configuration configuration)
|
| Method Summary | |
|---|---|
void |
appendMessage(byte[] message)
Appends message to storage. |
void |
appendMessage(byte[] message,
int offset,
int length)
Appends message to storage. |
long |
appendMessageInternal(Date date,
byte[] message,
int offset,
int length)
Deprecated. |
abstract long |
appendMessageInternal(long timestamp,
byte[] message,
int offset,
int length)
Appends message to storage |
protected void |
backupFile(String fullPathToStorageFile,
String fullPathToDestinationBackupFile)
|
void |
backupStorage(SessionParameters sessionParameters)
Backup the storage. |
protected void |
backupStorageFile(String fullPathToStorageFile,
String fullPathToDestinationBackupFile)
Backups storage file. |
void |
close()
Close the storage. |
protected void |
deleteFile(String fullPathToStorageFile)
|
protected void |
deleteStorageFile(String fullPathToStorageFile)
Deletes storage file. |
String |
getFile()
Gets the file. |
protected int |
getFormatLength()
|
protected abstract long |
getNextSequenceNumber()
Gets next sequence number. |
protected byte[] |
getPrefixFormat(long timestamp)
|
long |
initialize()
Initialize the storage. |
protected boolean |
initialized()
|
protected boolean |
isClosed()
Returns true if storage is closed. |
protected void |
openStorageFile()
|
byte[] |
retrieveMessage(long num)
Retrieves message from storage. |
abstract void |
retrieveMessages(long from,
long to,
MessageStorageListener listener,
boolean blocking)
Retrieves message from storage. |
void |
setBackupFileLocator(LogFileLocator fileLocator)
|
void |
setFile(String file)
Sets the file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected FileChannel channel
protected RandomAccessFile accessFile
protected Calendar calendar
protected Configuration configuration
| Constructor Detail |
|---|
@Deprecated protected AbstractFileMessageStorage()
protected AbstractFileMessageStorage(Configuration configuration)
| Method Detail |
|---|
protected int getFormatLength()
protected byte[] getPrefixFormat(long timestamp)
public String getFile()
public void setFile(String file)
file - the filepublic void setBackupFileLocator(LogFileLocator fileLocator)
public abstract void retrieveMessages(long from,
long to,
MessageStorageListener listener,
boolean blocking)
throws IOException
MessageStorage
retrieveMessages in interface MessageStoragefrom - the from sequence numberto - the to sequence numberlistener - the callback listenerblocking - if parameter is true, the execution start in currentIOException - - if error occurred.MessageStorage.retrieveMessages(long, long, com.epam.fixengine.storage.MessageStorageListener, boolean)
public byte[] retrieveMessage(long num)
throws IOException
MessageStorage
retrieveMessage in interface MessageStoragenum - the sequence number of message
IOException - - if error occurred.MessageStorage.retrieveMessage(long)
public long initialize()
throws IOException
initialize in interface MessageStorageIOException - - if I/O error occurred
protected void openStorageFile()
throws IOException
IOExceptionprotected boolean initialized()
protected abstract long getNextSequenceNumber()
throws IOException
IOException - - if I/O error occurred
public void appendMessage(byte[] message,
int offset,
int length)
throws IOException
MessageStorage
appendMessage in interface MessageStoragemessage - the messageoffset - the initial offsetlength - the length
IOException - - if error occurred.
public void appendMessage(byte[] message)
throws IOException
MessageStorage
appendMessage in interface MessageStoragemessage - the message
IOException - - if error occurred.MessageStorage.appendMessage(byte[])
@Deprecated
public long appendMessageInternal(Date date,
byte[] message,
int offset,
int length)
throws IOException
date - the date parametermessage - the array of bytesoffset - length - @throws IOException - if I/O error occurred
IOException
public abstract long appendMessageInternal(long timestamp,
byte[] message,
int offset,
int length)
throws IOException
timestamp - the timestamp parametermessage - the array of bytesoffset - length - @throws IOException - if I/O error occurred
IOException
public void backupStorage(SessionParameters sessionParameters)
throws IOException
MessageStorage
backupStorage in interface MessageStoragesessionParameters - the session parameters
IOException
protected void backupStorageFile(String fullPathToStorageFile,
String fullPathToDestinationBackupFile)
throws IOException
fullPathToStorageFile - the path to file of in/out filefullPathToDestinationBackupFile - the destination place to backup file
IOException
protected void backupFile(String fullPathToStorageFile,
String fullPathToDestinationBackupFile)
throws IOException
IOExceptionprotected void deleteStorageFile(String fullPathToStorageFile)
fullPathToStorageFile - the path to in/out fileprotected void deleteFile(String fullPathToStorageFile)
public void close()
throws IOException
close in interface MessageStorageIOException - - if I/O error occurredprotected boolean isClosed()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||