public void processAlerts(String hostname, List<Alert> alerts) {
    if (alerts != null && !alerts.isEmpty()) {
      for (Alert alert : alerts) {
        if (alert.getHostName() == null) {
          alert.setHostName(hostname);
        }
      }
      AlertEvent event = new AlertReceivedEvent(alerts);
      alertEventPublisher.publish(event);

    }
  }
Extracts all of the {@link Alert}s from the heartbeat and fires
{@link AlertEvent}s for each one. If there is a problem looking up the
cluster, then alerts will not be processed.

@param heartbeat the heartbeat to process.
ambari-server/src/main/java/org/apache/ambari/server/agent/HeartbeatProcessor.java