|
Smack | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jivesoftware.smackx.LastActivityManager
public class LastActivityManager
A last activity manager for handling information about the last activity associated with a Jabber ID. A manager handles incoming LastActivity requests of existing Connections. It also allows to request last activity information of other users.
LastActivity (XEP-0012) based on the sending JID's type allows for retrieval of:
Connection con = new XMPPConnection("jabber.org");
con.login("john", "doe");
LastActivity activity = LastActivity.getLastActivity(con, "xray@jabber.org/Smack");
To get the lapsed time since the last user logout is the same as above but
with out the resource:
LastActivity activity = LastActivity.getLastActivity(con, "xray@jabber.org");To get the uptime of a host, you simple send the LastActivity packet to it, as in the following code example:
LastActivity activity = LastActivity.getLastActivity(con, "jabber.org");
| Method Summary | |
|---|---|
static LastActivity |
getLastActivity(Connection con,
java.lang.String jid)
Returns the last activity of a particular jid. |
static boolean |
isLastActivitySupported(Connection connection,
java.lang.String jid)
Returns true if Last Activity (XEP-0012) is supported by a given JID |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static LastActivity getLastActivity(Connection con,
java.lang.String jid)
throws XMPPException
con - the current Connection.jid - the JID of the user.
XMPPException - thrown if a server error has occured.
public static boolean isLastActivitySupported(Connection connection,
java.lang.String jid)
connection - the connection to be usedjid - a JID to be tested for Last Activity support
|
Smack | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||