Class LastActivity
- java.lang.Object
-
- org.jivesoftware.smack.packet.Stanza
-
- org.jivesoftware.smack.packet.IQ
-
- org.jivesoftware.smackx.iqlast.packet.LastActivity
-
- All Implemented Interfaces:
org.jivesoftware.smack.packet.Element
,org.jivesoftware.smack.packet.FullyQualifiedElement
,org.jivesoftware.smack.packet.IqView
,org.jivesoftware.smack.packet.NamedElement
,org.jivesoftware.smack.packet.StanzaView
,org.jivesoftware.smack.packet.TopLevelStreamElement
,org.jivesoftware.smack.packet.XmlLangElement
public class LastActivity extends org.jivesoftware.smack.packet.IQ
A last activity IQ for retrieving information about the last activity associated with a Jabber ID. LastActivity (XEP-0012) allows for retrieval of how long a particular user has been idle and the message the specified when doing so. UseLastActivityManager
to get the last activity of a user.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LastActivity.Provider
The IQ Provider for LastActivity.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ELEMENT
long
lastActivity
java.lang.String
message
static java.lang.String
NAMESPACE
-
Constructor Summary
Constructors Constructor Description LastActivity()
LastActivity(org.jxmpp.jid.Jid to)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getIdleTime()
Returns number of seconds that have passed since the user last logged out.protected org.jivesoftware.smack.packet.IQ.IQChildElementXmlStringBuilder
getIQChildElementBuilder(org.jivesoftware.smack.packet.IQ.IQChildElementXmlStringBuilder xml)
java.lang.String
getStatusMessage()
Returns the status message of the last unavailable presence received from the user.void
setLastActivity(long lastActivity)
-
Methods inherited from class org.jivesoftware.smack.packet.IQ
createErrorResponse, createErrorResponse, createErrorResponse, createResultIQ, getChildElementName, getChildElementNamespace, getChildElementQName, getChildElementXML, getElementName, getType, isRequestIQ, isResponseIQ, setType, toString, toXML
-
Methods inherited from class org.jivesoftware.smack.packet.Stanza
addCommonAttributes, addExtension, addExtensions, appendErrorIfExists, getDefaultLanguage, getError, getExtension, getExtension, getExtension, getExtensionElement, getExtensions, getExtensions, getExtensions, getExtensions, getExtensionsMap, getFrom, getLanguage, getNamespace, getStanzaId, getTo, hasExtension, hasExtension, hasStanzaIdSet, logCommonAttributes, overrideExtension, removeExtension, removeExtension, setError, setError, setFrom, setLanguage, setNewStanzaId, setStanzaId, setStanzaId, setTo, throwIfNoStanzaId
-
-
-
-
Field Detail
-
ELEMENT
public static final java.lang.String ELEMENT
- See Also:
- Constant Field Values
-
NAMESPACE
public static final java.lang.String NAMESPACE
- See Also:
- Constant Field Values
-
lastActivity
public long lastActivity
-
message
public java.lang.String message
-
-
Method Detail
-
getIQChildElementBuilder
protected org.jivesoftware.smack.packet.IQ.IQChildElementXmlStringBuilder getIQChildElementBuilder(org.jivesoftware.smack.packet.IQ.IQChildElementXmlStringBuilder xml)
- Specified by:
getIQChildElementBuilder
in classorg.jivesoftware.smack.packet.IQ
-
setLastActivity
public void setLastActivity(long lastActivity)
-
getIdleTime
public long getIdleTime()
Returns number of seconds that have passed since the user last logged out. If the user is offline, 0 will be returned.- Returns:
- the number of seconds that have passed since the user last logged out.
-
getStatusMessage
public java.lang.String getStatusMessage()
Returns the status message of the last unavailable presence received from the user.- Returns:
- the status message of the last unavailable presence received from the user
-
-