Saros
Distributed Collaborative Editing and Distributed Party Programming
de.fu_berlin.inf.dpp.net.xmpp.JID Class Reference

Inherits Serializable.

List of all members.

Public Member Functions

 JID (String jid)
 JID (String name, String domain)
boolean isValid ()
String getName ()
String getBase ()
String getDomain ()
String getResource ()
boolean isBareJID ()
boolean isResourceQualifiedJID ()
JID getBareJID ()
String getRAW ()
boolean equals (Object obj)
boolean strictlyEquals (JID other)
int hashCode ()
String toString ()

Static Public Member Functions

static JID createFromServicePerspective (String servicePerspectiveJID)
static boolean isValid (JID jid)

Detailed Description

A JID which is used to identify the users of the XMPP network.

A JID is a value object, i.e. it is immutable!

Author:
rdjemili

Constructor & Destructor Documentation

de.fu_berlin.inf.dpp.net.xmpp.JID.JID ( String  jid)

Construct a new JID

Parameters:
jidthe JID in the format of user[/resource]. Resource is optional.
de.fu_berlin.inf.dpp.net.xmpp.JID.JID ( String  name,
String  domain 
)

Member Function Documentation

static JID de.fu_berlin.inf.dpp.net.xmpp.JID.createFromServicePerspective ( String  servicePerspectiveJID) [static]

Creates the client JID on the base of a service perspective JID as explained in XEP-0045.

Example: A MultiUserChat participant has - from the perspective of the MultiUserChat itself - the JID saros128280129@conference.jabber.ccc.de/bkahlert.org/Saros. This method would return the JID representing bkahlert@jabber.org/Saros.

See also:
XEP-0045
Parameters:
servicePerspectiveJIDthe XMPP address from the perspective of the service
Returns:
the client JID portion
boolean de.fu_berlin.inf.dpp.net.xmpp.JID.equals ( Object  obj)
Returns:
true if the IDs have the same user and domain. Resource is ignored.
JID de.fu_berlin.inf.dpp.net.xmpp.JID.getBareJID ( )

Returns the JID without any resource qualifier.

String de.fu_berlin.inf.dpp.net.xmpp.JID.getBase ( )
Returns:
the JID without resource qualifier.
See also:
StringUtils.parseBareAddress(String)
String de.fu_berlin.inf.dpp.net.xmpp.JID.getDomain ( )
Returns:
the domain segment of this JID.
See also:
StringUtils.parseServer(String)
String de.fu_berlin.inf.dpp.net.xmpp.JID.getName ( )
Returns:
the name segment of this JID.
See also:
StringUtils.parseName(String)
String de.fu_berlin.inf.dpp.net.xmpp.JID.getRAW ( )

Returns the unmodified JID this object was constructed with

Returns:
String de.fu_berlin.inf.dpp.net.xmpp.JID.getResource ( )
Returns:
the resource segment of this JID or the empty string if there is none.
See also:
StringUtils.parseResource(String)
int de.fu_berlin.inf.dpp.net.xmpp.JID.hashCode ( )
boolean de.fu_berlin.inf.dpp.net.xmpp.JID.isBareJID ( )

Returns true if this JID does not have a resource part.

boolean de.fu_berlin.inf.dpp.net.xmpp.JID.isResourceQualifiedJID ( )

Returns true if this JID does have a resource part.

static boolean de.fu_berlin.inf.dpp.net.xmpp.JID.isValid ( JID  jid) [static]

Checks whether the base portion is correctly formatted.

Parameters:
jid
Returns:
boolean de.fu_berlin.inf.dpp.net.xmpp.JID.isValid ( )

Checks whether the base portion is correctly formatted.

Returns:
boolean de.fu_berlin.inf.dpp.net.xmpp.JID.strictlyEquals ( JID  other)

Returns true if this JID and the given JID are completely identical (this includes the resource unlike equals)

String de.fu_berlin.inf.dpp.net.xmpp.JID.toString ( )
Returns:
the complete string that was used to construct this object.
 All Classes Namespaces Files Functions Variables Enumerations