JID class documentation

Authors

Generated by builder

Contents -

  1. Software documentation for the JID class
  2. JID types

Software documentation for the JID class

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

jidWithString: 

+ (id) jidWithString: (NSString*)aJid;
Creates a new JID from the given string.

compare: 

- (NSComparisonResult) compare: (JID*)anAnotherJid;
Compare two JIDs.

compareWithNoResource: 

- (NSComparisonResult) compareWithNoResource: (JID*)anAnotherJid;
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.

domain 

- (NSString*) domain;
Returns the server (domain) name for this JID.

initWithString: 

- (id) initWithString: (NSString*)aJid;
Initialises a new JID with a specified string

isEqualToJID: 

- (BOOL) isEqualToJID: (JID*)aJID;
Test for JID equality. Returns YES if both JIDs have the same components and all components are the same.

jidString 

- (NSString*) jidString;
A string representation of this JID. Should be renamed stringValue.

jidStringWithNoResource 

- (NSString*) jidStringWithNoResource;
A string value of the root JID. Semantically equivalent to calling [[aJid rootJID] jidString], but more efficient.

node 

- (NSString*) node;
Returns the node; the component before the @, typically used to identify the user.

resource 

- (NSString*) resource;
Returns the resource for this JID.

rootJID 

- (JID*) rootJID;
Returns a new JID representing this JID with the resource stripped.

type 

- (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

resource

@protected NSString* resource;
Description forthcoming.

server

@protected NSString* server;
Description forthcoming.

stringRepresentation

@protected NSString* stringRepresentation;
Description forthcoming.

stringRepresentationWithNoResource

@protected NSString* stringRepresentationWithNoResource;
Description forthcoming.

type

@protected JIDType type;
Description forthcoming.

user

@protected NSString* user;
Description forthcoming.




JID types

JIDType

typedef enum ... JIDType;
Description forthcoming.