public interface SessionIdStrategy
Implementations should define their own composite session key type, which must provide correct value based equals/hashcode implementation. Strategy should be stateless. In all cases sender and target are defined from your own perspective of the connection.
Modifier and Type | Field and Description |
---|---|
static int |
INSUFFICIENT_SPACE |
static char[] |
MISSING_COMP_ID |
Modifier and Type | Method and Description |
---|---|
static char[] |
checkMissing(char[] providedCompId) |
CompositeKey |
load(org.agrona.DirectBuffer buffer,
int offset,
int length)
Loads a composite key from a buffer.
|
CompositeKey |
onAcceptLogon(uk.co.real_logic.artio.decoder.SessionHeaderDecoder header)
Creates the composite session key when you accept a logon.
|
CompositeKey |
onInitiateLogon(java.lang.String localCompId,
java.lang.String localSubId,
java.lang.String localLocationId,
java.lang.String remoteCompId,
java.lang.String remoteSubId,
java.lang.String remoteLocationId)
Creates the composite session key when you initiate a logon.
|
int |
save(CompositeKey compositeKey,
org.agrona.MutableDirectBuffer buffer,
int offset)
Saves the given composite key to a buffer.
|
static SessionIdStrategy |
senderAndTarget() |
static SessionIdStrategy |
senderTargetAndSub() |
void |
setupSession(CompositeKey compositeKey,
uk.co.real_logic.artio.builder.SessionHeaderEncoder headerEncoder)
Sets up an outbound message header with the composite session key.
|
int |
validateCompIds(CompositeKey compositeKey,
uk.co.real_logic.artio.decoder.SessionHeaderDecoder header)
Check that the header of a message matches the expected composite key of the session.
|
static final char[] MISSING_COMP_ID
static final int INSUFFICIENT_SPACE
static char[] checkMissing(char[] providedCompId)
static SessionIdStrategy senderAndTarget()
static SessionIdStrategy senderTargetAndSub()
CompositeKey onAcceptLogon(uk.co.real_logic.artio.decoder.SessionHeaderDecoder header) throws java.lang.IllegalArgumentException
header
- the header of the logon message.java.lang.IllegalArgumentException
- if the header is missing a required field then an IllegalArgumentException
can be thrown.CompositeKey onInitiateLogon(java.lang.String localCompId, java.lang.String localSubId, java.lang.String localLocationId, java.lang.String remoteCompId, java.lang.String remoteSubId, java.lang.String remoteLocationId)
localCompId
- the sender company id, always present.localSubId
- the sender sub id, nullable.localLocationId
- the sender location id, nullable.remoteCompId
- the target company id, always present.remoteSubId
- the target sub id, nullable.remoteLocationId
- the target location id, nullable.void setupSession(CompositeKey compositeKey, uk.co.real_logic.artio.builder.SessionHeaderEncoder headerEncoder)
compositeKey
- the composite session key.headerEncoder
- the outbound message header.int save(CompositeKey compositeKey, org.agrona.MutableDirectBuffer buffer, int offset)
compositeKey
- the key to savebuffer
- the buffer to save it tooffset
- the offset within the buffer to start saving atINSUFFICIENT_SPACE
otherwiseCompositeKey load(org.agrona.DirectBuffer buffer, int offset, int length)
buffer
- the buffer to save it tooffset
- the offset within the buffer to start saving atlength
- the length within the buffer to read fromint validateCompIds(CompositeKey compositeKey, uk.co.real_logic.artio.decoder.SessionHeaderDecoder header)
compositeKey
- the expected key.header
- the header of the message that is to be validated.Copyright © 2015-2022 Real Logic Limited. All Rights Reserved.