@RequiresSession
  public List<AlertCurrentEntity> findCurrentByService(long clusterId,
      String serviceName) {
    TypedQuery<AlertCurrentEntity> query = m_entityManagerProvider.get().createNamedQuery(
      "AlertCurrentEntity.findByService", AlertCurrentEntity.class);

    query.setParameter("clusterId", clusterId);
    query.setParameter("serviceName", serviceName);
    query.setParameter("inlist", EnumSet.of(Scope.ANY, Scope.SERVICE));

    List<AlertCurrentEntity> alerts = m_daoUtils.selectList(query);

    // if caching is enabled, replace results with cached values when present
    if (m_configuration.isAlertCacheEnabled()) {
      alerts = supplementWithCachedAlerts(alerts);
    }

    return alerts;
  }
Gets the current alerts for a given service.

@return the current alerts for the given service or an empty list if none
        exist (never {@code null}).
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertsDAO.java