org.jabber.jabberbeans
Class Presence

java.lang.Object
  |
  +--org.jabber.jabberbeans.XMLData
        |
        +--org.jabber.jabberbeans.ContentPacket
              |
              +--org.jabber.jabberbeans.Presence
All Implemented Interfaces:
Extension, Packet, java.io.Serializable

public final class Presence
extends ContentPacket
implements java.io.Serializable

This class is an abstraction of presence packets - both incoming and outgoing. Incoming presence packets are notifications on a resource - they are sent by the remote client's server when that client has a status change. Outgoing presence packets are of two types. You send out your presence by sending a packet to the server with your new status. The second type is a subscribe request, where you request a remote user add you to their presence notifications.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jabber.jabberbeans.ContentPacket
error, extensions, fromAddress, identifier, toAddress, type
 
Constructor Summary
Presence(PresenceBuilder builder)
          Creates a new Presence instance.
 
Method Summary
 void appendItem(java.lang.StringBuffer retval)
          appendItem appends the XML representation of the current packet data to the specified StringBuffer.
 int getPriority()
          getPriority returns the priority level being set
 java.lang.String getStateShow()
          getStateShow returns the State of a user
 java.lang.String getStatus()
          getStatus returns the status value, if any
 
Methods inherited from class org.jabber.jabberbeans.ContentPacket
appendAnyError, appendBaseAttribs, Extensions, getError, getErrorCode, getErrorText, getFromAddress, getIdentifier, getToAddress, getType
 
Methods inherited from class org.jabber.jabberbeans.XMLData
appendAttrib, appendAttrib, appendChild, appendChild, escapeString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jabber.jabberbeans.Packet
toString
 
Methods inherited from interface org.jabber.jabberbeans.Extension.Extension
toString
 

Constructor Detail

Presence

public Presence(PresenceBuilder builder)
         throws java.lang.InstantiationException
Creates a new Presence instance.

Parameters:
builder - a PresenceBuilder to get parameters from
Throws:
java.lang.InstantiationException - if there is not enough data to create a valid packet.
Method Detail

getStatus

public final java.lang.String getStatus()
getStatus returns the status value, if any

Returns:
a String value of status, or null if none

getPriority

public final int getPriority()
getPriority returns the priority level being set

Returns:
an int value

getStateShow

public final java.lang.String getStateShow()
getStateShow returns the State of a user

Returns:
a String value showing state

appendItem

public final void appendItem(java.lang.StringBuffer retval)
appendItem appends the XML representation of the current packet data to the specified StringBuffer.

Specified by:
appendItem in interface Packet
Specified by:
appendItem in class XMLData
Parameters:
retval - The StringBuffer to append to