public void Notify(AsimovEvent evt)
        {
            try
            {
                if (String.IsNullOrEmpty(_webNotificationUrl) ) return;

                var url = new Uri(_webNotificationUrl);

                var request = WebRequest.Create(url) as HttpWebRequest;
                request.Method = "POST";
                request.ContentType = "application/json";
                request.ServicePoint.Expect100Continue = false;
                request.Timeout = 30000;

                using (var requestStream = request.GetRequestStream())
                {
                    using (var writer = new StreamWriter(requestStream))
                    {
                        var serializer = new JsonSerializer();
                        serializer.NullValueHandling = NullValueHandling.Ignore;
                        serializer.Serialize(writer, evt);
                    }
                }

                using (var resp = request.GetResponse())
                {
                    resp.Close();
                }

            }
            catch (Exception)
            {
                Console.Write("Error sending event from webnotification publisher");
            }
        }
 public static void PublishNotifications(AsimovEvent evt)
 {
     foreach (var publisher in Publishers)
     {
         publisher.Notify(evt);
     }
 }
Exemplo n.º 3
0
 public static void Notify(AsimovEvent evt)
 {
     var nodeFront = ObjectFactory.GetInstance<INodeFrontPublisher>();
      nodeFront.Notify("/agent/event", evt);
 }
Exemplo n.º 4
0
 public void Notify(string url, AsimovEvent evt)
 {
     var nodeFront = ObjectFactory.GetInstance<INodeFrontPublisher>();
      nodeFront.Notify(url, evt);
 }
Exemplo n.º 5
0
 public void Notify(AsimovEvent evt)
 {
     Notify("/agent/event", evt);
 }
 public void Notify(AsimovEvent data)
 {
     WasNotified = true;
 }