in FixAntenna/NetCore/FixEngine/SessionParameters.cs [493:627]
public void FromProperties(IDictionary<string, string> properties)
{
if (properties.ContainsKey(Properties.SessionIdKey))
{
SetSessionId(properties.GetValueOrDefault(Properties.SessionIdKey));
}
SenderCompId = properties.GetValueOrDefault("senderCompID");
TargetCompId = properties.GetValueOrDefault("targetCompID");
if (properties.ContainsKey("sessionQualifier"))
{
SessionQualifier = properties.GetValueOrDefault("sessionQualifier");
}
if (properties.ContainsKey("senderSubID"))
{
SenderSubId = properties.GetValueOrDefault("senderSubID");
}
if (properties.ContainsKey("senderLocationID"))
{
SenderLocationId = properties.GetValueOrDefault("senderLocationID");
}
if (properties.ContainsKey("targetSubID"))
{
TargetSubId = properties.GetValueOrDefault("targetSubID");
}
if (properties.ContainsKey("targetLocationID"))
{
TargetLocationId = properties.GetValueOrDefault("targetLocationID");
}
if (properties.ContainsKey("host"))
{
Host = properties.GetValueOrDefault("host");
}
if (properties.ContainsKey("port"))
{
Port = Convert.ToInt32(properties.GetValueOrDefault("port", "3000"));
}
if (properties.ContainsKey("bindIP"))
{
BindIP = properties.GetValueOrDefault("bindIP");
}
SetDestinationsIfPresent(properties);
if (properties.ContainsKey("appVersion"))
{
AppVersionFromString(properties.GetValueOrDefault("appVersion"));
}
if (properties.ContainsKey("fixVersion"))
{
FixVersionFromString(properties.GetValueOrDefault("fixVersion"));
}
if (properties.ContainsKey("heartbeatInterval"))
{
HeartbeatInterval = Convert.ToInt32(properties.GetValueOrDefault("heartbeatInterval"));
}
if (properties.ContainsKey("lastSeqNumResetTimestamp"))
{
try
{
LastSeqNumResetTimestamp = Convert.ToInt64(properties.GetValueOrDefault("lastSeqNumResetTimestamp"));
}
catch (FormatException)
{
throw new ArgumentException(
"Error while trying to parse the last sequence reset date and time stored in the persistent storage. " +
"The last sequence reset date and time are treated as empty. " +
"Session's sequence numbers will be synchronized");
}
}
if (properties.ContainsKey("FixMessage"))
{
UserDefinedFields = RawFixUtil.GetFixMessage(properties.GetValueOrDefault("FixMessage").AsByteArray());
}
if (properties.ContainsKey("incomingLoginFixMessage"))
{
IncomingLoginMessage = RawFixUtil.GetFixMessage(properties.GetValueOrDefault("incomingLoginFixMessage", string.Empty).AsByteArray());
}
if (properties.ContainsKey("outgoingLoginFixMessage"))
{
OutgoingLoginMessage = RawFixUtil.GetFixMessage(properties.GetValueOrDefault("outgoingLoginFixMessage", string.Empty).AsByteArray());
}
if (properties.ContainsKey("username"))
{
UserName = properties.GetValueOrDefault("username");
}
if (properties.ContainsKey("password"))
{
Password = properties.GetValueOrDefault("password");
}
if (properties.ContainsKey("inSeqNumsForNextConnect"))
{
IncomingSequenceNumber = Convert.ToInt64(properties.GetValueOrDefault("inSeqNumsForNextConnect", "-1"));
}
else if (properties.ContainsKey("incomingSequenceNumber"))
{
IncomingSequenceNumber = Convert.ToInt64(properties.GetValueOrDefault("incomingSequenceNumber"));
}
else
{
IncomingSequenceNumber = DefaultSequenceNum;
ParamSources.Instance.Set("incomingSequenceNumber", ParamSource.Default, SessionId.ToString());
}
if (properties.ContainsKey("outSeqNumsForNextConnect"))
{
OutgoingSequenceNumber = Convert.ToInt64(properties.GetValueOrDefault("outSeqNumsForNextConnect", "-1"));
}
else if (properties.ContainsKey("outgoingSequenceNumber"))
{
OutgoingSequenceNumber = Convert.ToInt64(properties.GetValueOrDefault("outgoingSequenceNumber"));
}
else
{
OutgoingSequenceNumber = DefaultSequenceNum;
ParamSources.Instance.Set("outgoingSequenceNumber", ParamSource.Default, SessionId.ToString());
}
}