org.jabber.jabberbeans
Class Presence

java.lang.Object
  |
  +--org.jabber.jabberbeans.XMLData
        |
        +--org.jabber.jabberbeans.ContentPacket
              |
              +--org.jabber.jabberbeans.Presence

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.

Version:
$Revision: 1.1.1.1 $
Author:
David Waite <dwaite@jabber.com>, $Author: lucky $
See Also:
Serialized Form

Field Summary
private  int priority
          priority - higher is better.
private  java.lang.String stateShow
          stateshow - the icon 'state' of the user
private  java.lang.String status
          status string.
 
Fields inherited from class org.jabber.jabberbeans.ContentPacket
errorCode, errorText, 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, 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, registerNatives, wait, wait, wait
 

Field Detail

status

private java.lang.String status
status string.

priority

private int priority
priority - higher is better.

stateShow

private java.lang.String stateShow
stateshow - the icon 'state' of the user
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.
Overrides:
appendItem in class XMLData
Parameters:
retval - The StringBuffer to append to