public List<Map<String, String>> process(String targetHost,
                                             @Nullable Map<String, DesiredConfig> desiredConfigs) throws AmbariException {
      KerberosServerAction.KerberosCommandParameters kerberosCommandParameters = new KerberosServerAction.KerberosCommandParameters(executionCommand);
      Map<String, ? extends Collection<String>> serviceComponentFilter = getServiceComponentFilter(kerberosCommandParameters.getServiceComponentFilter());
      final Collection<KerberosIdentityDescriptor> serviceIdentities = serviceComponentFilter == null
        ? null
        : kerberosKeytabController.getServiceIdentities(executionCommand.getClusterName(), serviceComponentFilter.keySet(), desiredConfigs);
      final Set<ResolvedKerberosKeytab> keytabsToInject = kerberosKeytabController.getFilteredKeytabs(serviceIdentities, kerberosCommandParameters.getHostFilter(), kerberosCommandParameters.getIdentityFilter());

      keytabsToInject.forEach(resolvedKeytab -> resolvedKeytab.getPrincipals().forEach(
        resolvedPrincipal -> {
          String hostName = resolvedPrincipal.getHostName();
          if (targetHost.equalsIgnoreCase(hostName)) {
            try {
              process(targetHost, resolvedKeytab, resolvedPrincipal, serviceComponentFilter);
            } catch (IOException e) {
              throw new AmbariRuntimeException("Could not inject keytabs to enable kerberos", e);
            }
          }
        }
      ));

      return kcp;
    }
Performs the default behavior for processing the relevant Kerberos identities and generating the
Kerberos-specific command details to send to the agent.

@param targetHost the hostname of the target host
@param desiredConfigs desired config map
@return a map of propoperties to set as the Kerberos command parameters
@throws AmbariException
ambari-server/src/main/java/org/apache/ambari/server/events/publishers/AgentCommandsPublisher.java