com.echomine.jabber
Class JID

java.lang.Object
  extended by com.echomine.jabber.JID

public class JID
extends java.lang.Object

Contains the JID resource. It also knows how to parse the information or output it in the JID compliant format. This is mainly used to generate or retrieve parts of the JID in a easy way. you simply pass in the JID string, and then retrieve whatever you like.


Constructor Summary
JID(java.lang.String jid)
          takes in a JID and then parses it into different parts.
JID(java.lang.String node, java.lang.String host, java.lang.String resource)
          takes in a set of information to create the JID object that can be use to convert into a JID string
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getHost()
           
 java.lang.String getJIDWithoutResource()
          retrieves the node@domain part of the JID.
 java.lang.String getNode()
           
 java.lang.String getResource()
           
 java.lang.String getUsername()
          this is the same as getNode().
 int hashCode()
          Uses the full JID string as the hash code
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JID

public JID(java.lang.String jid)
    throws ParseException
takes in a JID and then parses it into different parts.

Throws:
ParseException - if the jid does not conform to the format

JID

public JID(java.lang.String node,
           java.lang.String host,
           java.lang.String resource)
takes in a set of information to create the JID object that can be use to convert into a JID string

Parameters:
node - the name of the node or user, required
host - the Jabber server name, required
resource - the resource used, can be null to specify none
Method Detail

getNode

public java.lang.String getNode()

getHost

public java.lang.String getHost()

getResource

public java.lang.String getResource()

getUsername

public java.lang.String getUsername()
this is the same as getNode(). It's here for less confusion and convenience.


getJIDWithoutResource

public java.lang.String getJIDWithoutResource()
retrieves the node@domain part of the JID. It is basically the normal JID that you would use if you do not specify a resource. This is here for convenience.

Returns:
the node@domain part of the JID

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
the JID in the correct format

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Uses the full JID string as the hash code

Overrides:
hashCode in class java.lang.Object


Copyright © 2001-2005 Echomine. All Rights Reserved.