public Map<String, User> getUsers(LDAPAuthenticatedUser user)
            throws GuacamoleException {

        ConnectedLDAPConfiguration config = user.getLDAPConfiguration();
        
        // Retrieve all visible user objects
        Collection<String> usernameAttrs = config.getUsernameAttributes();
        Collection<String> attributes = new HashSet<>(usernameAttrs);
        attributes.addAll(config.getAttributes());
        List<Entry> results = queryService.search(
            config,
            config.getLDAPConnection(),
            config.getUserBaseDN(),
            config.getUserSearchFilter(),
            usernameAttrs,
            null,
            attributes
        );

        // Convert retrieved users to map of identifier to Guacamole user object
        return queryService.asMap(results, entry -> {

            // Get username from record
            try {
                String username = queryService.getIdentifier(entry, attributes);
                if (username == null) {
                    logger.warn("User \"{}\" is missing a username attribute "
                            + "and will be ignored.", entry.getDn().toString());
                    return null;
                }
                
                return new SimpleUser(username);
            }
            catch (LdapInvalidAttributeValueException e) {
                
                return null;
            }

        });

    }
Returns all Guacamole users accessible to the given user.

@param user
    The AuthenticatedUser object associated with the user who is
    currently authenticated with Guacamole.

@return
    All users accessible to the user currently bound under the given
    LDAP connection, as a map of connection identifier to corresponding
    user object.

@throws GuacamoleException
    If an error occurs preventing retrieval of users.
extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/user/UserService.java