@Override
    public Collection<String> getUsernames() {
        // Cache usernames for 5 minutes.
        if (allUsernames != null && allUserCacheExpires.isAfter(Instant.now())) {
            return allUsernames;
        }
        // Refresh the cache
        getUsers();
        return this.allUsernames;
    }
LDAP implementation of the UserProvider interface. All data in the directory is
treated as read-only so any set operations will result in an exception.

@author Matt Tucker
xmppserver/src/main/java/org/jivesoftware/openfire/ldap/LdapUserProvider.java