Class IdleElement

  • All Implemented Interfaces:
    org.jivesoftware.smack.packet.Element, org.jivesoftware.smack.packet.ExtensionElement, org.jivesoftware.smack.packet.FullyQualifiedElement, org.jivesoftware.smack.packet.NamedElement, org.jivesoftware.smack.packet.XmlLangElement

    public class IdleElement
    extends java.lang.Object
    implements org.jivesoftware.smack.packet.ExtensionElement
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String ATTR_SINCE  
      static java.lang.String ELEMENT  
      static java.lang.String NAMESPACE  
      static javax.xml.namespace.QName QNAME  
    • Constructor Summary

      Constructors 
      Constructor Description
      IdleElement()
      Create a new IdleElement with the current date as date of last user interaction.
      IdleElement​(java.util.Date since)
      Create a new IdleElement.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static void addToPresence​(org.jivesoftware.smack.packet.Presence presence)
      Add an Idle element with current date to the presence.
      static IdleElement fromPresence​(org.jivesoftware.smack.packet.Presence presence)
      Return the IdleElement from a presence.
      java.lang.String getElementName()
      java.lang.String getNamespace()
      java.util.Date getSince()
      Return the value of last user interaction.
      org.jivesoftware.smack.util.XmlStringBuilder toXML​(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.jivesoftware.smack.packet.Element

        toXML, toXML
      • Methods inherited from interface org.jivesoftware.smack.packet.FullyQualifiedElement

        getLanguage, getQName
    • Field Detail

      • QNAME

        public static final javax.xml.namespace.QName QNAME
    • Constructor Detail

      • IdleElement

        public IdleElement()
        Create a new IdleElement with the current date as date of last user interaction.
      • IdleElement

        public IdleElement​(java.util.Date since)
        Create a new IdleElement.
        Parameters:
        since - date of last user interaction
    • Method Detail

      • getSince

        public java.util.Date getSince()
        Return the value of last user interaction.
        Returns:
        date of last interaction
      • addToPresence

        public static void addToPresence​(org.jivesoftware.smack.packet.Presence presence)
        Add an Idle element with current date to the presence.
        Parameters:
        presence - presence
      • fromPresence

        public static IdleElement fromPresence​(org.jivesoftware.smack.packet.Presence presence)
        Return the IdleElement from a presence. Returns null, if no IdleElement found.
        Parameters:
        presence - presence
        Returns:
        idleElement from presence or null
      • getNamespace

        public java.lang.String getNamespace()
        Specified by:
        getNamespace in interface org.jivesoftware.smack.packet.FullyQualifiedElement
      • getElementName

        public java.lang.String getElementName()
        Specified by:
        getElementName in interface org.jivesoftware.smack.packet.NamedElement
      • toXML

        public org.jivesoftware.smack.util.XmlStringBuilder toXML​(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace)
        Specified by:
        toXML in interface org.jivesoftware.smack.packet.Element