public void deleteRoster(JID user) {
        if (!server.isLocal(user)) {
            // Ignore request if user is not a local user
            return;
        }
        try {
            String username = user.getNode();
            // Get the roster of the deleted user
            Roster roster = getRoster(username);
            // Remove each roster item from the user's roster
            for (RosterItem item : roster.getRosterItems()) {
                try {
                    roster.deleteRosterItem(item.getJid(), false);
                }
                catch (SharedGroupException e) {
                    // Do nothing. We shouldn't have this exception since we disabled the checkings
                    Log.warn( "Unexpected exception while deleting roster of user '{}' .", user, e );
                }
            }
            // Remove the cached roster from memory
            rosterCache.remove(username);

            // Get the rosters that have a reference to the deleted user
            Iterator<String> usernames = provider.getUsernames(user.toBareJID());
            while (usernames.hasNext()) {
                username = usernames.next();
                try {
                    // Get the roster that has a reference to the deleted user
                    roster = getRoster(username);
                    // Remove the deleted user reference from this roster
                    roster.deleteRosterItem(user, false);
                }
                catch (SharedGroupException e) {
                    // Do nothing. We shouldn't have this exception since we disabled the checkings
                    Log.warn( "Unexpected exception while deleting roster of user '{}' .", user, e );
                }
                catch (UserNotFoundException e) {
                    // Deleted user had user that no longer exists on their roster. Ignore and move on.
                }
            }
        }
        catch (UnsupportedOperationException | UserNotFoundException e) {
            // Do nothing
        }
    }
Removes the entire roster of a given user. This is necessary when a user
account is being deleted from the server.

@param user the user.
xmppserver/src/main/java/org/jivesoftware/openfire/roster/RosterManager.java