XMPPDispatcher class documentation

Authors

Generated by builder

Contents -

  1. Software documentation for the XMPPDispatcher class
  2. Software documentation for the MessageHandler protocol
  3. Software documentation for the PresenceHandler protocol
  4. Software documentation for the XMPPInfoQueryStanzaHandler protocol

Software documentation for the XMPPDispatcher class

XMPPDispatcher : NSObject

Declared in:
XMPPDispatcher.h
The XMPPDispatcher class is used for routing of received stanzas. Once each stanza has been passed, it will be encapsulated in an object. There are three kinds of stanza specified by XMPP: - Messages are one-to-one and have best-effort delivery semantics. They will typically be enqueued if they can not be delivered immediately - Presences are one-to-many and are unreliable. - Info-query (iq) stanzas are one-to-one, will not be enqueued, but should be acknowledged with either an error or a result reply.

Instance Variables

Method summary

dispatcherWithDefaultInfoQueryHandler: messageHandler: presenceHandler: 

+ (id) dispatcherWithDefaultInfoQueryHandler: (id<XMPPInfoQueryStanzaHandler>)iq messageHandler: (id<MessageHandler>)message presenceHandler: (id<PresenceHandler>)presence;
Create a new dispatcher with default handlers. In the current implementation all of these will be set to DefaultHandler objects.

addInfoQueryHandler: forNamespace: 

- (id) addInfoQueryHandler: (id<XMPPInfoQueryStanzaHandler>)handler forNamespace: (NSString*)aNamespace;
Add a handler for info-query packets with the type 'set' or 'get' in the specified namespace.

addInfoQueryResultHandler: forID: 

- (id) addInfoQueryResultHandler: (id<XMPPInfoQueryStanzaHandler>)handler forID: (NSString*)iqID;
Add a handler for info-query packets with the type 'result' or 'error'. Each outgoing packet should have a unique ID (which can be generated by the connection object if required). This ID will be re-used for the reply. This method should be used to set up handlers for replies to queries sent to remote clients.

addMessageHandler: ForJID: 

- (id) addMessageHandler: (id<MessageHandler>)handler ForJID: (NSString*)jid;
Add a message handler for a specified JID. All messages sent by this JID will be routed to the specified handler. If a JID with no resource is specified, then it will receive messages sent by all resources for the given JID.

addPresenceHandler: ForJID: 

- (id) addPresenceHandler: (id<PresenceHandler>)handler ForJID: (NSString*)jid;
Add a presence handler with the same delivery semantics as a message handler .

dispatchInfoQuery: 

- (void) dispatchInfoQuery: (XMPPInfoQueryStanza*)anIq;
Dispatch the specified info-query object to anyone who has elected to receive it.

dispatchMessage: 

- (void) dispatchMessage: (XMPPMessage*)aMessage;
Dispatch the specified message object to anyone who has elected to receive it.

dispatchPresence: 

- (void) dispatchPresence: (XMPPPresence*)aPresence;
Dispatch the specified presence object to anyone who has elected to receive it.

initWithDefaultInfoQueryHandler: messageHandler: presenceHandler: 

- (id) initWithDefaultInfoQueryHandler: (id<XMPPInfoQueryStanzaHandler>)iq messageHandler: (id<MessageHandler>)message presenceHandler: (id<PresenceHandler>)presence;
Initialise a new dispatcher with default handlers



Instance Variables for XMPPDispatcher Class

defaultIqHandler

@protected id defaultIqHandler;
Description forthcoming.

defaultMessageHandler

@protected id defaultMessageHandler;
Description forthcoming.

defaultPresenceHandler

@protected id defaultPresenceHandler;
Description forthcoming.

iqHandlers

@protected NSMutableDictionary* iqHandlers;
Description forthcoming.

iqNamespaceHandlers

@protected NSMutableDictionary* iqNamespaceHandlers;
Description forthcoming.

messageHandlers

@protected NSMutableDictionary* messageHandlers;
Description forthcoming.

presenceHandlers

@protected NSMutableDictionary* presenceHandlers;
Description forthcoming.




Software documentation for the MessageHandler protocol

MessageHandler

Declared in:
XMPPDispatcher.h
Conforms to:
NSObject
Formal protocol for handling messages.
Method summary

handleMessage: 

- (void) handleMessage: (XMPPMessage*)aMessage;
Handle the given message object.

Software documentation for the PresenceHandler protocol

PresenceHandler

Declared in:
XMPPDispatcher.h
Conforms to:
NSObject
Formal protocol for handling presence stanzas.
Method summary

handlePresence: 

- (void) handlePresence: (XMPPPresence*)aPresence;
Handle the given presence object.

Software documentation for the XMPPInfoQueryStanzaHandler protocol

XMPPInfoQueryStanzaHandler

Declared in:
XMPPDispatcher.h
Conforms to:
NSObject
Formal protocol for handling info-query packets.
Method summary

handleInfoQuery: 

- (void) handleInfoQuery: (XMPPInfoQueryStanza*)anIq;
Handle the given info-query object.