Esempio n. 1
0
 /// <summary>
 /// The hook for the event dispatcher.
 /// </summary>
 /// <param name="rte"></param>
 public override void onRealTimeEvent(RealTimeEvent rte)
 {
     if(rte.GetType() == typeof(UnparsedMessage))
     {
         UnparsedMessage unparsedMessage = (UnparsedMessage)rte;
         Decode(unparsedMessage);
     }
 }
Esempio n. 2
0
 public RealTimeEvent(string message, RealTimeEvent originatingEvent)
 {
     this.message = message;
     if (originatingEvent != null)
     {
         _thisDict = originatingEvent._thisDict;
     }
     else
     {
         _thisDict = new Dictionary<string, dynamic>();
     }
 }
 public Decoded(Dictionary<String,String> decoded, RealTimeEvent originatingEvent, String undecoded, String messageType)
     : base("Decoded message type: " + messageType + " from raw message: " + undecoded, originatingEvent)
 {
     this["decodedmessage"] = decoded;
     this["messagetype"] = messageType;
 }
Esempio n. 4
0
 public int enqueueEvent(RealTimeEvent realTimeEvent)
 {
     realTimeEventQueue.Enqueue(realTimeEvent);
     return realTimeEventQueue.Count;
 }
Esempio n. 5
0
 /// <summary>
 /// The hook for the event dispatcher. Determines the type of message, and if applicable, makes a database insertion.
 /// </summary>
 /// <param name="realTimeEvent"></param>
 public override void onRealTimeEvent(RealTimeEvent realTimeEvent)
 {
     int response = 0;
     if (realTimeEvent.GetType() == typeof(Decoded))
     {
         Decoded rte = (Decoded)realTimeEvent;
         string eventType = rte["messagetype"];
         if (eventType == "detection_event")
             response = detectionInsert(rte);
         else if (eventType == "status_response")
             response = statusInsert(rte);
         if (response > 1)
             response = 1;
     }
     //return response;
 }
 public DatabaseResponse(string sql, int response, RealTimeEvent originatingEvent)
     : base("SQL statement: " + sql, originatingEvent)
 {
     this.sql = sql;
     this.response = response;
 }
Esempio n. 7
0
 /// <summary>
 /// The event dispatcher's hook.
 /// </summary>
 /// <param name="rte">The real time event to be acted upon by this module.</param>
 public override void onRealTimeEvent(RealTimeEvent rte)
 {
     System.Console.WriteLine(rte);
 }
Esempio n. 8
0
 public virtual void onRealTimeEvent(RealTimeEvent realTimeEvent)
 {
 }