Esempio n. 1
0
 private void OnPacket(RapidsConnection sendPort, JObject jsonPacket, PacketProblems warnings)
 {
     foreach (IPacketListener l in _listeners)
     {
         l.ProcessPacket(sendPort, jsonPacket, warnings);
     }
 }
Esempio n. 2
0
 private void OnError(RapidsConnection sendPort, PacketProblems errors)
 {
     foreach (IPacketListener l in _listeners)
     {
         l.ProcessError(sendPort, errors);
     }
 }
Esempio n. 3
0
        public void HandleMessage(RapidsConnection sendPort, string message)
        {
            PacketProblems problems   = new PacketProblems(message);
            JObject        jsonPacket = JsonPacket(message, problems);

            Validate(problems, jsonPacket);
            TriggerService(sendPort, problems, jsonPacket);
        }
Esempio n. 4
0
 private void TriggerService(RapidsConnection sendPort, PacketProblems problems, JObject jsonPacket)
 {
     if (problems.HasErrors())
     {
         OnError(sendPort, problems);
         return;
     }
     IncrementRepublishCount(jsonPacket);
     OnPacket(sendPort, jsonPacket, problems);
 }
Esempio n. 5
0
        public void HandleMessage(RapidsConnection sendPort, string message)
        {
            PacketProblems problems   = new PacketProblems(message);
            JObject        jsonPacket = JsonPacket(message, problems);

            foreach (IValidation v in _validations)
            {
                if (problems.AreSevere())
                {
                    break;
                }
                v.Validate(jsonPacket, problems);
            }
            if (problems.HasErrors())
            {
                OnError(sendPort, problems);
            }
            else
            {
                IncrementReadCount(jsonPacket);
                Packet(sendPort, jsonPacket, problems);
            }
        }
Esempio n. 6
0
 public River(RapidsConnection rapidsConnection)
 {
     rapidsConnection.Register(this);
 }