public Query findUserDnBySearch(String user, String userSearchFilter) {
    if (userSearchFilter != null) {
      userSearchFilter = userSearchFilter.replaceAll("\\{0\\}", user);
    }
    return Query.builder()
        .filter(userSearchFilter)
        .build();
  }
Returns a query for finding user DN based on user RDN.
@param user user RDN that will replace {0} in the search filter
@param userSearchFilter search query that user filter conditions.
@return an instance of {@link Query}
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/ldap/QueryFactory.java