Authors
- Generated by root
-
- 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
+ (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.
- (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.
- (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.
- (id)
addPresenceHandler: (id<
PresenceHandler>)handler
ForJID: (NSString*)jid;
Add a presence handler with the same
delivery semantics as a message handler
.
- (void)
dispatchIq: (
Iq*)anIq;
Dispatch the specified info-query object to anyone
who has elected to receive it.
- (void)
dispatchMessage: (
Message*)aMessage;
Dispatch the specified message object to anyone
who has elected to receive it.
- (void)
dispatchPresence: (
Presence*)aPresence;
Dispatch the specified presence object to anyone
who has elected to receive it.
- (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
@protected id defaultIqHandler;
Description forthcoming.
@protected id defaultMessageHandler;
Description forthcoming.
@protected id defaultPresenceHandler;
Description forthcoming.
@protected NSMutableDictionary* iqHandlers;
Description forthcoming.
@protected NSMutableDictionary* messageHandlers;
Description forthcoming.
@protected NSMutableDictionary* presenceHandlers;
Description forthcoming.
- Declared in:
- Dispatcher.h
- Conforms to:
- NSObject
Formal protocol for handling info-query packets.
Method summary
- (void)
handleIq: (
Iq*)anIq;
Handle the given info-query object.
- Declared in:
- Dispatcher.h
- Conforms to:
- NSObject
Formal protocol for handling messages.
Method summary
- (void)
handleMessage: (
Message*)aMessage;
Handle the given message object.
- Declared in:
- Dispatcher.h
- Conforms to:
- NSObject
Formal protocol for handling presence stanzas.
Method summary
- (void)
handlePresence: (
Presence*)aPresence;
Handle the given presence object.