@RequiresSession
  public List<AlertNoticeEntity> findPendingNotices() {
    TypedQuery<AlertNoticeEntity> query = entityManagerProvider.get().createNamedQuery(
        "AlertNoticeEntity.findByState", AlertNoticeEntity.class);

    query.setParameter("notifyState", NotificationState.PENDING);
    return daoUtils.selectList(query);
  }
Gets all {@link AlertNoticeEntity} instances that are
{@link NotificationState#PENDING} and not yet dispatched.

@return the notices that are waiting to be dispatched, or an empty list
        (never {@code null}).
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertDispatchDAO.java