Java Doc for IQ.java in  » Net » openfire » org » xmpp » packet » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Net » openfire » org.xmpp.packet 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.xmpp.packet.Packet
      org.xmpp.packet.IQ

All known Subclasses:   org.xmpp.muc.RoomConfiguration,  org.xmpp.muc.DestroyRoom,  org.xmpp.packet.Roster,
IQ
public class IQ extends Packet (Code)
IQ (Info/Query) packet. IQ packets are used to get and set information on the server, including authentication, roster operations, and creating accounts. Each IQ packet has a specific type that indicates what type of action is being taken: "get", "set", "result", or "error".

IQ packets can contain a single child element that exists in a extended XML namespace.


Inner Class :public enum Type


Constructor Summary
public  IQ()
     Constructs a new IQ with an automatically generated ID and a type of Type.get IQ.Type.get .
public  IQ(Type type)
     Constructs a new IQ using the specified type.
public  IQ(Type type, String ID)
     Constructs a new IQ using the specified type and ID.
public  IQ(Element element)
     Constructs a new IQ using an existing Element.
public  IQ(Element element, boolean skipValidation)
     Constructs a new IQ using an existing Element.

Method Summary
public  voidaddExtension(PacketExtension extension)
     Adds the element contained in the PacketExtension to the child element of the IQ packet.
public  IQcreateCopy()
     Returns a deep copy of this IQ.
public static  IQcreateResultIQ(IQ iq)
     Convenience method to create a new Type.result IQ.Type.result IQ based on a Type.get IQ.Type.get or Type.set IQ.Type.set IQ.
public  booleandeleteExtension(String name, String namespace)
     Deletes the first element whose element name and namespace matches the specified element name and namespace in this packet's child element.
public  ElementgetChildElement()
     Returns the child element of this IQ.
public  PacketExtensiongetExtension(String name, String namespace)
     Returns a PacketExtension on the first element found in this packet's child element for the specified name and namespace or null if none was found.
public  TypegetType()
     Returns the type of this IQ.
public  booleanisRequest()
     Convenience routine to indicate if this is a request stanza.
public  booleanisResponse()
     Convenience routine to indicate if this is a response stanza.
public  voidsetChildElement(Element childElement)
     Sets the child element of this IQ.
public  ElementsetChildElement(String name, String namespace)
     Sets the child element of this IQ by constructing a new Element with the given name and namespace.
public  voidsetType(Type type)
     Sets the type of this IQ.


Constructor Detail
IQ
public IQ()(Code)
Constructs a new IQ with an automatically generated ID and a type of Type.get IQ.Type.get .



IQ
public IQ(Type type)(Code)
Constructs a new IQ using the specified type. A packet ID will be automatically generated.
Parameters:
  type - the IQ type.



IQ
public IQ(Type type, String ID)(Code)
Constructs a new IQ using the specified type and ID.
Parameters:
  ID - the packet ID of the IQ.
Parameters:
  type - the IQ type.



IQ
public IQ(Element element)(Code)
Constructs a new IQ using an existing Element. This is useful for parsing incoming IQ Elements into IQ objects.
Parameters:
  element - the IQ Element.



IQ
public IQ(Element element, boolean skipValidation)(Code)
Constructs a new IQ using an existing Element. This is useful for parsing incoming IQ Elements into IQ objects. Stringprep validation on the TO address can be disabled. The FROM address will not be validated since the server is the one that sets that value.
Parameters:
  element - the IQ Element.
Parameters:
  skipValidation - true if stringprep should not be applied to the TO address.




Method Detail
addExtension
public void addExtension(PacketExtension extension)(Code)
Adds the element contained in the PacketExtension to the child element of the IQ packet. IQ packets, unlike the other packet types, have a unique child element that holds the packet extensions. If an extension is added to an IQ packet that does not have a child element then an IllegalStateException will be thrown.

It is important that this is the first and last time the element contained in PacketExtension is added to another Packet. Otherwise, a runtime error will be thrown when trying to add the PacketExtension's element to the Packet's element. Future modifications to the PacketExtension will be reflected in this Packet.

Note: packet extensions on IQ packets are only for use in specialized situations. In most cases, you should only need to set the child element of the IQ.
Parameters:
  extension - the PacketExtension whose element will be added to this Packet's element.




createCopy
public IQ createCopy()(Code)
Returns a deep copy of this IQ. a deep copy of this IQ.



createResultIQ
public static IQ createResultIQ(IQ iq)(Code)
Convenience method to create a new Type.result IQ.Type.result IQ based on a Type.get IQ.Type.get or Type.set IQ.Type.set IQ. The new packet will be initialized with:
  • The sender set to the recipient of the originating IQ.
  • The recipient set to the sender of the originating IQ.
  • The type set to Type.result IQ.Type.result .
  • The id set to the id of the originating IQ.

Parameters:
  iq - the Type.get IQ.Type.get or Type.set IQ.Type.set IQ packet.
