@RequiresSession
  public List<AlertDefinitionEntity> findAgentScoped(long clusterId) {
    TypedQuery<AlertDefinitionEntity> query = entityManagerProvider.get().createNamedQuery(
        "AlertDefinitionEntity.findByServiceAndComponent",
        AlertDefinitionEntity.class);

    query.setParameter("clusterId", clusterId);

    query.setParameter("serviceName",
        RootService.AMBARI.name());

    query.setParameter("componentName",
        RootComponent.AMBARI_AGENT.name());

    return daoUtils.selectList(query);
  }
Gets all alert definitions that are not bound to a particular service. An
example of this type of definition is a host capacity alert.

@param clusterId
         the ID of the cluster.
@return all alert definitions that are not bound to a service or an empty
        list (never {@code null}).
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertDefinitionDAO.java