CachedRoster.java 1.5 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 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
package org.jivesoftware.messenger.user;

import org.jivesoftware.messenger.Presence;
import org.jivesoftware.messenger.auth.UnauthorizedException;
import org.jivesoftware.util.Cacheable;

/**
 * <p>A Roster that is cached in memory and persisted to some backend storage system.</p>
 * <p/>
 * <p>Cached Rosters are the permanent roster attached to a user/chatbot account. This interface
 * is primarily a marker interface for implementations.</p>
 *
 * @author Iain Shigeoka
 *         <p/>
 *
 */
public interface CachedRoster extends Roster, Cacheable {

    /**
31
     * <p>Return the username of the user or chatbot that owns this roster.</p>
Matt Tucker's avatar
Matt Tucker committed
32
     *
33
     * @return the username of the user or chatbot that owns this roster
Matt Tucker's avatar
Matt Tucker committed
34
     */
35
    String getUsername();
Matt Tucker's avatar
Matt Tucker committed
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52

    /**
     * <p>Obtain a 'roster reset', a snapshot of the full cached roster as an IQRoster.</p>
     *
     * @return The roster reset (snapshot) as an IQRoster
     */
    IQRoster getReset() throws UnauthorizedException;

    /**
     * <p>Broadcast the presence update to all subscribers of the roter.</p>
     * <p/>
     * <p>Any presence change typically results in a broadcast to the roster members.</p>
     *
     * @param packet The presence packet to broadcast
     */
    void broadcastPresence(Presence packet);
}