Example #1
0
 internal Mirror(JSONNode mirrorBaseNode)
 {
     Name          = mirrorBaseNode[ApiConstants.Name].Value;
     StartSeq      = mirrorBaseNode[ApiConstants.OptStartSeq].AsUlong;
     StartTime     = JsonUtils.AsDate(mirrorBaseNode[ApiConstants.OptStartTime]);
     FilterSubject = mirrorBaseNode[ApiConstants.FilterSubject].Value;
     External      = External.OptionalInstance(mirrorBaseNode[ApiConstants.External]);
 }
Example #2
0
 internal Source(JSONNode sourceBaseNode)
 {
     Name          = sourceBaseNode[ApiConstants.Name].Value;
     StartSeq      = sourceBaseNode[ApiConstants.OptStartSeq].AsUlong;
     StartTime     = JsonUtils.AsDate(sourceBaseNode[ApiConstants.OptStartTime]);
     FilterSubject = sourceBaseNode[ApiConstants.FilterSubject].Value;
     External      = External.OptionalInstance(sourceBaseNode[ApiConstants.External]);
 }
Example #3
0
        private void Init()
        {
            JSONNode miNode = JsonNode[ApiConstants.Message];

            Subject  = miNode[ApiConstants.Subject].Value;
            Sequence = miNode[ApiConstants.Seq].AsUlong;
            Time     = JsonUtils.AsDate(miNode[ApiConstants.Time]);
            Data     = JsonUtils.AsByteArrayFromBase64(miNode[ApiConstants.Data]);
            byte[] bytes = JsonUtils.AsByteArrayFromBase64(miNode[ApiConstants.Hdrs]);
            if (bytes != null)
            {
                Headers = new HeaderStatusReader(bytes, bytes.Length).Header;
            }
        }
Example #4
0
        private StreamState(JSONNode streamState)
        {
            Messages      = streamState[ApiConstants.Messages].AsUlong;
            Bytes         = streamState[ApiConstants.Bytes].AsUlong;
            FirstSeq      = streamState[ApiConstants.FirstSeq].AsUlong;
            LastSeq       = streamState[ApiConstants.LastSeq].AsUlong;
            ConsumerCount = streamState[ApiConstants.ConsumerCount].AsLong;
            SubjectCount  = streamState[ApiConstants.NumSubjects].AsLong;
            DeletedCount  = streamState[ApiConstants.NumDeleted].AsLong;
            FirstTime     = JsonUtils.AsDate(streamState[ApiConstants.FirstTs]);
            LastTime      = JsonUtils.AsDate(streamState[ApiConstants.LastTs]);
            Subjects      = Subject.OptionalListOf(streamState[ApiConstants.Subjects]);

            Deleted = new List <ulong>();
            JSONNode.Enumerator e =
                streamState[ApiConstants.Deleted].AsArray.GetEnumerator();
            while (e.MoveNext())
            {
                Deleted.Add(e.Current.Value.AsUlong);
            }
        }