@RequiresSession
  public List<AlertGroupEntity> findAllGroups(long clusterId) {
    TypedQuery<AlertGroupEntity> query = entityManagerProvider.get().createNamedQuery(
        "AlertGroupEntity.findAllInCluster", AlertGroupEntity.class);

    query.setParameter("clusterId", clusterId);

    return daoUtils.selectList(query);
  }
Gets all alert groups stored in the database for the specified cluster.

@return all alert groups in the specified cluster or empty list if none
        exist (never {@code null}).
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertDispatchDAO.java