throws:
  IllegalArgumentException - if the IQ packet does not have a type ofType.get IQ.Type.get or Type.set IQ.Type.set. a new Type.result IQ.Type.result IQ based on the originating IQ.



deleteExtension
public boolean deleteExtension(String name, String namespace)(Code)
Deletes the first element whose element name and namespace matches the specified element name and namespace in this packet's child element. If the IQ packet does not have a child element then this method does nothing and returns false.

Notice that this method may remove any child element that matches the specified element name and namespace even if that element was not added to the Packet using a PacketExtension .

Note: packet extensions on IQ packets are only for use in specialized situations. In most cases, you should only need to set the child element of the IQ.
Parameters:
  name - the child element name.
Parameters:
  namespace - the child element namespace. true if a child element was removed.




getChildElement
public Element getChildElement()(Code)
Returns the child element of this IQ. IQ packets may have a single child element in an extended namespace. This is a convenience method to avoid manipulating the underlying packet's Element instance directly.

An IQ child element in extended namespaces is used to extend the features of XMPP. Although any valid XML can be included in a child element in an extended namespace, many common features have been standardized as Jabber Enhancement Proposals (JEPs). the child element.




getExtension
public PacketExtension getExtension(String name, String namespace)(Code)
Returns a PacketExtension on the first element found in this packet's child element for the specified name and namespace or null if none was found. If the IQ packet does not have a child element then null will be returned.

Note: packet extensions on IQ packets are only for use in specialized situations. In most cases, you should only need to set the child element of the IQ.
Parameters:
  name - the child element name.
Parameters:
  namespace - the child element namespace. a PacketExtension on the first element found in this packet for the specifiedname and namespace or null if none was found.




getType
public Type getType()(Code)
Returns the type of this IQ. the IQ type.
See Also:   Type



isRequest
public boolean isRequest()(Code)
Convenience routine to indicate if this is a request stanza. (get or set) True or false if this is a request stanza



isResponse
public boolean isResponse()(Code)
Convenience routine to indicate if this is a response stanza. (result or error) True or false if this is a response stanza



setChildElement
public void setChildElement(Element childElement)(Code)
Sets the child element of this IQ. IQ packets may have a single child element in an extended namespace. This is a convenience method to avoid manipulating this underlying packet's Element instance directly.

A sample use of this method might look like the following:

 IQ iq = new IQ("time_1");
 iq.setTo("mary@example.com");
 iq.setType(IQ.Type.GET);
 iq.setChildElement(docFactory.createElement("query", "jabber:iq:time"));

An IQ child element in extended namespaces is used to extend the features of XMPP. Although any valid XML can be included in a child element in an extended namespace, many common features have been standardized as Jabber Enhancement Proposals (JEPs).
Parameters:
  childElement - the child element.




setChildElement
public Element setChildElement(String name, String namespace)(Code)
Sets the child element of this IQ by constructing a new Element with the given name and namespace. The newly created child element is returned. IQ packets may have a single child element in an extended namespace. This method is a convenience method to avoid manipulating the underlying packet's Element instance directly.

In some cases, additional custom sub-elements must be added to an IQ child element (called packet extensions). For example, when adding a data form to an IQ response. See IQ.addExtension(PacketExtension) .

A sample use of this method might look like the following:

 IQ iq = new IQ("time_1");
 iq.setTo("mary@example.com");
 iq.setType(IQ.Type.GET);
 iq.setChildElement("query", "jabber:iq:time");

Parameters:
  name - the child element name.
Parameters:
  namespace - the child element namespace. the newly created child element.



setType
public void setType(Type type)(Code)
Sets the type of this IQ.
Parameters:
  type - the IQ type.
See Also:   Type



Fields inherited from org.xmpp.packet.Packet
protected static DocumentFactory docFactory(Code)(Java Doc)
protected Element element(Code)(Java Doc)
protected JID fromJID(Code)(Java Doc)
protected JID toJID(Code)(Java Doc)

Methods inherited from org.xmpp.packet.Packet
public void addExtension(PacketExtension extension)(Code)(Java Doc)
abstract public Packet createCopy()(Code)(Java Doc)
public boolean deleteExtension(String name, String namespace)(Code)(Java Doc)
public Element getElement()(Code)(Java Doc)
public PacketError getError()(Code)(Java Doc)
public PacketExtension getExtension(String name, String namespace)(Code)(Java Doc)
public JID getFrom()(Code)(Java Doc)
public String getID()(Code)(Java Doc)
public JID getTo()(Code)(Java Doc)
public void setError(PacketError error)(Code)(Java Doc)
public void setError(PacketError.Condition condition)(Code)(Java Doc)
public void setFrom(String from)(Code)(Java Doc)
public void setFrom(JID from)(Code)(Java Doc)
public void setID(String ID)(Code)(Java Doc)
public void setTo(String to)(Code)(Java Doc)
public void setTo(JID to)(Code)(Java Doc)
public String toString()(Code)(Java Doc)
public String toXML()(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.