private void enqueueAgentCommands(Cluster cluster, String clusterName, Collection<String> hosts) {
    if (null == clusterName) {
      LOG.warn("Unable to create alert definition agent commands because of a null cluster name");
      return;
    }

    if (null == hosts || hosts.size() == 0) {
      return;
    }

    try {
      m_actionQueueLock.lock();
      for (String hostName : hosts) {
        List<AlertDefinition> definitions = getAlertDefinitions(clusterName,
            hostName);

        String hash = getHash(clusterName, hostName);

        Host host = cluster.getHost(hostName);
        String publicHostName = host == null? hostName : host.getPublicHostName();
        AlertDefinitionCommand command = new AlertDefinitionCommand(
            clusterName, hostName, publicHostName, hash, definitions);

        try {
          command.addConfigs(m_configHelper.get(), cluster);
        } catch (AmbariException ae) {
          LOG.warn("Unable to add configurations to alert definition command",
              ae);
        }

        // TODO implement alert execution commands logic
        //m_actionQueue.enqueue(hostName, command);
      }
    } finally {
      m_actionQueueLock.unlock();
    }
  }
Enqueue {@link AlertDefinitionCommand}s for every host specified so that
they will receive a payload of alert definitions that they should be
running.
<p/>
This method is typically called after
{@link #invalidateHosts(AlertDefinitionEntity)} has caused a cache
invalidation of the alert definition hash.

@param clusterName
         the name of the cluster (not {@code null}).
@param hosts
         the hosts to push {@link AlertDefinitionCommand}s for.
ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertDefinitionHash.java