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

JID
public class JID implements Comparable<JID>,Externalizable(Code)
An XMPP address (JID). A JID is made up of a node (generally a username), a domain, and a resource. The node and resource are optional; domain is required. In simple ABNF form:
    jid = [ node "@" ] domain [ "/" resource ]
Some sample JID's:
  • user@example.com
  • user@example.com/home
  • example.com
Each allowable portion of a JID (node, domain, and resource) must not be more than 1023 bytes in length, resulting in a maximum total size (including the '@' and '/' separators) of 3071 bytes.
author:
   Matt Tucker



Constructor Summary
public  JID()
     Constructor added for Externalizable.
public  JID(String jid)
     Constructs a JID from it's String representation.
public  JID(String node, String domain, String resource)
     Constructs a JID given a node, domain, and resource.
public  JID(String node, String domain, String resource, boolean skipStringprep)
     Constructs a JID given a node, domain, and resource being able to specify if stringprep should be applied or not.

Method Summary
public  intcompareTo(JID jid)
    
public  booleanequals(Object object)
    
public static  booleanequals(String jid1, String jid2)
     Returns true if two JID's are equivalent.
public static  StringescapeNode(String node)
     Escapes the node portion of a JID according to "JID Escaping" (JEP-0106). Escaping replaces characters prohibited by node-prep with escape sequences, as follows:

Unescaped CharacterEncoded Sequence
<space>\20
"\22
&\26
'\27
/\2f
:\3a
<\3c
>\3e
@\40
\\5c

This process is useful when the node comes from an external source that doesn't conform to nodeprep.

public  StringgetDomain()
     Returns the domain.
public  StringgetNode()
     Returns the node, or null if this JID does not contain node information.
static  String[]getParts(String jid)
     Returns a String array with the parsed node, domain and resource. No Stringprep is performed while parsing the textual representation.
Parameters:
  jid - the textual JID representation.
public  StringgetResource()
     Returns the resource, or null if this JID does not contain resource information.
public  inthashCode()
    
public  voidreadExternal(ObjectInput in)
    
public static  Stringresourceprep(String resource)
    
public  StringtoBareJID()
     Returns the String representation of the bare JID, which is the JID with resource information removed.
public  StringtoString()
     Returns a String representation of the JID.
public static  StringunescapeNode(String node)
     Un-escapes the node portion of a JID according to "JID Escaping" (JEP-0106).

Escaping replaces characters prohibited by node-prep with escape sequences, as follows:

Unescaped CharacterEncoded Sequence
<space>\20
"\22
&\26
'\27
/\2f
:\3a
<\3c
>\3e
@\40
\\5c

This process is useful when the node comes from an external source that doesn't conform to nodeprep.

public  voidwriteExternal(ObjectOutput out)
    


Constructor Detail
JID
public JID()(Code)
Constructor added for Externalizable. Do not use this constructor.



JID
public JID(String jid)(Code)
Constructs a JID from it's String representation.
Parameters:
  jid - a valid JID.
throws:
  IllegalArgumentException - if the JID is not valid.



JID
public JID(String node, String domain, String resource)(Code)
Constructs a JID given a node, domain, and resource.
Parameters:
  node - the node.
Parameters:
  domain - the domain, which must not be null.
Parameters:
  resource - the resource.
throws:
  IllegalArgumentException - if the JID is not valid.



JID
public JID(String node, String domain, String resource, boolean skipStringprep)(Code)
Constructs a JID given a node, domain, and resource being able to specify if stringprep should be applied or not.
Parameters:
  node - the node.
Parameters:
  domain - the domain, which must not be null.
Parameters:
  resource - the resource.
Parameters:
  skipStringprep - true if stringprep should not be applied.
throws:
  IllegalArgumentException - if the JID is not valid.




Method Detail
compareTo
public int compareTo(JID jid)(Code)



equals
public boolean equals(Object object)(Code)



equals
public static boolean equals(String jid1, String jid2)(Code)
Returns true if two JID's are equivalent. The JID components are compared using the following rules:
  • Nodes are normalized using nodeprep (case insensitive).
  • Domains are normalized using IDNA and then nameprep (case insensitive).
  • Resources are normalized using resourceprep (case sensitive).
These normalization rules ensure, for example, that User@EXAMPLE.com/home is considered equal to user@example.com/home.
Parameters:
  jid1 - a JID.
Parameters:
  jid2 - a JID. true if the JIDs are equivalent; false otherwise.
throws:
  IllegalArgumentException - if either JID is not valid.



escapeNode
public static String escapeNode(String node)(Code)
Escapes the node portion of a JID according to "JID Escaping" (JEP-0106). Escaping replaces characters prohibited by node-prep with escape sequences, as follows:

Unescaped CharacterEncoded Sequence
<space>\20
"\22
&\26
'\27
/\2f
:\3a
<\3c
>\3e
@\40
\\5c

This process is useful when the node comes from an external source that doesn't conform to nodeprep. For example, a username in LDAP may be "Joe Smith". Because the <space> character isn't a valid part of a node, the username should be escaped to "Joe\20Smith" before being made into a JID (e.g. "joe\20smith@example.com" after case-folding, etc. has been applied).

All node escaping and un-escaping must be performed manually at the appropriate time; the JID class will not escape or un-escape automatically.
Parameters:
  node - the node. the escaped version of the node.




getDomain
public String getDomain()(Code)
Returns the domain. the domain.



getNode
public String getNode()(Code)
Returns the node, or null if this JID does not contain node information. the node.



getParts
static String[] getParts(String jid)(Code)
Returns a String array with the parsed node, domain and resource. No Stringprep is performed while parsing the textual representation.
Parameters:
  jid - the textual JID representation. a string array with the parsed node, domain and resource.



getResource
public String getResource()(Code)
Returns the resource, or null if this JID does not contain resource information. the resource.



hashCode
public int hashCode()(Code)



readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException(Code)



resourceprep
public static String resourceprep(String resource) throws StringprepException(Code)



toBareJID
public String toBareJID()(Code)
Returns the String representation of the bare JID, which is the JID with resource information removed. the bare JID.



toString
public String toString()(Code)
Returns a String representation of the JID. a String representation of the JID.



unescapeNode
public static String unescapeNode(String node)(Code)
Un-escapes the node portion of a JID according to "JID Escaping" (JEP-0106).

Escaping replaces characters prohibited by node-prep with escape sequences, as follows:

Unescaped CharacterEncoded Sequence
<space>\20
"\22
&\26
'\27
/\2f
:\3a
<\3c
>\3e
@\40
\\5c

This process is useful when the node comes from an external source that doesn't conform to nodeprep. For example, a username in LDAP may be "Joe Smith". Because the <space> character isn't a valid part of a node, the username should be escaped to "Joe\20Smith" before being made into a JID (e.g. "joe\20smith@example.com" after case-folding, etc. has been applied).

All node escaping and un-escaping must be performed manually at the appropriate time; the JID class will not escape or un-escape automatically.
Parameters:
  node - the escaped version of the node. the un-escaped version of the node.




writeExternal
public void writeExternal(ObjectOutput out) throws IOException(Code)



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.