public void SendChildStatusMessageToParentApps(string appId, string status)
        {
            Component component = ComponentLogic.GetByAppId(appId);

            if (component != null)
            {
                var parentComponents = ComponentLogic.GetParentComponents(component);
                if (parentComponents != null && parentComponents.Count > 0)
                {
                    foreach (var parent in parentComponents)
                    {
                        AppStatus AggregatedStatus = AppStatus.Up;
                        if (status == "Down" || parent.HeartBeatStatus == HeartBeatStatus.Down)
                        {
                            AggregatedStatus = AppStatus.Down;
                        }
                        else
                        {
                            //check through health message status and other children component messages to determine final status
                            //what of if the parent app is down, not sending heart beats this check would then not be sufficient
                            var checkStatus = HealthMessageUtility.GetStatusBasedOnHealthChecks(parent.AppID);
                            var appStatus   = HealthMessageUtility.GetStatusBasedOnChildrenApps(parent);
                            AggregatedStatus = HealthMessageUtility.ReturnAggregateStatus(checkStatus, appStatus);
                        }
                        //Update the Status of the Application in the database
                        parent.Status     = AggregatedStatus;
                        parent.LastUpdate = DateTime.Now;
                        ComponentLogic.EditEntity(parent);
                        Clients.All.reportAppStatus(parent.AppID, AggregatedStatus.ToString());
                    }
                }
            }
        }
        public void Handle(SelfHealthMessage message)
        {
            Console.WriteLine();
            Console.WriteLine("New message receieved");
            Console.WriteLine("---------------------------------------------------");
            Console.WriteLine();
            Console.WriteLine("About to save to DataBase.");
            var connectionString        = System.Configuration.ConfigurationManager.AppSettings["ConnectionString"];
            HealthMessageDAO messageDao = new HealthMessageDAO(connectionString);

            try
            {
                if (message.OverallStatus == CheckResultStatus.HealthBeat)
                {
                    Console.WriteLine("It's an health Beat");
                    HealthMessageUtility.SendHealthBeat(message);
                }
                else
                {
                    messageDao.Save(message);
                    HealthMessageUtility.SendHealthMessage(message);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error Message- {0}: Stack Trace- {1} :Inner Exception- {2}", ex.Message, ex.StackTrace, ex.InnerException == null ? "" : ex.InnerException.Message);
                //Bus.Send("DejaVu.SelfHealthCheck.Retries", message);
            }
            Console.WriteLine();
            Console.WriteLine("Done saving.");
        }