KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jivesoftware > messenger > disco > DiscoItemsProvider


1 /**
2  * $RCSfile: DiscoItemsProvider.java,v $
3  * $Revision: 1.6 $
4  * $Date: 2005/07/26 05:08:21 $
5  *
6  * Copyright (C) 2004 Jive Software. All rights reserved.
7  *
8  * This software is published under the terms of the GNU Public License (GPL),
9  * a copy of which is included in this distribution.
10  */

11
12 package org.jivesoftware.messenger.disco;
13
14 import org.dom4j.Element;
15 import org.xmpp.packet.JID;
16
17 import java.util.Iterator JavaDoc;
18
19 /**
20  * A DiscoItemsProvider is responsible for providing the items associated with a JID's name and
21  * node. For example, the room service could implement this interface in order to provide
22  * the existing rooms as its items. In this case, the JID's name and node won't be used.<p>
23  * <p/>
24  * The items to provide must have a JID attribute specifying the JID of the item and may possess a
25  * name attribute specifying a natural-language name for the item. The node attribute is optional
26  * and must be used only for items that aren't addressable as a JID.
27  *
28  * @author Gaston Dombiak
29  */

30 public interface DiscoItemsProvider {
31
32     /**
33      * Returns an Iterator (of Element) with the target entity's items or null if none. Each Element
34      * must include a JID attribute and may include the name and node attributes of the entity. In
35      * case that the sender of the disco request is not authorized to discover items an
36      * UnauthorizedException will be thrown.
37      *
38      * @param name the recipient JID's name.
39      * @param node the requested disco node.
40      * @param senderJID the XMPPAddress of user that sent the disco items request.
41      * @return an Iterator (of Element) with the target entity's items or null if none.
42      */

43     public abstract Iterator JavaDoc<Element> getItems(String JavaDoc name, String JavaDoc node, JID senderJID);
44
45 }
46
Popular Tags