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);
     }
 }
Пример #3
0
 public static void Notify(AsimovEvent evt)
 {
     var nodeFront = ObjectFactory.GetInstance<INodeFrontPublisher>();
      nodeFront.Notify("/agent/event", evt);
 }
Пример #4
0
 public void Notify(string url, AsimovEvent evt)
 {
     var nodeFront = ObjectFactory.GetInstance<INodeFrontPublisher>();
      nodeFront.Notify(url, evt);
 }
Пример #5
0
 public void Notify(AsimovEvent evt)
 {
     Notify("/agent/event", evt);
 }
 public void Notify(AsimovEvent data)
 {
     WasNotified = true;
 }