org.jabber.jabberbeans
Class PresenceBuilder

java.lang.Object
  |
  +--org.jabber.jabberbeans.PacketBuilder
        |
        +--org.jabber.jabberbeans.PresenceBuilder
All Implemented Interfaces:
java.io.Serializable

public class PresenceBuilder
extends PacketBuilder
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.PacketBuilder
error, extensions, fromAddress, identifier, toAddress, type
 
Constructor Summary
PresenceBuilder()
          Creates a new PresenceBuilder instance.
 
Method Summary
 Packet build()
          Generates a new object based in this builder's state
 int getPriority()
          Get the priority level being set by this message
 java.lang.String getStateShow()
          Gets the state (icon) mentioned in this presence by name
 java.lang.String getStatus()
          Gets the status associated with this presence message, if any
 void reset()
          Reset is used to restore all values to their null/nothing values, so that the builder can be safely reused.
 void setPriority(int priority)
          Set the priority level being set by this message
 void setStateShow(java.lang.String state)
          Sets the state (icon) to be mentioned in this presence by name
 void setStatus(java.lang.String status)
          Sets the status associated with this presence message, if any
 
Methods inherited from class org.jabber.jabberbeans.PacketBuilder
addExtension, delExtension, getError, getErrorCode, getErrorText, getExtensionVector, getFromAddress, getIdentifier, getToAddress, getType, resetBase, setError, setErrorCode, setErrorText, setFromAddress, setIdentifier, setToAddress, setType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PresenceBuilder

public PresenceBuilder()
Creates a new PresenceBuilder instance.

Method Detail

reset

public void reset()
Reset is used to restore all values to their null/nothing values, so that the builder can be safely reused.

Specified by:
reset in class PacketBuilder

getStatus

public java.lang.String getStatus()
Gets the status associated with this presence message, if any

Returns:
a String value, or null if no status

setStatus

public void setStatus(java.lang.String status)
Sets the status associated with this presence message, if any

Parameters:
status - a String value, or null to clear

getPriority

public int getPriority()
Get the priority level being set by this message

Returns:
an int value, with zero being the default

setPriority

public void setPriority(int priority)
Set the priority level being set by this message

Parameters:
priority - an int value, or zero to clear.

getStateShow

public java.lang.String getStateShow()
Gets the state (icon) mentioned in this presence by name

Returns:
a String value, or null if none set

setStateShow

public void setStateShow(java.lang.String state)
Sets the state (icon) to be mentioned in this presence by name

Parameters:
state - a String value, or null to clear

build

public Packet build()
             throws java.lang.InstantiationException
Generates a new object based in this builder's state

Specified by:
build in class PacketBuilder
Returns:
a Packet value
Throws:
java.lang.InstantiationException - if not enough information/ malformed information was passed.