quickfix
Class MemoryStore

java.lang.Object
  extended by quickfix.MemoryStore
All Implemented Interfaces:
MessageStore

public class MemoryStore
extends java.lang.Object
implements MessageStore

In-memory message store implementation.

See Also:
MemoryStoreFactory

Constructor Summary
MemoryStore()
           
MemoryStore(SessionID sessionID)
           
 
Method Summary
 void get(int startSequence, int endSequence, java.util.Collection<java.lang.String> messages)
          Get messages within sequence number range (inclusive).
 boolean get(int sequence, java.lang.String message)
          This method is here for JNI API consistency but it's not implemented.
 java.util.Date getCreationTime()
          Get the session creation time.
 int getNextSenderMsgSeqNum()
           
 int getNextTargetMsgSeqNum()
           
 void incrNextSenderMsgSeqNum()
           
 void incrNextTargetMsgSeqNum()
           
 void refresh()
          Refresh session state from a shared state storage (e.g. database, file, ...).
 void reset()
          Reset the message store.
 boolean set(int sequence, java.lang.String message)
          Adds a raw fix messages to the store with the given sequence number.
 void setNextSenderMsgSeqNum(int next)
           
 void setNextTargetMsgSeqNum(int next)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemoryStore

public MemoryStore()
            throws java.io.IOException
Throws:
java.io.IOException

MemoryStore

public MemoryStore(SessionID sessionID)
Method Detail

get

public void get(int startSequence,
                int endSequence,
                java.util.Collection<java.lang.String> messages)
         throws java.io.IOException
Description copied from interface: MessageStore
Get messages within sequence number range (inclusive). Used for message resend requests.

Specified by:
get in interface MessageStore
Parameters:
startSequence - the starting message sequence number.
endSequence - the ending message sequence number.
messages - the retrieved messages (out parameter)
Throws:
java.io.IOException - IO error

get

public boolean get(int sequence,
                   java.lang.String message)
            throws java.io.IOException
This method is here for JNI API consistency but it's not implemented. Use get(int, int, Collection) with the same start and end sequence.

Throws:
java.io.IOException

getCreationTime

public java.util.Date getCreationTime()
                               throws java.io.IOException
Description copied from interface: MessageStore
Get the session creation time.

Specified by:
getCreationTime in interface MessageStore
Returns:
the session creation time.
Throws:
java.io.IOException - IO error

getNextSenderMsgSeqNum

public int getNextSenderMsgSeqNum()
                           throws java.io.IOException
Specified by:
getNextSenderMsgSeqNum in interface MessageStore
Throws:
java.io.IOException

getNextTargetMsgSeqNum

public int getNextTargetMsgSeqNum()
                           throws java.io.IOException
Specified by:
getNextTargetMsgSeqNum in interface MessageStore
Throws:
java.io.IOException

incrNextSenderMsgSeqNum

public void incrNextSenderMsgSeqNum()
                             throws java.io.IOException
Specified by:
incrNextSenderMsgSeqNum in interface MessageStore
Throws:
java.io.IOException

incrNextTargetMsgSeqNum

public void incrNextTargetMsgSeqNum()
                             throws java.io.IOException
Specified by:
incrNextTargetMsgSeqNum in interface MessageStore
Throws:
java.io.IOException

reset

public void reset()
           throws java.io.IOException
Description copied from interface: MessageStore
Reset the message store. Sequence numbers are set back to 1 and stored messages are erased. The session creation time is also set to the time of the reset.

Specified by:
reset in interface MessageStore
Throws:
java.io.IOException - IO error

set

public boolean set(int sequence,
                   java.lang.String message)
            throws java.io.IOException
Description copied from interface: MessageStore
Adds a raw fix messages to the store with the given sequence number. (Most implementations just append the message data to the store so be careful about assuming random access behavior.)

Specified by:
set in interface MessageStore
Parameters:
sequence - the sequence number
message - the raw FIX message string
Returns:
true is successful, false otherwise
Throws:
java.io.IOException - IO error

setNextSenderMsgSeqNum

public void setNextSenderMsgSeqNum(int next)
                            throws java.io.IOException
Specified by:
setNextSenderMsgSeqNum in interface MessageStore
Throws:
java.io.IOException

setNextTargetMsgSeqNum

public void setNextTargetMsgSeqNum(int next)
                            throws java.io.IOException
Specified by:
setNextTargetMsgSeqNum in interface MessageStore
Throws:
java.io.IOException

refresh

public void refresh()
             throws java.io.IOException
Description copied from interface: MessageStore
Refresh session state from a shared state storage (e.g. database, file, ...). Refresh will not work for message stores without shared state (e.g., MemoryStore). These stores should log an session error, at a minimum, or throw an exception.

Specified by:
refresh in interface MessageStore
Throws:
java.io.IOException