RosterManager.java 1.57 KB
Newer Older
Matt Tucker's avatar
Matt Tucker committed
1 2 3 4 5
/**
 * $RCSfile$
 * $Revision$
 * $Date$
 *
Matt Tucker's avatar
Matt Tucker committed
6
 * Copyright (C) 2004 Jive Software. All rights reserved.
Matt Tucker's avatar
Matt Tucker committed
7
 *
Matt Tucker's avatar
Matt Tucker committed
8 9
 * This software is published under the terms of the GNU Public License (GPL),
 * a copy of which is included in this distribution.
Matt Tucker's avatar
Matt Tucker committed
10
 */
Matt Tucker's avatar
Matt Tucker committed
11

Matt Tucker's avatar
Matt Tucker committed
12 13
package org.jivesoftware.messenger.user;

Matt Tucker's avatar
Matt Tucker committed
14
import org.xmpp.packet.JID;
15

Matt Tucker's avatar
Matt Tucker committed
16 17 18 19 20 21 22 23 24 25 26 27 28
/**
 * <p>A simple service that allows components to retrieve a roster based solely on the ID of the owner.</p>
 * <p/>
 * <p>The User, Chatbot, and other ID based 'resources owners' have convenience methods for obtaining
 * a roster associated with the owner. However there are many components that need to retrieve the
 * roster based solely on the generic ID owner key. This interface defines a service that can do that.
 * This allows classes that generically manage resource for resource owners (such as presence updates)
 * to generically offer their services without knowing or caring if the roster owner is a user, chatbot, etc.</p>
 *
 * @author Iain Shigeoka
 */
public interface RosterManager {
    /**
29
     * <p>Obtain the roster for the given username.</p>
Matt Tucker's avatar
Matt Tucker committed
30
     *
31
     * @param username the username to search for
Matt Tucker's avatar
Matt Tucker committed
32 33 34
     * @return The roster associated with the ID
     * @throws UserNotFoundException If the ID does not correspond to a known entity on the server
     */
35
    CachedRoster getRoster(String username) throws UserNotFoundException;
36 37 38 39 40 41 42

    /**
     * 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 to remove his roster.
     */
Matt Tucker's avatar
Matt Tucker committed
43
    void deleteRoster(JID user);
Matt Tucker's avatar
Matt Tucker committed
44
}