public class LastActivityManager extends Object
LastActivity (JEP-012) 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");
Modifier and Type | Method and Description |
---|---|
static LastActivity |
getLastActivity(Connection con,
String jid)
Returns the last activity of a particular jid.
|
public static LastActivity getLastActivity(Connection con, String jid) throws XMPPException
con
- the current Connection.jid
- the JID of the user.XMPPException
- thrown if a server error has occured.Copyright © 2003-2007 Jive Software.