public class AsyncFileSessionStorage extends AbstractSessionStorage
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears session storage state.
|
void |
close(boolean terminated)
Closes session storage.
|
long |
getInSeqNum()
Returns last inbound message sequence number or 0 if no inbound message is stored.
|
List<IMessage> |
getOutboundMessages(long beginSequenceNumber,
long endSequenceNumber)
Returns outbound messages with the specified sequence number interval.
|
long |
getOutSeqNum()
Returns last outbound sequence number or 0 if no outbound message is stored.
|
long |
getPreviousSeqNo()
Returns last inbound message sequence number of previous session or 0 if no inbound message is stored.
|
long |
getPreviousUuid()
Returns previous Universally Unique Identifier (UUID).
|
long |
getRotateStorageSize()
Returns the size at which the storage file is rotated.
|
TimestampProvider |
getTimestampProvider()
Returns the current timestamp provider.
|
long |
getUuid()
Returns Universally Unique Identifier (UUID).
|
boolean |
isNegotiated()
Returns whether the session is negotiated.
|
boolean |
isTerminated()
Returns the flag whether this storage state should be kept or cleaned.
|
void |
setInSeqNum(long msgSeqNum)
Sets last inbound message sequence number
|
void |
setMaxStorageSize(int maxStorageSize)
Sets the maximum size of the message storage.
|
void |
setNegotiated(boolean value)
Sets whether the session is negotiated.
|
void |
setOutSeqNum(long msgSeqNum)
Sets last outbound message sequence number.
|
void |
setPreviousSeqNo(long seqNo)
Sets last inbound message sequence number of previous session
|
void |
setPreviousUuid(long uuid)
Sets previous Universally Unique Identifier (UUID).
|
void |
setRotateStorageSize(long rotateStorageSize)
Sets the size at which the storage file is rotated.
|
void |
setTerminated(boolean terminated)
Sets the flag whether this storage state should be kept or cleaned
|
void |
setTimestampProvider(TimestampProvider timestampProvider)
Sets the timestamp provider which is used to get timestamp when writing the logs.
|
void |
setUuid(long uuid)
Sets Universally Unique Identifier (UUID).
|
void |
storeInboundMessage(IMessage message,
long msgSeqNum)
Stores inbound message.
|
void |
storeOutboundMessage(IMessage message,
long msgSeqNum,
boolean warmUp)
Stores outbound message.
|
getMaxStorageSize
public long getRotateStorageSize()
public void setRotateStorageSize(long rotateStorageSize)
rotateStorageSize
- storage rotation size, in bytespublic TimestampProvider getTimestampProvider()
public void setTimestampProvider(TimestampProvider timestampProvider)
timestampProvider
- timestamp providerpublic void clear()
SessionStorage
public void close(boolean terminated)
SessionStorage
terminated
set to true means that after closing this session storage can not be restored.
Its state is vanished. The session with the same parameters will be started from scratch.
The terminated
set to false means that after closing this session can be restored at some point in the
future. The session state need to be kept - sequence numbers, etc.terminated
- controls whether this session storage state should be kept or cleanedpublic List<IMessage> getOutboundMessages(long beginSequenceNumber, long endSequenceNumber)
SessionStorage
beginSequenceNumber
- sequence number to begin withendSequenceNumber
- sequence number to end withpublic void storeInboundMessage(IMessage message, long msgSeqNum)
SessionStorage
message
- message to storemsgSeqNum
- message sequence numberpublic void storeOutboundMessage(IMessage message, long msgSeqNum, boolean warmUp)
SessionStorage
message
- message to storemsgSeqNum
- message sequence numberwarmUp
- indicates whether it is a warmUp messagepublic long getInSeqNum()
SessionStorage
public void setInSeqNum(long msgSeqNum)
SessionStorage
msgSeqNum
- inbound message sequence numberpublic long getOutSeqNum()
SessionStorage
public void setOutSeqNum(long msgSeqNum)
SessionStorage
msgSeqNum
- last outbound message sequence numberpublic long getPreviousSeqNo()
SessionStorage
public void setPreviousSeqNo(long seqNo)
SessionStorage
seqNo
- inbound message sequence number of previous sessionpublic long getUuid()
SessionStorage
public void setUuid(long uuid)
SessionStorage
uuid
- Universally Unique Identifier (UUID)public long getPreviousUuid()
SessionStorage
public void setPreviousUuid(long uuid)
SessionStorage
uuid
- previous Universally Unique Identifier (UUID)public boolean isNegotiated()
SessionStorage
true
if the session is negotiated (the Negotiation Response message has been received in reply
to the Negotiation message), otherwise false
.public void setNegotiated(boolean value)
SessionStorage
value
- negotiation status.public boolean isTerminated()
SessionStorage
public void setTerminated(boolean terminated)
SessionStorage
terminated
- flag whether this storage state should be kept or cleanedpublic void setMaxStorageSize(int maxStorageSize)
SessionStorage
setMaxStorageSize
in interface SessionStorage
setMaxStorageSize
in class AbstractSessionStorage
maxStorageSize
- maximum size of the message storageCopyright © 2005–2024 Onix Solutions. All rights reserved.