/// <summary>
 /// Generates the heartbeat of the instance ready to be sent to the message bus.
 /// </summary>
 /// <returns>The heartbeat.</returns>
 public HeartbeatMessage GenerateHeartbeat()
 {
     HeartbeatMessage response = new HeartbeatMessage();
     response.Droplets.Add(this.GenerateInstanceHeartbeat().ToJsonIntermediateObject());
     return response;
 }
        /// <summary>
        /// Generates the heartbeat message.
        /// </summary>
        /// <returns>Return the heartbeat message</returns>
        public HeartbeatMessage GenerateHeartbeatMessage()
        {
            HeartbeatMessage response = new HeartbeatMessage();

            ForEach(delegate(DropletInstance instance)
            {
                if (instance.Properties.State != DropletInstanceState.Stopped)
                {
                    response.Droplets.Add(instance.GenerateInstanceHeartbeat().ToJsonIntermediateObject());
                }
            });

            return response;
        }