Packageorg.igniterealtime.xiff.core
Classpublic class XMPPTLSConnection
InheritanceXMPPTLSConnection Inheritance XMPPConnection Inheritance flash.events.EventDispatcher
Implements IXMPPConnection

This class is used to connect to and manage data coming from an XMPP server that supports TLS. Use one instance of this class per connection.

See also

http://tools.ietf.org/html/rfc3920#section-5


Public Properties
 PropertyDefined By
 Inheritedactive : Boolean
Determines whether the connection with the server is currently active.
XMPPConnection
 Inheritedcompress : Boolean
Shall the Stream Compression be allowed if the server supports it.
XMPPConnection
 Inheritedcompressor : ICompressor
The class that is to be used for Stream Compression if enabled.
XMPPConnection
  config : TLSConfig
TLS configuration.
XMPPTLSConnection
 Inheriteddomain : String
The XMPP domain to use with the server.
XMPPConnection
 InheritedincomingBytes : uint
[read-only] Get the total count of the received bytes in the current session.
XMPPConnection
 Inheritedjid : UnescapedJID
[read-only] Gets the fully qualified unescaped JID of the user.
XMPPConnection
 InheritedloggedIn : Boolean
Determines whether the user is connected and logged into the server.
XMPPConnection
 InheritedopenConnections : Array
[static] [read-only] Reference to all active connections.
XMPPConnection
 InheritedoutgoingBytes : uint
[read-only] Get the total count of the bytes sent in the current session.
XMPPConnection
 Inheritedpassword : String
The password to use when logging in.
XMPPConnection
 Inheritedport : uint
The port to use when connecting.
XMPPConnection
 InheritedqueuePresences : Boolean
Should the connection queue presence events for a small interval so that it can send multiple in a batch?
XMPPConnection
 InheritedregistrationSupported : Boolean
[read-only] Does the connection support registration.
XMPPConnection
 Inheritedresource : String
The resource to use when logging in.
XMPPConnection
 Inheritedserver : String
The XMPP server to use for connection.
XMPPConnection
  tls : Boolean
Specifies whether to enable TLS.
XMPPTLSConnection
 InheriteduseAnonymousLogin : Boolean
Whether to use anonymous login or not.
XMPPConnection
 Inheritedusername : String
The username to use for connection.
XMPPConnection
Protected Properties
 PropertyDefined By
 InheritedclosingStreamTag : String
Depending of the STREAM_TYPE_used in the connect() method, this variable will contain a matching closing element for it.
XMPPConnection
 Inherited_compressor : ICompressor = null
Static class that is used to handle the compression
XMPPConnection
 InheritedexpireTagSearch : Boolean = false
Once received data from the socket, should the closing tag be seached? Initially this should be true as for the first incoming data there might be an error available.
XMPPConnection
 InheritedfeaturesAvailable : XML
Features as provided by the server, in their original XML form.
XMPPConnection
 InheritedopeningStreamTag : String
Opening part of the stream tag, such as <stream:stream or <flash:stream
XMPPConnection
 InheritedpendingIQs : Object
Hash to hold callbacks for IQs
XMPPConnection
 InheritedpingNotSupported : Boolean
Server supports keeping the connection alive with Ping extension
XMPPConnection
 InheritedpresenceQueue : Array
List of incoming presences that are waiting to be dispatched
XMPPConnection
 Inherited_registrationSupported : Boolean = false
XMPPConnection
 Inherited_server : String
Server to connect, could be different of the login domain.
XMPPConnection
 Inheritedsocket : Socket
Binary socket used to connect to the XMPP server.
XMPPConnection
 InheritedstreamTagSearch : String = stream:stream
Depending of the STREAM_TYPE_used in the connect() method, the name of the opening tag for stream is saved in this variable, such as stream:stream or flash:stream.
XMPPConnection
 InheritedtlsEnabled : Boolean = false
XMPPConnection
 InheritedtlsRequired : Boolean = false
Even if this class is not implementing TLS, it needs to be aware if it has been extended by XMPPTLSConnection that will set this value to true.
XMPPConnection
Public Methods
 MethodDefined By
  
Constructor.
XMPPTLSConnection
  
connect(streamType:uint = 0):void
[override]
XMPPTLSConnection
 Inherited
disableExtensions(... exts):void
Disable the given extensions from the registery.
XMPPConnection
 Inherited
disableSASLMechanism(name:String):void
Remove a SASL mechanism from this connection
XMPPConnection
  
disconnect():void
[override]
XMPPTLSConnection
 Inherited
enableExtensions(... exts):void
Enable the given extensions for interacting with the incoming data.
XMPPConnection
 Inherited
enableSASLMechanism(name:String, authClass:Class):void
Add a SASL mechanism available for this connection
XMPPConnection
 Inherited
send(data:IXMPPStanza):void
Sends data to the server.
XMPPConnection
 Inherited
Sends ping to server in order to keep the connection alive, in case the server has not indicated that it would not support it.
XMPPConnection
Protected Methods
 MethodDefined By
 Inherited
SASL Authentication should been set up, begin the authentication process by sending the initial request.
XMPPConnection
 Inherited
Upon being so informed that resource binding is required, the client MUST bind a resource to the stream by sending to the server an IQ stanza of type "set" (see IQ Semantics (Section 9.2.3)) containing data qualified by the 'urn:ietf:params:xml:ns:xmpp-bind' namespace.
XMPPConnection
 Inherited
checkIncomingData(bytedata:ByteArray):XML
Check if the incoming data is complete once added to any existing incoming data.
XMPPConnection
 Inherited
