This class also takes care about the following use case, by automatically appending last activity information to 'away' and 'xa' presences:It is often helpful to know the time of the last activity associated with a entity. The canonical usage is to discover when a disconnected user last accessed its server. The 'jabber:iq:last' namespace provides a method for retrieving that information. The 'jabber:iq:last' namespace can also be used to discover or publicize when a connected user was last active on the server (i.e., the user's idle time) or to query servers and components about their current uptime.
When a client automatically sets the user's {@code
} value to "away" or "xa" (extended away), it can indicate when that particular was last active during the current presence session.
By default last activity for the connected resource is updated whenever a message or available non-away, non-xa presence is sent. This strategy of determining last activity can be changed by {@linkplain #setLastActivityStrategy(LastActivityStrategy) setting another strategy}, e.g. a strategy which determines last activity by idle mouse activity.
Automatic inclusion of last activity information in presence stanzas and support for this protocol can be {@linkplain #setEnabled(boolean)} enabled or disabled}.
LastActivityManager lastActivityManager = xmppSession.getExtensionManager(LastActivityManager.class); LastActivity lastActivity = lastActivityManager.getLastActivity(Jid.valueOf("juliet@example.com/balcony"));
@author Christian Schudt
|
|