|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.java.sip.communicator.service.protocol.PresenceStatus
public class PresenceStatus
The class is used to represent the state of the connection of a given ProtocolProvider or Contact. It is up to the implementation to determine the exact states that an object might go through. An IM provider for example might go through states like, CONNECTING, ON-LINE, AWAY, etc, A status instance is represented by an integer varying from 0 to 100, a Status Name and a Status Description. The integer status variable is used so that the users of the service get the notion of whether or not a given Status instance represents a state that allows communication (above 20) and so that it could compare instances between themselves (e.g. for sorting a ContactList for example). A state may not be created by the user. User may request a status change giving parameters requested by the ProtocolProvider. Once a statue is successfully entered by the provider, a ConnectivityStatus instance is conveyed to the user through a notification event.
| Field Summary | |
|---|---|
static int |
AVAILABLE_THRESHOLD
An integer above which all values of the status coefficient indicate both connectivity and availability. |
static int |
AWAY_THRESHOLD
An integer above which all values of the status coefficient indicate both connectivity and availability but the person is away from the computer. |
static int |
EAGER_TO_COMMUNICATE_THRESHOLD
An integer above which all values of the status coefficient indicate eagerness to communicate |
static int |
MAX_STATUS_VALUE
An integer indicating the maximum possible value of the status field. |
static int |
ONLINE_THRESHOLD
An integer above which all values of the status coefficient indicate that a status with connectivity (communication is possible). |
protected int |
status
Represents the connectivity status on a scale from 0 to 100 with 0 indicating complete disability for communication and 100 maximum ability and user willingness. |
protected byte[] |
statusIcon
An image that graphically represents the status. |
protected String |
statusName
The name of this status instance (e.g. |
| Constructor Summary | |
|---|---|
protected |
PresenceStatus(int status,
String statusName)
Creates an instance of this class using the specified parameters. |
protected |
PresenceStatus(int status,
String statusName,
byte[] statusIcon)
Creates an instance of this class using the specified parameters. |
| Method Summary | |
|---|---|
int |
compareTo(PresenceStatus target)
Compares this instance with the specified object for order. |
boolean |
equals(Object obj)
Indicates whether some other object is "equal to" this one. |
int |
getStatus()
Returns an integer representing the presence status on a scale from 0 to 100. |
byte[] |
getStatusIcon()
Returns an image that graphically represents the status. |
String |
getStatusName()
Returns the name of this status (such as Away, On-line, Invisible, etc). |
int |
hashCode()
Returns a hash code value for the object. |
boolean |
isAvailable()
Indicates whether the user is both Online and avaliable (can be reached and is likely to respond) or not. |
boolean |
isEagerToCommunicate()
Indicates whether the user is Online, available and eager to communicate (can be reached and is likely to become annoyingly talkative if contacted). |
boolean |
isOnline()
Indicates whether the user is Online (can be reached) or not. |
String |
toString()
Returns a string representation of this provider status. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int ONLINE_THRESHOLD
public static final int AWAY_THRESHOLD
public static final int AVAILABLE_THRESHOLD
public static final int EAGER_TO_COMMUNICATE_THRESHOLD
public static final int MAX_STATUS_VALUE
protected final byte[] statusIcon
protected final int status
protected final String statusName
| Constructor Detail |
|---|
protected PresenceStatus(int status,
String statusName)
status - the status variable representing the new instancestatusName - the name of this PresenceStatus
protected PresenceStatus(int status,
String statusName,
byte[] statusIcon)
status - the status variable representing the new instancestatusName - the name of this PresenceStatusstatusIcon - an image that graphically represents the status or null
if no such image is available.| Method Detail |
|---|
public int getStatus()
public String getStatusName()
public String toString()
toString in class Objectpublic boolean isOnline()
public boolean isAvailable()
public boolean isEagerToCommunicate()
public int compareTo(PresenceStatus target)
throws ClassCastException,
NullPointerException
compareTo in interface Comparable<PresenceStatus>target - the PresenceStatus to be compared.
ClassCastException - if the specified object's type prevents it
from being compared to this Object.
NullPointerException - if o is nullpublic boolean equals(Object obj)
equals in class Objectobj - the reference object with which to compare.
obj argument; false otherwise.public int hashCode()
hashCode in class Objectpublic byte[] getStatusIcon()
|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||