public static boolean isUserPrincipalNameFormat(String loginName) {
    return UPN_FORMAT.matcher(loginName).matches();
  }
Returns true if the given user name contains domain name as well (e.g. username@domain)

@param loginName the login name to verify if it contains domain information.
@return true if the given user name contains domain name as well; false otherwise
ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariLdapUtils.java