chooseStreamTags(type:uint):void
Choose the stream start and ending tags based on the given type.
XMPPConnection
 Inherited
configureAuthMechanisms(mechanisms:XML):void
Use the authentication which is first in the list (saslMechanisms) if possible.
XMPPConnection
 Inherited
configureStreamCompression(method:String = zlib):void
Zlib is the most common and the one which is required to be implemented in case Stream Compression is used.
XMPPConnection
  
XMPPTLSConnection
 Inherited
Set up the connection and listeners related to this class.
XMPPConnection
 Inherited
dispatchError(condition:String, message:String, type:String, code:int = 0, extension:Extension = null):void
XMPPConnection
 Inherited
Runs after binding
XMPPConnection
 Inherited
flushPresenceQueue(event:TimerEvent):void
Dispatches a single PresenceEvent in case there are any in the queue.
XMPPConnection
 Inherited
handleAuthentication(response:XML):void
Upon receiving a success indication within the SASL negotiation, the client MUST send a new stream header to the server, to which the server MUST respond with a stream header as well as a list of available stream features.
XMPPConnection
 Inherited
handleMessage(node:XML):void
TODO: Add similar extension handling as in IQ, after message specific extensions are separated from Message class, v3.2.0
XMPPConnection
  
handleNodeType(node:XML):void
[override] Calls a appropriate parser base on the nodeName.
XMPPTLSConnection
 Inherited
Handle the incoming Presence either with the queue timer or directly dispatching the PresenceEvent.
XMPPConnection
 Inherited
handleStream(node:XML):void
Initial stream element has been received once this method is called.
XMPPConnection
 Inherited
handleStreamError(node:XML):void
Handle stream error related element.
XMPPConnection
 Inherited
handleStreamFeatures(node:XML):void
Handle features that are available in the connected server.
XMPPConnection
  
handleStreamTLS(node:XML):void
[override] In case the user or the server requires the use of TLS, this method will initiate the handshake.
XMPPTLSConnection
 Inherited
onIOError(event:IOErrorEvent):void
This fires the standard dispatchError method
XMPPConnection
 Inherited
parseDataReceived(bytedata:ByteArray):void
Parses the data which the socket just received.
XMPPConnection
 Inherited
Remove those listeners that the createConnection method added.
XMPPConnection
  
Remove those listeners that the configureTLSSocket method added.
XMPPTLSConnection
 Inherited
sendData(data:String):void
Dispatches OutgoingDataEvent, handles possible Stream Compression and calls sendDataToServer.
XMPPConnection
 Inherited
sendDataToServer(data:ByteArray):void
Overwrite this method to use other kind of socket, request or connection, if needed.
XMPPConnection
 Inherited
sendXML(data:String):void
Pass through to sendData which takes care of the common data handling between all connection classes.
XMPPConnection
 Inherited
Send a response to the Service Discovery query.
XMPPConnection
Events
 Event Summary Defined By
 Inherited
Dispatched on incoming IQ data that has an enabled extension.XMPPConnection
 InheritedDispatched when the connection is successfully made to the server.XMPPConnection
 InheritedDispatched when there is a disconnection from the server.XMPPConnection
 InheritedDispatched when there is some type of XMPP error.XMPPConnection
 InheritedDispatched whenever there is incoming XML data.XMPPConnection
 InheritedDispatched on successful authentication (login) with the server.XMPPConnection
 InheritedDispatched on incoming messages.XMPPConnection
 InheritedDispatched whenever data is sent to the server.XMPPConnection
 InheritedDispatched on incoming presence data.XMPPConnection
Public Constants
 ConstantDefined By
 InheritedSTREAM_TYPE_FLASH : uint = 2
[static] Stream type lets user set opening/closing tag.
XMPPConnection
 InheritedSTREAM_TYPE_FLASH_TERMINATED : uint = 3
[static] Stream type lets user set opening/closing tag.
XMPPConnection
 InheritedSTREAM_TYPE_STANDARD : uint = 0
[static] Stream type lets user set opening/closing tag.
XMPPConnection
 InheritedSTREAM_TYPE_STANDARD_TERMINATED : uint = 1
[static] Stream type lets user set opening/closing tag.
XMPPConnection
Protected Constants
 ConstantDefined By
 InheritedsaslMechanisms : Object
The types of SASL mechanisms available.
XMPPConnection
Property Detail
configproperty
config:TLSConfig

TLS configuration.


Implementation
    public function get config():TLSConfig
    public function set config(value:TLSConfig):void
tlsproperty 
tls:Boolean

Specifies whether to enable TLS.

The default value is false.


Implementation
    public function get tls():Boolean
    public function set tls(value:Boolean):void
Constructor Detail
XMPPTLSConnection()Constructor
public function XMPPTLSConnection()

Constructor.

The connection socket created in XMPPConnection is used until the server responds as "proceed".

Method Detail
configureTLSSocket()method
protected function configureTLSSocket():void

See also

com.hurlant.crypto.tls.TLSSocket
connect()method 
override public function connect(streamType:uint = 0):void

Parameters

streamType:uint (default = 0)

disconnect()method 
override public function disconnect():void

handleNodeType()method 
override protected function handleNodeType(node:XML):void

Calls a appropriate parser base on the nodeName.

Parameters

node:XML

handleStreamTLS()method 
override protected function handleStreamTLS(node:XML):void

In case the user or the server requires the use of TLS, this method will initiate the handshake.

Parameters

node:XML

removeTLSSocketEventListeners()method 
protected function removeTLSSocketEventListeners():void

Remove those listeners that the configureTLSSocket method added.