Java Doc for Packet.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

All known Subclasses:   org.xmpp.packet.IQ,  org.jivesoftware.openfire.multiplex.Route,  org.xmpp.packet.Message,  org.xmpp.packet.Presence,
Packet
abstract public class Packet (Code)
An XMPP packet (also referred to as a stanza). Each packet is backed by a DOM4J Element. A set of convenience methods allows easy manipulation of the Element, or the Element can be accessed directly and manipulated.

There are three core packet types:

  • Message -- used to send data between users.
  • Presence -- contains user presence information or is used to manage presence subscriptions.
  • IQ -- exchange information and perform queries using a request/response protocol.

author:
   Matt Tucker


Field Summary
protected static  DocumentFactorydocFactory
    
protected  Elementelement
    
protected  JIDfromJID
    
protected  JIDtoJID
    

Constructor Summary
public  Packet(Element element)
     Constructs a new Packet.
public  Packet(Element element, boolean skipValidation)
     Constructs a new Packet.
protected  Packet()
     Constructs a new Packet with no element data.

Method Summary
public  voidaddExtension(PacketExtension extension)
     Adds the element contained in the PacketExtension to the element of this packet. It is important that this is the first and last time the element contained in PacketExtension is added to another Packet.
abstract public  PacketcreateCopy()
     Creates a deep copy of this packet.
public  booleandeleteExtension(String name, String namespace)
     Deletes the first element whose element name and namespace matches the specified element name and namespace.

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 .
Parameters:
  name - the child element name.
Parameters:
  namespace - the child element namespace.

public  ElementgetElement()
     Returns the DOM4J Element that backs the packet.
public  PacketErrorgetError()
     Returns the packet error, or null if there is no packet error.
public  PacketExtensiongetExtension(String name, String namespace)
     Returns a PacketExtension on the first element found in this packet for the specified name and namespace or null if none was found.
Parameters:
  name - the child element name.
Parameters:
  namespace - the child element namespace.
public  JIDgetFrom()
     Returns the XMPP address (JID) that the packet is from, or null if the "from" attribute is not set.
public  StringgetID()
     Returns the packet ID, or null if the packet does not have an ID.
public  JIDgetTo()
     Returns the XMPP address (JID) that the packet is addressed to, or null if the "to" attribute is not set.
public  voidsetError(PacketError error)
     Sets the packet error.
public  voidsetError(PacketError.Condition condition)
     Sets the packet error using the specified condition.
public  voidsetFrom(String from)
     Sets the XMPP address (JID) that the packet comes from.
public  voidsetFrom(JID from)
     Sets the XMPP address (JID) that the packet comes from.
public  voidsetID(String ID)
     Sets the packet ID.
public  voidsetTo(String to)
     Sets the XMPP address (JID) that the packet is addressed to.
public  voidsetTo(JID to)
     Sets the XMPP address (JID) that the packet is address to.
public  StringtoString()
    
public  StringtoXML()
     Returns the textual XML representation of this packet.

Field Detail
docFactory
protected static DocumentFactory docFactory(Code)



element
protected Element element(Code)



fromJID
protected JID fromJID(Code)



toJID
protected JID toJID(Code)




Constructor Detail
Packet
public Packet(Element element)(Code)
Constructs a new Packet. The TO address contained in the XML Element will only be validated. In other words, stringprep operations will only be performed on the TO JID to verify that it is well-formed. The FROM address is assigned by the server so there is no need to verify it.
Parameters:
  element - the XML Element that contains the packet contents.



Packet
public Packet(Element element, boolean skipValidation)(Code)
Constructs a new Packet. The JID address contained in the XML Element may not be validated. When validation can be skipped then stringprep operations will not be performed on the JIDs to verify that addresses are well-formed. However, when validation cannot be skipped then only the TO address will be verified. The FROM address is assigned by the server so there is no need to verify it.
Parameters:
  element - the XML Element that contains the packet contents.
Parameters:
  skipValidation - true if stringprep should not be applied to the TO address.



Packet
protected Packet()(Code)
Constructs a new Packet with no element data. This method is used by extensions of this class that require a more optimized path for creating new packets.




Method Detail
addExtension
public void addExtension(PacketExtension extension)(Code)
Adds the element contained in the PacketExtension to the element of this packet. 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.
Parameters:
  extension - the PacketExtension whose element will be added to this Packet's element.



createCopy
abstract public Packet createCopy()(Code)
Creates a deep copy of this packet. a deep copy of this packet.



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.

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 .
Parameters:
  name - the child element name.
Parameters:
  namespace - the child element namespace. true if a child element was removed.




getElement
public Element getElement()(Code)
Returns the DOM4J Element that backs the packet. The element is the definitive representation of the packet and can be manipulated directly to change packet contents. the DOM4J Element that represents the packet.



getError
public PacketError getError()(Code)
Returns the packet error, or null if there is no packet error. the packet error.



getExtension
public PacketExtension getExtension(String name, String namespace)(Code)
Returns a PacketExtension on the first element found in this packet for the specified name and namespace or null if none was found.
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.



getFrom
public JID getFrom()(Code)
Returns the XMPP address (JID) that the packet is from, or null if the "from" attribute is not set. The XMPP protocol often makes the "from" attribute optional, so it does not always need to be set. the XMPP address that the packet is from, or nullif not set.



getID
public String getID()(Code)
Returns the packet ID, or null if the packet does not have an ID. Packet ID's are optional, except for IQ packets. the packet ID.



getTo
public JID getTo()(Code)
Returns the XMPP address (JID) that the packet is addressed to, or null if the "to" attribute is not set. The XMPP protocol often makes the "to" attribute optional, so it does not always need to be set. the XMPP address (JID) that the packet is addressed to, or nullif not set.



setError
public void setError(PacketError error)(Code)
Sets the packet error. Calling this method will automatically set the packet "type" attribute to "error".
Parameters:
  error - the packet error.



setError
public void setError(PacketError.Condition condition)(Code)
Sets the packet error using the specified condition. Calling this method will automatically set the packet "type" attribute to "error". This is a convenience method equivalent to calling: setError(new PacketError(condition));
Parameters:
  condition - the error condition.



setFrom
public void setFrom(String from)(Code)
Sets the XMPP address (JID) that the packet comes from. The XMPP protocol often makes the "from" attribute optional, so it does not always need to be set.
Parameters:
  from - the XMPP address (JID) that the packet comes from.



setFrom
public void setFrom(JID from)(Code)
Sets the XMPP address (JID) that the packet comes from. The XMPP protocol often makes the "from" attribute optional, so it does not always need to be set.
Parameters:
  from - the XMPP address (JID) that the packet comes from.



setID
public void setID(String ID)(Code)
Sets the packet ID. Packet ID's are optional, except for IQ packets.
Parameters:
  ID - the packet ID.



setTo
public void setTo(String to)(Code)
Sets the XMPP address (JID) that the packet is addressed to. The XMPP protocol often makes the "to" attribute optional, so it does not always need to be set.
Parameters:
  to - the XMPP address (JID) that the packet is addressed to.



setTo
public void setTo(JID to)(Code)
Sets the XMPP address (JID) that the packet is address to. The XMPP protocol often makes the "to" attribute optional, so it does not always need to be set.
Parameters:
  to - the XMPP address (JID) that the packet is addressed to.



toString
public String toString()(Code)



toXML
public String toXML()(Code)
Returns the textual XML representation of this packet. the textual XML representation of this packet.



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.