View Source

<ac:macro ac:name="info"><ac:parameter ac:name="title">Zend_Jabber</ac:parameter></ac:macro>

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[{zone-template-instance:ZFDEV:Zend Proposal Zone Template}

{zone-data:component-name}
Zend_Jabber
{zone-data}

{zone-data:proposer-list}
[Maciek Ruckgaber|mailto:maciekrb@gmail.com]
[Sergej Andrejev|mailto:sandrejev@gmail.com]
{zone-data}

{zone-data:revision}
1.0 - 21 July 2007: Ready for comments
{zone-data}

{zone-data:overview}
Zend_Jabber is a component allowing communication in Jabber/XMPP network.
{zone-data}

{zone-data:references}
* [RFC 3920|http://www.ietf.org/rfc/rfc3920.txt]
* [RFC 3921|http://www.ietf.org/rfc/rfc3921.txt]
* [XEP-0045|http://www.xmpp.org/extensions/xep-0045.html]
* [XEP-0073|http://www.xmpp.org/extensions/xep-0073.html]
* [Repository at google code|http://code.google.com/p/phpjabberlib/]
{zone-data}

{zone-data:requirements}
* This component *will* support all features required XEP-0073 ("Basic IM Protocol Suite")
* This component *will not* support features needed for back compability
* This component *may* be configured so that it will log sent/received messages
* This component *may* need a log file
* This component *will not* have a configuration file
* This component *will* be configured through parameters
{zone-data}

{zone-data:dependencies}
* Zend_Exception
{zone-data}

{zone-data:operation}
This component will allow to create send XMPP stanzas using Zend_Jabber class methods. There will also be two ways of receiving messages. User will be able to specify to wait until the response arrives or he can register a callback function wich will be executed when the response arrived. Look at a google code repository for source code.
{zone-data}

{zone-data:milestones}
* Milestone 1: Existing code will be ported to Zend Framework
* Milestone 2: API will be redefined as required
* Milestone 3: Working prototype checked into the incubator
* Milestone 4: Write unit tests for socket requests
* Milestone 5: Initial documentation exists.
{zone-data}

{zone-data:class-list}
Also those are not all classes. XMPP protocol is huge. These classes will be created in the first milestone. Look at google code repository for how things really works.

* Zend_Jabber
* Zend_Jabber_Connection
* Zend_Jabber_AddressBook
* Zend_Jabber_AddressBook_Group
* Zend_Jabber_AddressBook_Item
* Zend_Jabber_User
* Zend_Jabber_Stanza_Abstract
* Zend_Jabber_Stanza_Null
* Zend_Jabber_Stanza_Unknown
* Zend_Jabber_Response_Abstract
* Zend_Jabber_Response_Presence
* Zend_Jabber_Response_Iq_Abstract
* Zend_Jabber_Response_Iq_Error
* Zend_Jabber_Response_Iq_Bind_Abstract
* Zend_Jabber_Response_Iq_Bind_Error
* Zend_Jabber_Response_Iq_Bind_Result
* Zend_Jabber_Response_Iq_Register_Abstract
* Zend_Jabber_Response_Iq_Register_Error
* Zend_Jabber_Response_Iq_Register_Result
* Zend_Jabber_Response_Iq_Roster_Abstract
* Zend_Jabber_Response_Iq_Roster_Error
* Zend_Jabber_Response_Iq_Roster_Result
* Zend_Jabber_Response_Iq_Roster_Set
* Zend_Jabber_Response_Iq_Session_Abstract
* Zend_Jabber_Response_Iq_Session_Error
* Zend_Jabber_Response_Iq_Session_Result
* Zend_Jabber_Response_Message_Abstract
* Zend_Jabber_Response_Message_Chat
* Zend_Jabber_Response_Auth_Abstract
* Zend_Jabber_Response_Auth_Failure
* Zend_Jabber_Response_Auth_Success
* Zend_Jabber_Request_Abstract
* Zend_Jabber_Request_Auth
* Zend_Jabber_Request_Iq_Abstract
* Zend_Jabber_Request_Iq_Abstract
* Zend_Jabber_Request_Iq_Bind_Abstract
* Zend_Jabber_Request_Iq_Bind_Set
* Zend_Jabber_Request_Iq_Register_Abstract
* Zend_Jabber_Request_Iq_Register_Get
* Zend_Jabber_Request_Iq_Register_Set
* Zend_Jabber_Request_Iq_Roster_Abstract
* Zend_Jabber_Request_Iq_Roster_Get
* Zend_Jabber_Request_Iq_Roster_Set
* Zend_Jabber_Request_Iq_Session_Abstract
* Zend_Jabber_Request_Iq_Session_Set
* Zend_Jabber_Request_Message_Abstract
* Zend_Jabber_Request_Message_Set
* Zend_Jabber_Request_Presence_Abstract
* Zend_Jabber_Request_Presence_Normal
* Zend_Jabber_Request_Presence_Subscribe
* Zend_Jabber_Request_Presence_Unsubscribe
{zone-data}

{zone-data:use-cases}
||UC-01||
Send a message to anoother jabber user:
{code}
$jabber = new Zend_Jabber();
$jabber->connect('jabber.org');
$jabber->login(new Zend_Jabber_User("you@jabber.org/Gaim"), 'password');
$jabber->message(new Zend_Jabber_User("friend@jabber.org/Gaim"), 'test message');
$jabber->disconnect();
{code}

||UC-02||
Receive message and display it using callback function:
{code}
$jabber = new Zend_Jabber();
$jabber->connect('jabber.org');

function printMessage($response) {
echo $response->getBody();
}

$jabber->registerCallback("Message.Chat", "printMessage");

$jabber->login(new Zend_Jabber_User("you@jabber.org/Gaim"), 'password');

while($jabber->receive());
{code}


||UC-03||
Display address book:
{code}
$jabber = new Zend_Jabber();
$jabber->connect('jabber.org');
$jabber->login(new Zend_Jabber_User("you@jabber.org/Gaim"), 'password');

$addressBook = $jabber->getAddressBook();
$stringPresentation = "";
foreach($addressBook->getGroups() as $group) {
$stringPresentation .= $group->getName() . "\n";
foreach($group->getItems() as $item) {
$user = $item->getUser();
$stringPresentation .= " " . $user->getJid(false) . " - " . $item->getSubscription(). " - " . $user->getShow() . "\n";
}
}
{code}
{zone-data}

{zone-data:skeletons}
h5. Zend_Jabber_Exception
{code}
/**
* Specific jabber exception
*
* @package exception
*/
class Zend_Jabber_Exception extends Exception { }
{code}

h5. Zend_Jabber
{code}
/**
* Zend_Jabber is a main jabber client class
*
* This class manages user connection and address book. You can send requests through this class
* by registering a callback function witch will be executed when response arrives. You can also
* wait for particular response to arrive
*/
class Zend_Jabber {
/**
* Logged jabber user or null if user is not authorized or connection is not opened
*
* @var Zend_Jabber_User
*/
private $loggedUser;

/**
* Connection wrapper
*
* @var Zend_Jabber_Connection
*/
private $connection;

/**
* Registered callbacks
*
* @var array
*/
private $registeredCallbacks = array();

/**
* This variable is used when receiving response.
*
* When it is more than zero script wont wait for a response more than specified time. This
* variable is used to calculate how mutch time it pased since the countdown started
*
* @var integer
*/
private static $startTime = false;

/**
* Address book instance
*
* @var Zend_Jabber_AddressBook
*/
private $addressBook;

/**
* Create new Zend_Jabber object
*
* To connect to the server use connect method
*/
public function __construct() { }

/**
* Connect to Jabber server
*
* @param string $host Zend_Jabber server address
* @param string $port Zend_Jabber server port
* @param string $domain Zend_Jabber server domain name
*/
public function connect($host, $port = 5222, $domain = false) { }

/**
* Login with existing username and password
*
* @param string $username Your Zend_Jabber username
* @param string $password Your Zend_Jabber password
* @return Zend_Jabber_Stanza_Response_Auth
*/
public function login(Zend_Jabber_User $user, $password) { }

/**
* Get user address book local copy
*
* @return Zend_Jabber_AddressBook
*/
public function getAddressBook() { }

/**
* Send text message to another user
*
* @param Zend_Jabber_User $username Destination user
* @param string $message Message body
* @return Zend_Jabber_Stanza_Response_Message_Chat
*/
public function message(Zend_Jabber_User $user, $message) { }

/**
* Register new jabber user
*
* @param Zend_Jabber_User $user User
* @param string $password Password
* @return Zend_Jabber_Stanza_Response_IQ_Register_Set
*/
public function register(Zend_Jabber_User $user, $password) { }

/**
* Get loged user or false if user is not authenticated
*
* @return Zend_Jabber_User
*/
public function getLoggedUser() { }

/**
* Return true if user is successfully authenticated and false if not
*
* @return boolean
*/
public function isLoggedIn() { }

/**
* Synchronize presences with server
*
* Update your presence copy on the server and retreve other users presences
*/
public function updatePresence() { }

/**
* Ask user to allow you to see his presence
*
* @param Zend_Jabber_User $user Distant user
*/
public function subscribe(Zend_Jabber_User $user) { }

/**
* Deny user see your presence
*
* @param Zend_Jabber_User $user Distant user
*/
public function unsubscribe(Zend_Jabber_User $user) { }

/**
* Disconnect from server
*/
public function disconnect() { }

/**
* Receive response from server
*
* You can also pass two parameters. If you specify first parameter this method will drop
* all responses except until a response to a given request arrives. Second parameters is
* used only when request is specified. Passing $time you specify a limit to how much time
* program should wait for a response
*
* @param Zend_Jabber_Stanza_Request_Abstract $request If request is specified this function will return only when a response to specified request will arrive
* @param integer $time Wait no more than specified number of seconds (-1 to set no limit)
* @return Zend_Jabber_Stanza_Response_Abstract
*/
public function receive(Zend_Jabber_Stanza_Request_Abstract $request = null, $time = -1) { }

/**
* Change user groups or add new user. By using this funtion you are updating roster information (see Zend_Jabber::getAddressBook())
*
* @param Zend_Jabber_User $user Distant user
* @param array $groupNames Array of group names of wich distant user is member of
*/
public function setContact(Zend_Jabber_User $user, $groupNames = array()) { }

/**
* Remove user from address book
*
* @param Zend_Jabber_User $user Distant user
*/
public function removeContact(Zend_Jabber_User $user) { }

/**
* Register a callback function.
*
* Callback function is called when response from server is received
*
* @param string $className Recived stanza id
* @param mixed $callback Callback
*/
public function registerCallback($stanza, $callback) { }

/**
* Unregister a callback function.
*
* Callback function is called when response from server is received
*
* @param string $className Stanza identifying string
* @param mixed $callback Callback
*/
public function unregisterCallback($stanza, $callback) { }

/**
* Update address book.
*
* Update local copy of address book when roster response arrives. User can get get local
* copy of address book through Zend_Jabber_AddressBook object
*
* @param Zend_Jabber_Stanza_Response_Presence $response Response object
* @see self::getAddressBook()
*/
private function pushRosterCallback(Zend_Jabber_Stanza_Response_IQ_Roster_Set $response) { }

/**
* Update contact presence.
*
* This method is executed when response with user presence arrives
* This functionality should be handled by Zend_Jabber class. User can get contact status
* through address book (Zend_Jabber_AddressBook)
*
* @param Zend_Jabber_Stanza_Response_Presence $response Response object
* @see self::getAddressBook()
*/
private function gotPresenceCallback(Zend_Jabber_Stanza_Response_Presence $response) { }

/**
* Bind resource.
*
* This method gets user JID from server and changes Zend_Jabber_User parameters
* to those provided by server. This method should not be called by user.
*
* @return Zend_Jabber_Stanza_Response_IQ_Bind_Result
*/
private function bind() {
}

/**
* Start new session according to RFC3921 part 3
*
* @return Zend_Jabber_Stanza_Response_IQ_Session_Result
*/
private function session() { }

/**
* Generate uniq string identifier for each callback
*
* @param string $callback Callback
* @return string Callback unique id
*/
private function getCallbackId($callback) { }
}
{code}

h5. Zend_Jabber_Connection
{code}
/**
* Zend_Jabber is a connection wraper class.
*
* This class is responsibil? for connecting to server, sending and receiving xmpp stanzas
*/
class Zend_Jabber_Connection {
/**
* Connection port
*
* @var integer
*/
private $port = 5222;

/**
* Connection socket
*
* @var resource
*/
private $socket = null;


/**
* Socket stream error number
*
* @var integer
*/
private $socketErrorNumber = 0;

/**
* Socket stream error message
*
* @var string
*/
private $socketErrorString = '';

/**
* Response timeout in seconds
*
* When the time has expiered receive method returns a null response
*
* @var integer
*/
private $socketTimeout = 0.1;

/**
* Specifies how much bytes per read we should scan
*
* @var integer
*/
private $socketReadBytes = 16384;

/**
* Connection timeout
*
* @var integer
*/
private $socketConnectionTimeout = 10;

/**
* Zend_Jabber server host name
*
* @var string
*/
private $host;

/**
* JID domain name.
*
* Most of the time it is the same as server hostname, but sometimes may differ
*
* @var string
*/
private $domain;

/**
* Client's stream Dom
*
* @var DomDocument
*/
private $clientStream;

/**
* Server's stream dom
*
* @var DomDocument
*/
private $serverStream;

/**
* Array of server features.
*
* The contents of this array contain features of last opened stream only
*
* @var array
*/
private $features = array();

/**
* Available authentication mechanisms.
*
* @var array
*/
private $mechanisms = array();

/**
* Opening client stream tag template
*
* @var string
*/
private $clientStreamStart = "<stream:stream to='%s' xmlns='%s' xmlns:stream='%s' version='%s'>";

/**
* Opening server stream tag template
*
* @var string
*/
private $serverStreamStart = '<stream:stream xmlns="%s" xmlns:stream="%s" from="%s" version="%s">';

/**
* Supported XMPP protocol version
*/
const PROTOCOL_VERSION = '1.0';

/**
* Run in debugind mode if true
*/
const DEBUG = true;

/**
* Constructor. Creates new connection wrapper object, but does not connects to the server
*
* @param string $host Server host name
* @param integer $port Server port number
* @param string $domain JID domain name. Most of the time it is the same as server hostname, but sometimes may differ
* @see self::connect()
* @see self::disconnect()
*/
public function __construct($host, $port = 5222, $domain = false) { }

/**
* Get array of used authentication mechanisms
*
* @return array
*/
public function getMechanisms() { }

/**
* Get array of available stream features
*
* @return array
*/
public function getFeatures() { }

/**
* Get server host name
*
* @return string
*/
public function getHost() { }

/**
* Get JID domain name
*
* @return string
*/
public function getDomain() { }

/**
* Open connection with Jabber server.
*
* This method actualy connects to the server
*/
public function open() { }

/**
* Close connection with server
*/
public function close() { }

/**
* Create new stream
*
* When tcp connection is opened there are number of streams should be created before we may receive messages.
* This method also parses server response for stream features and authentication mechanisms
*/
public function createStreams() { }

/**
* Convert request object to xml string and send to server
*
* @param Zend_Jabber_Stanza_Request_Abstract $request Request object
*/
public function send(Zend_Jabber_Stanza_Request_Abstract $request) { }

/**
* Recive xml response from server and convert it to response object
*
* If no response was received for a number of seconds null response is returned
*
* @see self::$socketTimeout
* @return Zend_Jabber_Stanza
*/
public function receive() { }

/**
* Print debugin message
*
* @param string $message Message text
* @parem string $title Message title
*/
private function debug($message, $title = false) { }
}
{code}

h5. Zend_Jabber_User
{code}
/**
* Jabber user data
*/
class Zend_Jabber_User {
/**
* jabber user username
*
* @var string
*/
private $username;

/**
* User jid's domain
*
* @var string
*/
private $domain;

/**
* User resource
*
* @var stirn
*/
private $resource = '';

/**
* User priority
*
* @var priority
*/
private $priority = 0;

/**
* User alias
*
* User alias can be specified by distant user himself or changed by connected user
*
* @var string
*/
private $alias;

/**
* User status string.
*
* Distant user can provide everything he wans in his status information
*
* @var string
*/
private $status = '';

/**
* User availability information
*
* @var string
*/
private $show = '';

/**
* Array of initialized users
*
* @var array
*/
private static $poll = array();

/**
* User has gone away
*/
const SHOW_AWAY = 'away';

/**
* User is willing to chat
*/
const SHOW_CHAT = 'chat';

/**
* Do not desturb this user.
*
* Messages sent to this user most likely won't be displayed to user, although
* this depends on implementation of user question
*/
const SHOW_DND = 'dnd';

/**
* Extended away.
*
* Setting such status user says that he is away for a very long period amount of time
*/
const SHOW_EXTENDED_AWAY = 'xa';

/**
* User is offline
*/
const SHOW_OFFLINE = 'offline';

/**
* User is online and ready to response to any message or event
*/
const SHOW_ONLINE = 'online';

/**
* Create new user
*
* @param string $name User address in "username@domain/resource" format
* @param string $alias User alias
*/
private function __construct($jid, $alias = false) { }

/**
* Get user instance
*
* @param string $name User address in "username@domain/resource" format
* @param string $alias User alias
* @return Zend_Jabber_User
*/
public static function getInstance($jid, $alias = false) { }

/**
* Set user priority
*
* @param integer $priority Priority
* @throws Zend_Jabber_Exception This exception is thrown when passed priority is out of interval [-127; 128] according to RFC3921 part 2.2.2.3.
*/
public function setPriority($priority = 0) { }

/**
* Get user priority
*
* @return integer
*/
public function getPriority() { }

/**
* Set user alias (Diffirently from username alias can change, why alias will be always the same)
*
* @param string $alias New user alias
*/
public function setAlias($alias) { }

/**
* Get user alias
*
* @return string
*/
public function getAlias() { }

/**
* Set user status
*
* @param string $status User status
*/
public function setStatus($status = '') { }

/**
* Get user status string
*
* @return string
*/
public function getStatus() { }

/**
* Set user information by setting his jabber user id
*
* @param string $jid Jabber User Id
*/
public function setJid($jid) { }

/**
* Get full user address in "username@domain/resource" format
*
* @return string
*/
public function getJid($includeResource = true) { }

/**
* Get username
*
* @return string
*/
public function getUsername() { }

/**
* Get server domain to which the user is connected
*
* @return string
*/
public function getDomain() { }

/**
* Get user presence
*
* @return string
*/
public function getResource() { }

/**
* Set show status (Like online, do not disturb or chat)
*
* @param string $value
*/
public function setShow($value = self::SHOW_ONLINE) { }

/**
* Get user show status
*
* @return string
*/
public function getShow() { }

/**
* Compare two users
*
* @param Zend_Jabber_User $user
*
* @return true
*/
public function compare(Zend_Jabber_User $user) { }
}
{code}

h5. Zend_Jabber_AddressBook
{code}
/**
* This class manages user address book information items and groups
*/
class Zend_Jabber_AddressBook {
/**
* Address book owner
*
* @var Zend_Jabber_User
*/
private $owner;

/**
* Array of address book items
*
* @see Zend_Jabber_AddressBookItem
* @var array
*/
private $groups;

/**
* Create new address book object object
*
* @param Zend_Jabber_User Addres book owner
*/
public function __construct(Zend_Jabber_User $owner) { }

/**
* Add new group to address book
*
* @param Zend_Jabber_AddressBook_Group $group Address book group
*/
public function addGroup(Zend_Jabber_AddressBook_Group $group) { }

/**
* Remove group from address book
*
* This method does not effect server copy of address book, because groups
* are stored as user keywords on server.
*
* @param Zend_Jabber_AddressBook_Group $group Roster group
*/
public function removeGroup(Zend_Jabber_AddressBook_Group $group) { }

/**
* Get available available groups
*
* @return array
*/
public function getGroups() { }

/**
* Get default address book group
*
* @return Zend_Jabber_AddressBook_Group
*/
public function getDefaultGroup() { }

/**
* Get group by name
*
* @param string $name Group name
* @return Zend_Jabber_AddressBook_Group
*/
public function getGroupByName($name) { }

/**
* Get address book owner
*
* @return Zend_Jabber_User
*/
public function getOwner() { }

/**
* Get array of users in the address book
*
* @return array
*/
public function getUsers() { }

/**
* Get user object by specifiend user JID
*
* If there is no user with such jid in the address book then false will be returned
*
* @return Zend_Jabber_User
*/
public function getUserByJid($jid) { }

/**
* Get all contacts (items) in this address book
*
* @return array
*/
public function getItems() { }

/**
* Remove item from address book
*
* @param Zend_Jabber_AddressBook_Item $item
*/
public function removeItem(Zend_Jabber_AddressBook_Item $item) { }

/**
* Conver roster object to a string
*
* You can use this function for debuging as it presents user readable information
* about user's address book
*
* @return string
*/
public function toString() { }

/**
* Print roster object
*
* @return string
*/
public function __toString() { }
}
{code}

h5. Zend_Jabber_AddressBook_Group
{code}
/**
* Manage jabber address book group data
*/
class Zend_Jabber_AddressBook_Group {
/**
* Group name
*
* @var string
*/
private $name;

/**
* Owner address book
*
* @var Zend_Jabber_AddressBook
*/
private $addressBook;

/**
* Array of items (Zend_Jabber_AddressBook_Item)
*
* @var array
*/
private $items;

/**
* Specifies if this group is default addressBook group
*
* @var boolean
*/
private $default = false;

/**
* Create new address book group
*
* @param Zend_Jabber_AddressBook $addressBook Address book
* @param string name Group name
* @param boolead $default Is this group a default address book group
*/
public function __construct(Zend_Jabber_AddressBook $addressBook, $name, $default = false) { }

/**
* Return true if this group is a default address book group
*
* @return boolean
*/
public function IsDefault() { }

/**
* Get group name
*
* @return string
*/
public function getName() { }

/**
* Get owner address book object
*
* @return Zend_Jabber_AddressBook
*/
public function getAddressBook() { }

/**
* Add new item to address book group
*
* @param Zend_Jabber_AddressBook_Item
*/
public function addItem(Zend_Jabber_AddressBook_Item $item) { }

/**
* Get array of items in address book group
*
* @return array
*/
public function getItems() { }

/**
* Remove address book item from address book group
*
* @param Zend_Jabber_AddressBook_Item $item Roster item
*/
public function removeItem(Zend_Jabber_AddressBook_Item $item) { }

/**
* Count items in current address book group
*
* @return integer
*/
public function countItems() { }

/**
* Convert address book group to XML
*
* @return DomDocument
*/
public function toDom() { }
}
{code}

h5. Zend_Jabber_AddressBook_Item
{code}
/**
* This class stores jabber address book item data such as user, subscription state and connection state
*/
class Zend_Jabber_AddressBook_Item {
/**
* This means that both users are allowed to see each other presence information
*/
const SUBSCRIPTION_BOTH = 'both';

/**
* This means that your current user is allowed to see distant user's presence contrariwise
*/
const SUBSCRIPTION_TO = 'to';

/**
* This means that distant user is allowed to see your presence, but you are not allowed to see his
*/
const SUBSCRIPTION_FROM = 'from';

/**
* This means that both users are not allowed to see each others information
*/
const SUBSCRIPTION_NONE = 'none';

/**
* This subscription is used when removing user from addressBook
*/
const SUBSCRIPTION_REMOVE = 'remove';

/**
* Owner address book
*
* @var Zend_Jabber_AddressBook
*/
private $addressBook;

/**
* Distant user
*
* @var Zend_Jabber_User
*/
private $user;

/**
* Array of groups (Zend_Jabber_AddressBook_Group)
*
* @var array
*/
private $groups = array();

/**
* Direction of the subscription
*
* There are four major values for this parameter
* both - both users are subscribet to view their presence update
* to - only address book owner can see other user presence
* from - only distant useer can see address book's owner's presence
* none - none of two can see other's presence state
*
* @var string
*/
private $subscription;

/**
* Create new addressBook item
*
* @param Zend_Jabber_User $you Your user object
* @param Zend_Jabber_User $user Your user user object
* @param string $subscription Direction of the subscription
* @param array $groups array of Zend_Jabber_AddressBook_Group
*/
public function __construct(Zend_Jabber_AddressBook $addressBook, Zend_Jabber_User $user, $subscription, $groups = array()) { }

/**
* Get user subscription direction
*
* @return string
*/
public function getSubscription() { }

/**
* Get item groups
*
* @return array
*/
public function getGroups() { }

/**
* Get distant user
*
* @return Zend_Jabber_User
*/
public function getUser() { }

/**
* Get owner address book
*
* @return Zend_Jabber_AddressBook
*/
public function getAddressBook() { }

/**
* Convert address book item to DomDocument
*
* @return DomDocument
*/
public function toDom() { }
}
{code}

h5. Zend_Jabber_Stanza_Abstract
{code}
/**
* Store jabber stanza information
*/
abstract class Zend_Jabber_Stanza_Abstract {
/**
* Dom representation of jabber stanza
*
* @var DomDocument
*/
protected $dom;

/**
* Stanza id
*
* @var integer
*/
private $id;

/**
* Array of sent request stanzas
*
* @var array
*/
private static $requests = array();

/**
* Array of recived response stanzas
*
* @var array
*/
private static $responses = array();

/**
* Create new stanza
*
* For a request stanza id is generated automaticaly
*/
public function __construct($id = false) { }

/**
* Get stanza id
*
* @return integer
*/
public function getId() { }

/**
* Try to guess response class from received XML
*
* @param DomDocument $dom received XML wrapped in stream class
*/
public static function getResponseClassNameByDom(DomDocument $dom) { }

/**
* Try to guess stanza id from received response
*
* @param DomDocument $dom Received XML
*/
public static function getStanzaIdByDom(DomDocument $dom) { }

/**
* Get stanza class
*
* This is not actual class of the object but instead something wich identifies the
* class of stanza like auth, message, iq or presence
*
* @param string
*/
public function getClass() { }

/**
* Get stanza type
*
* @return string
*/
public function getType() { }

/**
* Get stanza object as Dom
*
* @return DomDocument
*/
public function toDom() { }

/**
* Convert stanza DOM representation to string
*
* @return string
*/
public function toString() { }

/**
* Prints stanza object as XML tree
*
* @return string
*/
public function __toString() { }
}
{code}

h2. UML diagrams
h3. Main classes. These classes will be most of the time used by user
!jabber.png!

h3. Stanza
!stanza.png!

h3. Detaild Iq request UML diagram
!request_iq.png!

h3. Detaild Iq response UML diagram
!response_iq.png!

h3. Detaild Message request UML diagram
!request_message.png!

h3. Detaild Message response UML diagram
!response_message.png!

h3. Detaild Presence request UML diagram
!request_presence.png!

h3. Detaild Presence response UML diagram
!response_presence.png!
{zone-data}

{zone-template-instance}]]></ac:plain-text-body></ac:macro>