01: /**
02: * $RCSfile$
03: * $Revision: 1695 $
04: * $Date: 2005-07-26 02:09:55 -0300 (Tue, 26 Jul 2005) $
05: *
06: * Copyright (C) 2004 Jive Software. All rights reserved.
07: *
08: * This software is published under the terms of the GNU Public License (GPL),
09: * a copy of which is included in this distribution.
10: */package org.jivesoftware.openfire.disco;
11:
12: import org.xmpp.packet.JID;
13:
14: import java.util.Iterator;
15:
16: /**
17: * A DiscoItemsProvider is responsible for providing the items associated with a JID's name and
18: * node. For example, the room service could implement this interface in order to provide
19: * the existing rooms as its items. In this case, the JID's name and node won't be used.<p>
20: * <p/>
21: * The items to provide must have a JID attribute specifying the JID of the item and may possess a
22: * name attribute specifying a natural-language name for the item. The node attribute is optional
23: * and must be used only for items that aren't addressable as a JID.
24: *
25: * @author Gaston Dombiak
26: */
27: public interface DiscoItemsProvider {
28:
29: /**
30: * Returns an Iterator (of DiscoItem) with the target entity's items or null if none. Each DiscoItem
31: * must include a JID attribute and may include the name and node attributes of the entity. In
32: * case that the sender of the disco request is not authorized to discover items an
33: * UnauthorizedException will be thrown.
34: *
35: * @param name the recipient JID's name.
36: * @param node the requested disco node.
37: * @param senderJID the XMPPAddress of user that sent the disco items request.
38: * @return an Iterator (of DiscoItem) with the target entity's items or null if none.
39: */
40: public abstract Iterator<DiscoItem> getItems(String name,
41: String node, JID senderJID);
42:
43: }
|