public List<AlertHistoryEntity> getAlerts(String serviceName,
        String alertState) {

      Map<AlertState, List<AlertHistoryEntity>> serviceAlerts = m_alertsByServiceAndState.get(serviceName);
      if (null == serviceAlerts) {
        return null;
      }

      AlertState state = AlertState.valueOf(alertState);
      return serviceAlerts.get(state);
    }
Gets all of the alerts for a given service and alert state level.

@param serviceName
         the name of the service.
@param alertState
         the alert state level.
@return the list of alerts or {@code null} for none.
ambari-server/src/main/java/org/apache/ambari/server/state/services/AlertNoticeDispatchService.java