protected Alert buildAlert(Cluster cluster, AlertDefinitionEntity myDefinition,
      AlertState alertState, String message) {
    Alert alert = new Alert(myDefinition.getDefinitionName(), null, myDefinition.getServiceName(),
        myDefinition.getComponentName(), null, alertState);

    alert.setLabel(myDefinition.getLabel());
    alert.setText(message);
    alert.setTimestamp(System.currentTimeMillis());
    alert.setClusterId(cluster.getClusterId());

    return alert;
  }
Builds an {@link Alert} instance.

@param cluster
         the cluster the alert is for (not {@code null}).
@param myDefinition
         the alert's definition (not {@code null}).
@param alertState
         the state of the alert (not {@code null}).
@param message
         the alert text.
@return and alert.
ambari-server/src/main/java/org/apache/ambari/server/alerts/AlertRunnable.java