private void updateAlertDetails(Alert alert, AlertDefinitionEntity definition) {
    if (alert.getService() == null) {
      alert.setService(definition.getServiceName());
    }
    if (alert.getComponent() == null) {
      alert.setComponent(definition.getComponentName());
    }
  }
Adds an alert. Checks for a new state before creating a new history record.

@param event
         the event to handle.
ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertReceivedListener.java