Dispatcher class documentation

Authors

Generated by root

Contents -

  1. Software documentation for the Dispatcher class
  2. Software documentation for the IqHandler protocol
  3. Software documentation for the MessageHandler protocol
  4. Software documentation for the PresenceHandler protocol

Software documentation for the Dispatcher class

Dispatcher : NSObject

Declared in:
Dispatcher.h
The Dispatcher 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

dispatcherWithDefaultIqHandler: messageHandler: presenceHandler: 

+ (id) dispatcherWithDefaultIqHandler: (id<IqHandler>)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 DefaultHander objects.

addIqResultHandler: forID: 

- (id) addIqResultHandler: (id<IqHandler>)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 .

dispatchIq: 

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

dispatchMessage: 

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

dispatchPresence: 

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

initWithDefaultIqHandler: messageHandler: presenceHandler: 

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



Instance Variables for Dispatcher 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.

messageHandlers

@protected NSMutableDictionary* messageHandlers;
Description forthcoming.

presenceHandlers

@protected NSMutableDictionary* presenceHandlers;
Description forthcoming.




Software documentation for the IqHandler protocol

IqHandler

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

handleIq: 

- (void) handleIq: (Iq*)anIq;
Handle the given info-query object.

Software documentation for the MessageHandler protocol

MessageHandler

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

handleMessage: 

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

Software documentation for the PresenceHandler protocol

PresenceHandler

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

handlePresence: 

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