Package | org.igniterealtime.xiff.core |
Class | public class XMPPConnection |
Inheritance | XMPPConnection ![]() |
Implements | IXMPPConnection |
Subclasses | XMPPBOSHConnection, XMPPTLSConnection |
Property | Defined by | ||
---|---|---|---|
compress : Boolean
Shall the zlib compression be allowed if the server supports it.
| XMPPConnection | ||
domain : String
The XMPP domain to use with the server.
| XMPPConnection | ||
ignoreWhitespace : Boolean
Determines whether whitespace will be ignored on incoming XML data.
| XMPPConnection | ||
incomingBytes : uint [read-only]
Get the count of the received bytes.
| XMPPConnection | ||
jid : UnescapedJID
[read-only]
Gets the fully qualified unescaped JID of the user.
| XMPPConnection | ||
openConnections : Array [static][read-only]
Reference to all active connections.
| XMPPConnection | ||
outgoingBytes : uint [read-only]
Get the count of current bytes sent by this connection
| XMPPConnection | ||
password : String
The password to use when logging in.
| XMPPConnection | ||
port : uint
The port to use when connecting.
| XMPPConnection | ||
queuePresences : Boolean
Should the connection queue presence events for a small interval so that it can send multiple in a batch?
| XMPPConnection | ||
resource : String
The resource to use when logging in.
| XMPPConnection | ||
server : String
The XMPP server to use for connection.
| XMPPConnection | ||
useAnonymousLogin : Boolean
Whether to use anonymous login or not.
| XMPPConnection | ||
username : String
The username to use for connection.
| XMPPConnection |
Property | Defined by | ||
---|---|---|---|
active : Boolean | XMPPConnection | ||
_server : String
Server to connect, could be different of the login domain.
| XMPPConnection | ||
socket : Socket
Binary socket used to connect to the XMPP server.
| XMPPConnection |
Method | Defined by | ||
---|---|---|---|
Constructor.
| XMPPConnection | ||
changePassword(password:String):void
Changes the user's account password on the server.
| XMPPConnection | ||
connect(streamType:uint = 0):Boolean
Connects to the server.
| XMPPConnection | ||
disableSASLMechanism(name:String):void
[static]
Remove a SASL mechanism.
| XMPPConnection | ||
disconnect():void
Disconnects from the server if currently connected.
| XMPPConnection | ||
getRegistrationFields():void
Issues a request for the information that must be submitted for registration with the server.
| XMPPConnection | ||
isActive():Boolean
Determines whether the connection with the server is currently active.
| XMPPConnection | ||
isLoggedIn():Boolean
Determines whether the user is connected and logged into the server.
| XMPPConnection | ||
registerSASLMechanism(name:String, authClass:Class):void
[static]
Add a SASL mechanism.
| XMPPConnection | ||
send(data:IXMPPStanza):void
Sends data to the server.
| XMPPConnection | ||
sendKeepAlive():void
Sends ping to server in order to keep the connection alive.
| XMPPConnection | ||
sendRegistrationFields(fieldMap:Object, key:String):void
Registers a new account with the server, sending the registration data as specified in the fieldMap
| XMPPConnection |
Event | Summary | Defined by | ||
---|---|---|---|---|
Dispatched when a password change is successful. | XMPPConnection | |||
Dispatched when the connection is successfully made to the server. | XMPPConnection | |||
Dispatched when there is a disconnection from the server. | XMPPConnection | |||
Dispatched when there is some type of XMPP error. | XMPPConnection | |||
Dispatched whenever there is incoming XML data. | XMPPConnection | |||
Dispatched on successful authentication (login) with the server. | XMPPConnection | |||
Dispatched on incoming messages. | XMPPConnection | |||
Dispatched whenever data is sent to the server. | XMPPConnection | |||
Dispatched on incoming presence data. | XMPPConnection | |||
Dispatched on when new user account registration is successful. | XMPPConnection |
Constant | Defined by | ||
---|---|---|---|
STREAM_TYPE_FLASH : uint = 2 [static]
Stream type lets user set opening/closing tag.
| XMPPConnection | ||
STREAM_TYPE_FLASH_TERMINATED : uint = 3 [static]
Stream type lets user set opening/closing tag.
| XMPPConnection | ||
STREAM_TYPE_STANDARD : uint = 0 [static]
Stream type lets user set opening/closing tag.
| XMPPConnection | ||
STREAM_TYPE_STANDARD_TERMINATED : uint = 1 [static]
Stream type lets user set opening/closing tag.
| XMPPConnection |
active | property |
active:Boolean
[read-write]Implementation
protected function get active():Boolean
protected function set active(value:Boolean):void
compress | property |
compress:Boolean
[read-write]Shall the zlib compression be allowed if the server supports it.
The default value is false
.
public function get compress():Boolean
public function set compress(value:Boolean):void
See also
domain | property |
domain:String
[read-write]The XMPP domain to use with the server.
Implementation public function get domain():String
public function set domain(value:String):void
ignoreWhitespace | property |
ignoreWhitespace:Boolean
[read-write]
Determines whether whitespace will be ignored on incoming XML data.
Behaves the same as XML.ignoreWhitespace
public function get ignoreWhitespace():Boolean
public function set ignoreWhitespace(value:Boolean):void
incomingBytes | property |
incomingBytes:uint
[read-only]Get the count of the received bytes.
Implementation public function get incomingBytes():uint
jid | property |
jid:UnescapedJID
[read-only]
Gets the fully qualified unescaped JID of the user.
A fully-qualified JID includes the resource. A bare JID does not.
To get the bare JID, use the bareJID
property of the UnescapedJID.
public function get jid():UnescapedJID
See also
openConnections | property |
openConnections:Array
[read-only]Reference to all active connections.
Implementation public static function get openConnections():Array
outgoingBytes | property |
outgoingBytes:uint
[read-only]Get the count of current bytes sent by this connection
Implementation public function get outgoingBytes():uint
password | property |
password:String
[read-write]The password to use when logging in.
Implementation public function get password():String
public function set password(value:String):void
port | property |
port:uint
[read-write]The port to use when connecting. The default XMPP port is 5222.
Implementation public function get port():uint
public function set port(value:uint):void
queuePresences | property |
queuePresences:Boolean
[read-write]Should the connection queue presence events for a small interval so that it can send multiple in a batch?
The default value is true To maintain original behavior -- has to be explicitly set to false to disable.
.
public function get queuePresences():Boolean
public function set queuePresences(value:Boolean):void
resource | property |
resource:String
[read-write]The resource to use when logging in. A resource is required (defaults to "XIFF") and allows a user to login using the same account simultaneously (most likely from multiple machines). Typical examples of the resource include "Home" or "Office" to indicate the user's current location.
Implementation public function get resource():String
public function set resource(value:String):void
_server | property |
protected var _server:String
Server to connect, could be different of the login domain.
server | property |
server:String
[read-write]The XMPP server to use for connection.
Implementation public function get server():String
public function set server(value:String):void
socket | property |
protected var socket:Socket
Binary socket used to connect to the XMPP server.
useAnonymousLogin | property |
useAnonymousLogin:Boolean
[read-write]Whether to use anonymous login or not.
Implementation public function get useAnonymousLogin():Boolean
public function set useAnonymousLogin(value:Boolean):void
username | property |
username:String
[read-write]
The username to use for connection. If this property is null when connect()
is called,
the class will fetch registration field data rather than attempt to login.
public function get username():String
public function set username(value:String):void
XMPPConnection | () | constructor |
public function XMPPConnection()
Constructor.
changePassword | () | method |
public function changePassword(password:String):void
Changes the user's account password on the server. If the password change is successful,
the class will broadcast a ChangePasswordSuccessEvent.PASSWORD_SUCCESS
event.
password:String — The new password
|
connect | () | method |
public function connect(streamType:uint = 0):Boolean
Connects to the server. Use one of the STREAM_TYPE_.. constants. Possible options are:
streamType:uint (default = 0 ) — Any of the STREAM_TYPE_.. constants.
|
Boolean — A boolean indicating whether the server was found.
|
disableSASLMechanism | () | method |
public static function disableSASLMechanism(name:String):void
Remove a SASL mechanism.
Parametersname:String |
disconnect | () | method |
public function disconnect():void
Disconnects from the server if currently connected. After disconnect,
a DisconnectionEvent.DISCONNECT
event is broadcast.
See also
getRegistrationFields | () | method |
public function getRegistrationFields():void
Issues a request for the information that must be submitted for registration with the server.
When the data returns, a RegistrationFieldsEvent.REG_FIELDS
event is dispatched
containing the requested data.
isActive | () | method |
public function isActive():Boolean
Determines whether the connection with the server is currently active. (Not necessarily logged in.
For login status, use the isLoggedIn()
method.)
Boolean — A boolean indicating whether the connection is active.
|
See also
isLoggedIn | () | method |
public function isLoggedIn():Boolean
Determines whether the user is connected and logged into the server.
ReturnsBoolean — A boolean indicating whether the user is logged in.
|
See also
registerSASLMechanism | () | method |
public static function registerSASLMechanism(name:String, authClass:Class):void
Add a SASL mechanism.
Parametersname:String |
|
authClass:Class |
send | () | method |
public function send(data:IXMPPStanza):void
Sends data to the server. If the data to send cannot be serialized properly,
this method throws a SerializeException
.
data:IXMPPStanza — The data to send. This must be an instance of a class that implements the ISerializable interface.
|
See also
sendKeepAlive | () | method |
public function sendKeepAlive():void
Sends ping to server in order to keep the connection alive.
sendRegistrationFields | () | method |
public function sendRegistrationFields(fieldMap:Object, key:String):void
Registers a new account with the server, sending the registration data as specified in the fieldMap
ParametersfieldMap:Object — An object map containing the data to use for registration. The map should be composed of
attribute:value pairs for each registration data item.
|
|
key:String — (Optional) If a key was passed in the "data" field of the "registrationFields" event,
that key must also be passed here.
required field needed for registration.
|
changePasswordSuccess | event |
org.igniterealtime.xiff.events.ChangePasswordSuccessEvent
Dispatched when a password change is successful.
connection | event |
org.igniterealtime.xiff.events.ConnectionSuccessEvent
Dispatched when the connection is successfully made to the server.
disconnection | event |
org.igniterealtime.xiff.events.DisconnectionEvent
Dispatched when there is a disconnection from the server.
error | event |
org.igniterealtime.xiff.events.XIFFErrorEvent
Dispatched when there is some type of XMPP error.
incomingData | event |
org.igniterealtime.xiff.events.IncomingDataEvent
Dispatched whenever there is incoming XML data.
login | event |
org.igniterealtime.xiff.events.LoginEvent
Dispatched on successful authentication (login) with the server.
message | event |
outgoingData | event |
org.igniterealtime.xiff.events.OutgoingDataEvent
Dispatched whenever data is sent to the server.
presence | event |
org.igniterealtime.xiff.events.PresenceEvent
Dispatched on incoming presence data.
registrationSuccess | event |
org.igniterealtime.xiff.events.RegistrationSuccessEvent
Dispatched on when new user account registration is successful.
STREAM_TYPE_FLASH | constant |
public static const STREAM_TYPE_FLASH:uint = 2
Stream type lets user set opening/closing tag.
<flash:stream>
STREAM_TYPE_FLASH_TERMINATED | constant |
public static const STREAM_TYPE_FLASH_TERMINATED:uint = 3
Stream type lets user set opening/closing tag.
<flash:stream />
STREAM_TYPE_STANDARD | constant |
public static const STREAM_TYPE_STANDARD:uint = 0
Stream type lets user set opening/closing tag.
<stream:stream>
STREAM_TYPE_STANDARD_TERMINATED | constant |
public static const STREAM_TYPE_STANDARD_TERMINATED:uint = 1
Stream type lets user set opening/closing tag.
<stream:stream />