public Roster getRoster(String username) throws UserNotFoundException {
        Roster roster = rosterCache.get(username);
        if (roster == null) {
            final Lock lock = rosterCache.getLock(username);
            lock.lock();
            try {
                roster = rosterCache.get(username);
                if (roster == null) {
                    // Not in cache so load a new one:
                    roster = new Roster(username);
                    rosterCache.put(username, roster);
                }
            } finally {
                lock.unlock();
            }
        }
        return roster;
    }
Returns the roster for the given username.

@param username the username to search for.
@return the roster associated with the ID.
@throws org.jivesoftware.openfire.user.UserNotFoundException if the ID does not correspond
        to a known entity on the server.
xmppserver/src/main/java/org/jivesoftware/openfire/roster/RosterManager.java