private void checkValidExternalNameNodeAddress(String nameService, String nameNode, String address, Set<String> hosts) throws InvalidTopologyException {
    final String errorMessage = "Illegal external HA NAMENODE address for name service [%s], namenode [%s]: [%s]. Address " +
      "must be in <host>:<port> format where host is external to the cluster.";

    checkInvalidTopology(
      Strings.isNullOrEmpty(address) || address.contains("localhost") || address.contains("%HOSTGROUP") || !address.contains(":"),
      errorMessage, nameService, nameNode, address);

    String hostName = address.substring(0, address.indexOf(':'));

    checkInvalidTopology(hostName.isEmpty() || hosts.contains(hostName),
      errorMessage, nameService, nameNode, address);
  }
Verifies that all respective properties are set for an external NANENODE HA setup
ambari-server/src/main/java/org/apache/ambari/server/topology/validators/NameNodeHaValidator.java