public class QBPresence
extends java.lang.Object
online
-- (Default) indicates the user is available to
receive messages.
offline
-- the user is unavailable to receive messages.
error
-- - the presence contains an error message..
A number of attributes are optional:
available
(the default),
chat
, away
, xa
(extended away), and
dnd
(do not disturb).
Presence packets are used for two purposes. First, to notify the server of the user's current presence status. Second, they are used to subscribe and unsubscribe users from the roster.
Modifier and Type | Class and Description |
---|---|
static class |
QBPresence.Mode
Class represents presence's mode.
|
static class |
QBPresence.Type
Class represents presence's type.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
X_ELEMENT_NAME |
static java.lang.String |
X_ELEMENT_NAMESPACE |
Constructor and Description |
---|
QBPresence(Presence presence) |
QBPresence(QBPresence.Type type,
java.lang.String status,
int priority,
QBPresence.Mode mode)
Constructs a new QBPresence object.
|
Modifier and Type | Method and Description |
---|---|
QBPresence.Mode |
getMode()
Gets the mode.
|
int |
getPriority()
Gets the priority.
|
java.lang.String |
getResource()
Gets the resource.
|
java.lang.String |
getStatus()
Gets the status.
|
QBPresence.Type |
getType()
Gets the type.
|
java.lang.Integer |
getUserId()
Gets the user ID.
|
void |
setMode(QBPresence.Mode mode)
Sets the mode.
|
void |
setPriority(int priority)
Sets the priority.
|
void |
setStatus(java.lang.String status)
Sets the status.
|
void |
setType(QBPresence.Type type)
Sets the type.
|
static Presence |
toSmackPresence(QBPresence presence) |
java.lang.String |
toString() |
public static final java.lang.String X_ELEMENT_NAME
public static final java.lang.String X_ELEMENT_NAMESPACE
public QBPresence(Presence presence)
public QBPresence(QBPresence.Type type, java.lang.String status, int priority, QBPresence.Mode mode)
type
- The type of a presencestatus
- The free-form text describing a user's presence (i.e., gone to lunch).mode
- The mode of a presence.public static Presence toSmackPresence(QBPresence presence)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Integer getUserId()
public java.lang.String getResource()
public QBPresence.Type getType()
public void setType(QBPresence.Type type)
type
- the type to set.public java.lang.String getStatus()
public void setStatus(java.lang.String status)
status
- the status to set.public QBPresence.Mode getMode()
public void setMode(QBPresence.Mode mode)
mode
- the mode to set.public int getPriority()
public void setPriority(int priority)
priority
- the priority to set.