/// <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); } }
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; }
public int enqueueEvent(RealTimeEvent realTimeEvent) { realTimeEventQueue.Enqueue(realTimeEvent); return realTimeEventQueue.Count; }
/// <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; }
/// <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); }
public virtual void onRealTimeEvent(RealTimeEvent realTimeEvent) { }