org.jivesoftware.xiff.data

class XMPPStanza

Object | +--org.jivesoftware.xiff.data.XMLStanza | +--org.jivesoftware.xiff.data.XMPPStanza
Implemented Interfaces: IExtendable, ISerializableAll Known Subclasses: IQ, Message, Presence

class XMPPStanza extends XMLStanza
The base class for all XMPP stanza data classes.
  • Author:
    Sean Voisen
  • Since:
    2.0.0

Field Summary

public static CLIENT_NS: String
Fields inherited from class org.jivesoftware.xiff.data.XMLStanza

Property Summary

public errorCode: Number (read, write)
The error code, assuming this stanza contains error information. Error codes are deprecated in standard XMPP, but they are commonly used by older Jabber servers like Jabberd 1.4. For more information on error codes, and corresponding error conditions, see http://www.jabber.org/jeps/jep-0086.html.
public errorCondition: String (read, write)
The error condition, assuming this stanza contains error information. For more information on error conditions, see http://www.jabber.org/jeps/jep-0086.html.
public errorMessage: String (read, write)
The error message, assuming this stanza contains error information.
public errorType: String (read, write)
The error type, assuming this stanza contains error information. For more information on error types, see http://www.jabber.org/jeps/jep-0086.html.
public from: String (read, write)
The JID of the sender. Most, if not all, server implementations follow the specifications that prevent this from being falsified. Thus, under normal circumstances, you don't need to supply this information because the server will fill it in automatically.
public id: String (read, write)
The unique identifier of this stanza. ID generation is accomplished using the static generateID method.
public to: String (read, write)
The JID of the recipient.
public type: String (read, write)
The stanza type. There are MANY types available, depending on what kind of stanza this is. The XIFF Library defines the types for IQ, Presence, and Message in each respective class as static string variables. Below is a listing of each: IQ
  • IQ.SET_TYPE
  • IQ.GET_TYPE
  • IQ.RESULT_TYPE
  • IQ.ERROR_TYPE
Presence
  • Presence.AVAILABLE_TYPE
  • Presence.UNAVAILABLE_TYPE
  • Presence.PROBE_TYPE
  • Presence.SUBSCRIBE_TYPE
  • Presence.UNSUBSCRIBE_TYPE
  • Presence.SUBSCRIBED_TYPE
  • Presence.UNSUBSCRIBED_TYPE
  • Presence.ERROR_TYPE
Message
  • Message.NORMAL_TYPE
  • Message.CHAT_TYPE
  • Message.GROUPCHAT_TYPE
  • Message.HEADLINE_TYPE
  • Message.ERROR_TYPE

Constructor

public XMPPStanza ( recipient: String, sender: String, theType: String, theID: String, nName: String)

Method Summary

public addExtension ( extension: IExtension ): IExtension
These are added by the ExtensionContainer decoration
public deserialize ( xmlNode: XMLNode ): Boolean
Called when data is retrieved from the XMLSocket, use this method to extract any state into internal state.
public static generateID ( prefix: String ): String
(Static method) Generates a unique ID for the stanza. ID generation is handled using a variety of mechanisms, but the default for the library uses the IncrementalGenerator.
public getAllExtensions ( ): Array
public getAllExtensionsByNS ( namespace: String ): Array
public removeAllExtensions ( namespace: String ): Void
public removeExtension ( extension: IExtension ): Boolean
public serialize ( parentNode: XMLNode ): Boolean
Prepares the XML version of the stanza for transmission to the server.
public static setIDGenerator ( generator: IIDGenerator ): Void
(Static method) Sets the ID generator for this stanza type. ID generators must implement the IIDGenerator interface. The XIFF library comes with a few default ID generators that have already been implemented (see org.jivesoftware.xiff.data.id.*). Setting the ID generator by stanza type is useful if you'd like to use different ID generation schemes for each type. For instance, messages could use the incremental ID generation scheme provided by the IncrementalGenerator class, while IQs could use the shared object ID generation scheme provided by the SharedObjectGenerator class.
Methods inherited from class org.jivesoftware.xiff.data.XMLStanza

Field Documentation

CLIENT_NS

public static var CLIENT_NS: String

    Property Documentation


    Constructor Documentation

    XMPPStanza

    public function XMPPStanza (
    recipient: String,
    sender: String,
    theType: String,
    theID: String,
    nName: String)

      Method Documentation

      getAllExtensions

      public function getAllExtensions (
      ): Array

      getAllExtensionsByNS

      public function getAllExtensionsByNS (
      namespace: String): Array

      removeAllExtensions

      public function removeAllExtensions (
      namespace: String): Void
      The documentation was generated from the following file:
      • XMPPStanza.as, Last Modified: 3/10/2005 10:16:46 PM