StropheCappuccino API 1.0.0
TNStropheConnection Class Reference

#import <TNStropheConnection.h>

List of all members.

Public Member Functions

(int) - connectionTimeout [implementation]
(void) - connectWithJID:andPassword: [implementation]
(id) - currentStatus [implementation]
(id) - delegate [implementation]
(void) - deleteAllRegisteredSelectors [implementation]
(void) - deleteRegisteredSelector: [implementation]
(void) - deleteRegisteredTimedSelector: [implementation]
(void) - disconnect [implementation]
(void) - encodeWithCoder: [implementation]
(void) - flush [implementation]
(CPString) - getUniqueId [implementation]
(CPString) - getUniqueIdWithSuffix: [implementation]
(float) - giveupTimeout [implementation]
(id) - initWithCoder: [implementation]
(id) - initWithService:andDelegate: [implementation]
(BOOL) - isConnected [implementation]
(TNStropheJID- JID [implementation]
(int) - maxConnections [implementation]
(CPString) - password [implementation]
(void) - pause [implementation]
(void) - performSend: [implementation]
(void) - rawInputRegisterSelector:ofObject: [implementation]
(void) - rawOutputRegisterSelector:ofObject: [implementation]
(id) - registerSelector:ofObject:withDict: [implementation]
(id) - registerSelector:ofObject:withDict:handlerDelegate: [implementation]
(id) - registerSelector:ofObject:withDict:userInfo: [implementation]
(id) - registerSelector:ofObject:withDict:userInfo:handlerDelegate: [implementation]
(id) - registerTimeoutSelector:ofObject:withDict:forTimeout: [implementation]
(void) - removeRawInputSelector [implementation]
(void) - removeRawOutputSelector [implementation]
(void) - reset [implementation]
(void) - resume [implementation]
(void) - send: [implementation]
(void) - setConnectionTimeout: [implementation]
(void) - setGiveupTimeout: [implementation]
(void) - setMaxConnections: [implementation]
(void) - setPassword: [implementation]
(void) - triggerStropheTimer: [implementation]

Static Public Member Functions

(void) + addNamespaceWithName:value: [implementation]
(TNStropheConnection+ connectionWithService:andDelegate: [implementation]

Detailed Description

this is an Cappuccino implementation of an XMPP connection using javascript library Strophe by Stanziq.

Delegate Methods

-onStropheConnecting: when strophe is connecting (notification TNStropheConnectionStatusConnectingNotification sent)

-onStropheConnectFail: if strophe connection fails (notification TNStropheConnectionStatusFailure sent)

-onStropheDisconnecting when strophe is disconnecting (notification TNStropheConnectionStatusDisconnectingNotification sent)

-onStropheConnected: when strophe is disconnected (notification TNStropheConnectionStatusDisconnectedNotification sent)

-onStropheConnecting: when strophe is connected (notification TNStropheConnectionStatusConnectedNotification sent)

Notifications:

The following notifications are sent by TNStropheConnection:

TNStropheConnectionStatusConnectingNotification

TNStropheConnectionStatusConnectedNotification

TNStropheConnectionStatusDisconnectingNotification

TNStropheConnectionStatusDisconnectedNotification

TNStropheConnectionStatusConnectionFailureNotification

# TNStropheConnectionStatusAuthFailureNotification

TNStropheConnectionStatusErrorNotification

Definition at line 2 of file TNStropheConnection.h.


Member Function Documentation

+ (void) addNamespaceWithName: (CPString)  aName
value: (CPString)  aValue 
[implementation]

Definition at line 101 of file TNStropheConnection.j.

- (int) connectionTimeout [implementation]

Synthesized accessor method.

Definition at line 721 of file TNStropheConnection.j.

+ (TNStropheConnection) connectionWithService: (CPString)  aService
andDelegate: (id)  aDelegate 
[implementation]

instanciate a TNStropheConnection object

Parameters:
aServicea url of a bosh service (MUST be complete url with http://)
Returns:
a valid TNStropheConnection

Definition at line 112 of file TNStropheConnection.j.

- (void) connectWithJID: (TNStropheJID aJID
andPassword: (CPString)  aPassword 
[implementation]

connect to the XMPP Bosh Service. on different events, messages are sent to delegate and notification are sent

Definition at line 199 of file TNStropheConnection.j.

- (id) currentStatus [implementation]

Synthesized accessor method.

Definition at line 705 of file TNStropheConnection.j.

- (id) delegate [implementation]

Synthesized accessor method.

Definition at line 713 of file TNStropheConnection.j.

- (void) deleteAllRegisteredSelectors [implementation]

unrgister all registered selectors (including timeouted ones)

Definition at line 576 of file TNStropheConnection.j.

- (void) deleteRegisteredSelector: (id)  aHandlerId [implementation]

delete a registered selector

Parameters:
aHandlerIdthe handler id to remove

Definition at line 559 of file TNStropheConnection.j.

- (void) deleteRegisteredTimedSelector: (id)  aTimedHandlerId [implementation]

delete a registered timed selector

Parameters:
aHandlerIdthe handler id to remove

Definition at line 568 of file TNStropheConnection.j.

- (void) disconnect [implementation]

this disconnect the XMPP connection

Definition at line 289 of file TNStropheConnection.j.

- (void) encodeWithCoder: (CPCoder)  aCoder [implementation]

Definition at line 650 of file TNStropheConnection.j.

- (void) flush [implementation]

Immediately send any pending outgoing data

Definition at line 324 of file TNStropheConnection.j.

- (CPString) getUniqueId [implementation]

generates an unique identifier

Definition at line 358 of file TNStropheConnection.j.

- (CPString) getUniqueIdWithSuffix: (CPString)  suffix [implementation]

generates an unique identifier prefixed by

Parameters:
prefixwill prefixes the unique identifier

Definition at line 367 of file TNStropheConnection.j.

- (float) giveupTimeout [implementation]

Synthesized accessor method.

Definition at line 689 of file TNStropheConnection.j.

- (id) initWithCoder: (CPCoder)  aCoder [implementation]

Definition at line 634 of file TNStropheConnection.j.

- (id) initWithService: (CPString)  aService
andDelegate: (id)  aDelegate 
[implementation]

initialize the TNStropheConnection

Parameters:
aServicea url of a bosh service (MUST be complete url with http://)

Definition at line 125 of file TNStropheConnection.j.

- (BOOL) isConnected [implementation]

Synthesized accessor method.

Definition at line 665 of file TNStropheConnection.j.

- (TNStropheJID) JID [implementation]

Definition at line 189 of file TNStropheConnection.j.

- (int) maxConnections [implementation]

Synthesized accessor method.

Definition at line 737 of file TNStropheConnection.j.

- (CPString) password [implementation]

Synthesized accessor method.

Definition at line 673 of file TNStropheConnection.j.

- (void) pause [implementation]

pause the current connection

Definition at line 308 of file TNStropheConnection.j.

- (void) performSend: (TNStropheStanza aStanza [implementation]

Definition at line 351 of file TNStropheConnection.j.

- (void) rawInputRegisterSelector: (SEL)  aSelector
ofObject: (id)  anObject 
[implementation]

register a selector to listen every incoming data

Parameters:
aSelectorthe selector to call
thetarget of the message

Definition at line 591 of file TNStropheConnection.j.

- (void) rawOutputRegisterSelector: (SEL)  aSelector
ofObject: (id)  anObject 
[implementation]

register a selector to listen every outgoing data

Parameters:
aSelectorthe selector to call
thetarget of the message

Definition at line 613 of file TNStropheConnection.j.

- (id) registerSelector: (SEL)  aSelector
ofObject: (CPObject)  anObject
withDict: (id)  aDict 
[implementation]

allows to register a selector for beeing fired on XMPP events, according to the content of a dictionnary parameter. The dictionnary should contains zero to many of the followings :

  • namespace: the namespace of the stanza or of the first child (like query)
  • name: the name of the stanza (message, iq or presence)
  • type: the type of the stanza
  • id: the unique identifier
  • from: the stanza sender
  • options: an array of options. only {MatchBare: True} works. if all the conditions are mets, the selector is fired and the stanza is given as parameter.

The selector should return YES to not be unregistered. If it returns NO or nothing, it will be unregistered

Parameters:
aSelectorthe selector to be performed
anObjectthe receiver of the selector
aDicta dictionnary of parameters
Returns:
an id of the handler registration used to remove it

Definition at line 509 of file TNStropheConnection.j.

- (id) registerSelector: (SEL)  aSelector
ofObject: (CPObject)  anObject
withDict: (id)  aDict
handlerDelegate: (id)  aHandlerDelegate 
[implementation]

allows to register a selector for beeing fired on XMPP events, according to the content of a dictionnary parameter. The dictionnary should contains zero to many of the followings :

  • namespace: the namespace of the stanza or of the first child (like query)
  • name: the name of the stanza (message, iq or presence)
  • type: the type of the stanza
  • id: the unique identifier
  • from: the stanza sender
  • options: an array of options. only {MatchBare: True} works. if all the conditions are mets, the selector is fired and the stanza is given as parameter.

The selector should return YES to not be unregistered. If it returns NO or nothing, it will be unregistered

Parameters:
aSelectorthe selector to be performed
anObjectthe receiver of the selector
aDicta dictionnary of parameters
handlerDelegatea temp delegate that can implement stropheConnection:performedHandlerId:
Returns:
an id of the handler registration used to remove it

Definition at line 460 of file TNStropheConnection.j.

- (id) registerSelector: (SEL)  aSelector
ofObject: (CPObject)  anObject
withDict: (id)  aDict
userInfo: (id)  someUserInfo 
[implementation]

allows to register a selector for beeing fired on XMPP events, according to the content of a dictionnary parameter. The dictionnary should contains zero to many of the followings :

  • namespace: the namespace of the stanza or of the first child (like query)
  • name: the name of the stanza (message, iq or presence)
  • type: the type of the stanza
  • id: the unique identifier
  • from: the stanza sender
  • options: an array of options. only {MatchBare: True} works. if all the conditions are mets, the selector is fired and the stanza is given as parameter.

The selector should return YES to not be unregistered. If it returns NO or nothing, it will be unregistered

Parameters:
aSelectorthe selector to be performed
anObjectthe receiver of the selector
aDicta dictionnary of parameters
someUserInfouser infos
Returns:
an id of the handler registration used to remove it

Definition at line 485 of file TNStropheConnection.j.

- (id) registerSelector: (SEL)  aSelector
ofObject: (CPObject)  anObject
withDict: (id)  aDict
userInfo: (id)  someUserInfo
handlerDelegate: (id)  aHandlerDelegate 
[implementation]

allows to register a selector for beeing fired on XMPP events, according to the content of a dictionnary parameter. The dictionnary should contains zero to many of the followings :

  • namespace: the namespace of the stanza or of the first child (like query)
  • name: the name of the stanza (message, iq or presence)
  • type: the type of the stanza
  • id: the unique identifier
  • from: the stanza sender
  • options: an array of options. only {MatchBare: True} works. if all the conditions are mets, the selector is fired and the stanza is given as parameter.

The selector should return YES to not be unregistered. If it returns NO or nothing, it will be unregistered

Parameters:
aSelectorthe selector to be performed
anObjectthe receiver of the selector
aDicta dictionnary of parameters
someUserInfouser infos
handlerDelegatea temp delegate that can implement stropheConnection:performedHandlerId:
Returns:
an id of the handler registration used to remove it

Definition at line 397 of file TNStropheConnection.j.

- (id) registerTimeoutSelector: (SEL)  aTimeoutSelector
ofObject: (CPObject)  anObject
withDict: (id)  aDict
forTimeout: (float)  aTimeout 
[implementation]

Registred selector will be performed if the stanza response is not received after a given amout of time. The selector will be performed at every timeout interval until it returns NO.

Parameters:
aTimeoutSelectorthe selector to be performed if stanza timeouts
anObjectthe receiver of the selector
aDicta dictionnary of parameters
timeoutfloat timeout of the handler
Returns:
an id of the handler registration used to remove it

Definition at line 524 of file TNStropheConnection.j.

- (void) removeRawInputSelector [implementation]

remove incoming data listener

Definition at line 601 of file TNStropheConnection.j.

- (void) removeRawOutputSelector [implementation]

remove outgoing data listener

Definition at line 623 of file TNStropheConnection.j.

- (void) reset [implementation]

Reset the current connection

Definition at line 300 of file TNStropheConnection.j.

- (void) resume [implementation]

resume the current connection if paused

Definition at line 316 of file TNStropheConnection.j.

- (void) send: (TNStropheStanza aStanza [implementation]

send a TNStropheStanza object

Parameters:
aStanza,:the stanza to send

Definition at line 341 of file TNStropheConnection.j.

- (void) setConnectionTimeout: (int)  aValue [implementation]

Synthesized accessor method.

Definition at line 729 of file TNStropheConnection.j.

- (void) setGiveupTimeout: (float)  aValue [implementation]

Synthesized accessor method.

Definition at line 697 of file TNStropheConnection.j.

- (void) setMaxConnections: (int)  aValue [implementation]

Synthesized accessor method.

Definition at line 745 of file TNStropheConnection.j.

- (void) setPassword: (CPString)  aValue [implementation]

Synthesized accessor method.

Definition at line 681 of file TNStropheConnection.j.

- (void) triggerStropheTimer: (CPTimer)  aTimer [implementation]

computer the stropheJS timers

Parameters:
aTimerthe timer that have sent the event

Definition at line 178 of file TNStropheConnection.j.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables