Authors
- Generated by root
-
JID : NSObject
- Declared in:
- JID.h
The JID class represents a Jabber ID of the form
user@server/resource. A JID may have
all three components, a user and a server but no
resource, a server and resource but no user, or
just a server. Typically, two JIDs are referring to the
same person (but not the same client) when they have the
same user and server. For this reason, it is possible to
compare two JIDs either with or without their
associated resources. For example
user@example.com/work and
user@example.com/home would likely be
two clients in use by the same user, and so chat messages
from either should go into the same dialogue window. JID
objects are immutable, and may be used as keys in
collection objects such as dictionaries.
Instance Variables
Method summary
+ (id)
jidWithJID: (
JID*)_jid;
Creates a new JID by copying the passed JID.
+ (id)
jidWithString: (NSString*)_jid;
Creates a new JID from the given string.
- (NSComparisonResult)
compare: (
JID*)_other;
Compare two JIDs.
- (NSComparisonResult)
compareWithNoResource: (
JID*)_other;
Compare two JIDs excluding their resource
component. Any combination of
user@example.com/foo,
user@example.com/bar and
user@example.com will return NSOrderedSame
when used as receiver and argument for this
comparison.
- (NSString*)
domain;
Returns the server (domain) name for this JID.
- (id)
initWithJID: (
JID*)_jid;
Sets a newly +alloc'd JID to have the same value as an
existing JID.
- (id)
initWithString: (NSString*)_jid;
Initialises a new JID with a specified string
- (BOOL)
isEqualToJID: (
JID*)aJID;
Test for JID equality. Returns YES
if
both JIDs have the same components and all components
are the same.
- (NSString*)
jidString;
A string representation of this JID. Should be renamed
stringValue.
- (NSString*)
jidStringWithNoResource;
A string value of the root JID. Semantically equivalent
to calling [[aJid rootJID] jidString], but more
efficient.
- (NSString*)
node;
Returns the node; the component before the @,
typically used to identify the user.
- (NSString*)
resource;
Returns the resource for this JID.
- (
JID*)
rootJID;
Returns a new JID representing this JID with the
resource stripped.
- (
JIDType)
type;
Returns the amount of information provided by this
JID. invalidJID - Not a valid Jabber ID. serverJID - A
Jabber ID with only a server component.
serverResourceJID - A JID of the form
server/resource. userJID - A Jabber ID
with a server and user, but no resource. resourceJID -
A Jabber ID with all three components set.
Instance Variables for JID Class
@protected NSString* resource;
Description forthcoming.
@protected NSString* server;
Description forthcoming.
@protected NSString* stringRepresentation;
Description forthcoming.
@protected NSString* stringRepresentationWithNoResource;
Description forthcoming.
@protected JIDType type;
Description forthcoming.
@protected NSString* user;
Description forthcoming.
typedef enum ... JIDType;
Description forthcoming.