|
Openfire 3.5.0 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xmpp.packet.Packet org.xmpp.packet.Presence
public class Presence
Presence packet. Presence packets are used to express an entity's current network availability and to notify other entities of that availability. Presence packets are also used to negotiate and manage subscriptions to the presence of other entities.
A presence optionally has a Presence.Type
.
Nested Class Summary | |
---|---|
static class |
Presence.Show
Represents the presence "show" value. |
static class |
Presence.Type
Represents the type of a presence packet. |
Field Summary |
---|
Fields inherited from class org.xmpp.packet.Packet |
---|
docFactory, element, fromJID, toJID |
Constructor Summary | |
---|---|
Presence()
Constructs a new Presence. |
|
Presence(org.dom4j.Element element)
Constructs a new Presence using an existing Element. |
|
Presence(org.dom4j.Element element,
boolean skipValidation)
Constructs a new Presence using an existing Element. |
|
Presence(Presence.Type type)
Constructs a new Presence with the specified type. |
Method Summary | |
---|---|
org.dom4j.Element |
addChildElement(String name,
String namespace)
Adds a new child element to this packet with the given name and namespace. |
Presence |
createCopy()
Returns a deep copy of this Presence. |
org.dom4j.Element |
getChildElement(String name,
String namespace)
Returns the first child element of this packet that matches the given name and namespace. |
int |
getPriority()
Returns the priority. |
Presence.Show |
getShow()
Returns the presence "show" value, which specifies a particular availability status. |
String |
getStatus()
Returns the status of this presence packet, a natural-language description of availability status. |
Presence.Type |
getType()
Returns the type of this presence. |
boolean |
isAvailable()
Returns true if the presence type is "available". |
void |
setPriority(int priority)
Sets the priority. |
void |
setShow(Presence.Show show)
Sets the presence "show" value, which specifies a particular availability status. |
void |
setStatus(String status)
Sets the status of this presence packet, a natural-language description of availability status. |
void |
setType(Presence.Type type)
Sets the type of this presence. |
Methods inherited from class org.xmpp.packet.Packet |
---|
addExtension, deleteExtension, getElement, getError, getExtension, getFrom, getID, getTo, setError, setError, setFrom, setFrom, setID, setTo, setTo, toString, toXML |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Presence()
public Presence(Presence.Type type)
type
- the presence type.public Presence(org.dom4j.Element element)
element
- the presence Element.public Presence(org.dom4j.Element element, boolean skipValidation)
element
- the Presence Element.skipValidation
- true if stringprep should not be applied to the TO address.Method Detail |
---|
public boolean isAvailable()
getType() == null
public Presence.Type getType()
Presence.Type
public void setType(Presence.Type type)
type
- the presence type.Presence.Type
public Presence.Show getShow()
Presence.Show
public void setShow(Presence.Show show)
show
- the presence show value.
IllegalArgumentException
- if the presence type is not available.Presence.Show
public String getStatus()
public void setStatus(String status)
status
- the status.public int getPriority()
public void setPriority(int priority)
priority
- the priority.
IllegalArgumentException
- if the priority is less than -128 or greater
than 128.public org.dom4j.Element getChildElement(String name, String namespace)
Child elements in extended namespaces are used to extend the features of XMPP. Examples include a "user is typing" indicator and invitations to group chat rooms. Although any valid XML can be included in a child element in an extended namespace, many common features have been standardized as Jabber Enhancement Proposals (JEPs).
name
- the element name.namespace
- the element namespace.
public org.dom4j.Element addChildElement(String name, String namespace)
Child elements in extended namespaces are used to extend the features of XMPP. Examples include a "user is typing" indicator and invitations to group chat rooms. Although any valid XML can be included in a child element in an extended namespace, many common features have been standardized as Jabber Enhancement Proposals (JEPs).
name
- the element name.namespace
- the element namespace.
public Presence createCopy()
createCopy
in class Packet
|
Openfire 3.5.0 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |