KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jivesoftware > messenger > IQHandlerInfo


1 /**
2  * $RCSfile: IQHandlerInfo.java,v $
3  * $Revision: 1.3 $
4  * $Date: 2004/10/25 23:41:56 $
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;
13
14 /**
15  * <p>A simple meta-data class that stores several related tools for
16  * generic IQ protocol handling.</p>
17  * <p/>
18  * <p>To handle an IQ packet, the server needs to know:</p>
19  * <ul>
20  * <li>The fully qualified name of the iq sub-element. IQ packets are
21  * identified using this information when matching to a handler.</li>
22  * <li>The IQHandler that will handle this packet if addressed to the
23  * server (no 'to' attribute).</li>
24  * <li>The IQ parser to use to generate the correct IQ packet.</li>
25  * </ul>
26  * <p/>
27  * <p>We provide this information by having all IQHandlers report
28  * their info. Interested parties can watch for IQHandlers in the service
29  * lookup and build appropriate data structures on the current state of
30  * IQ handlers in the system.</p>
31  *
32  * @author Iain Shigeoka
33  */

34 public class IQHandlerInfo {
35
36     private String JavaDoc name;
37     private String JavaDoc namespace;
38
39     /**
40      * <p>Construct an info object.</p>
41      *
42      * @param name The name of the root iq element
43      * @param namespace The namespace of the root iq element
44      */

45     public IQHandlerInfo(String JavaDoc name, String JavaDoc namespace) {
46         this.name = name;
47         this.namespace = namespace;
48     }
49
50     /**
51      * <p>Obtain the name of the root iq element for this packet type.</p>
52      *
53      * @return The name of the root iq element
54      */

55     public String JavaDoc getName() {
56         return name;
57     }
58
59     /**
60      * <p>Obtain the namespace of the root iq element for this packet type.</p>
61      *
62      * @return the namespace of the root iq element.
63      */

64     public String JavaDoc getNamespace() {
65         return namespace;
66     }
67 }
68
Popular Tags