tigase.jaxmpp.core.client.xmpp.modules.presence

## Class PresenceStore

- java.lang.Object
- - tigase.jaxmpp.core.client.xmpp.modules.presence.PresenceStore

- All Implemented Interfaces:
    Property
  Direct Known Subclasses:
    GWTPresenceStore, J2SEPresenceStore

      public abstract class PresenceStore
      extends Object
      implements Property

  Storage for keep received presences of buddies.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Map<BareJID,Presence>` | `bestPresence`
    `protected tigase.jaxmpp.core.client.xmpp.modules.presence.PresenceStore.Handler` | `handler`
    `protected Map<JID,Presence>` | `presenceByJid`
    `protected Map<BareJID,Map<String,Presence>>` | `presencesMapByBareJid`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PresenceStore()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clear()` Removes all known presence information.
    `protected abstract Map<String,Presence>` | `createResourcePresenceMap()`
    `Presence` | `getBestPresence(BareJID jid)` Returns presence stanza with highest priority of goven bare JID.
    `Presence` | `getPresence(JID jid)` Returns presence stanza of given JID.
    `Map<String,Presence>` | `getPresences(BareJID jid)` Returns map of all known resources and related presences stanza of given bare JID.
    `Class<PresenceStore>` | `getPropertyClass()` Method which returns class which implements this interface which may be used as a key to store instance of this class in JaxmppCore.
    `boolean` | `isAvailable(BareJID jid)`
    `void` | `setPresence(Presence.Show show, String status, Integer priority)`
    `protected void` | `update(Presence presence)`
    `protected void` | `updateBestPresence(Presence presence)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### bestPresence

          protected Map<BareJID,Presence> bestPresence

    - #### handler

          protected tigase.jaxmpp.core.client.xmpp.modules.presence.PresenceStore.Handler handler

    - #### presenceByJid

          protected Map<JID,Presence> presenceByJid

    - #### presencesMapByBareJid

          protected Map<BareJID,Map<String,Presence>> presencesMapByBareJid

  - ### Constructor Detail

    - #### PresenceStore

          public PresenceStore()

  - ### Method Detail

    - #### clear

          public void clear()
                     throws JaxmppException

      Removes all known presence information.
      Throws:
        `JaxmppException`

    - #### createResourcePresenceMap

          protected abstract Map<String,Presence> createResourcePresenceMap()

    - #### getBestPresence

          public Presence getBestPresence(BareJID jid)
                                   throws XMLException

      Returns presence stanza with highest priority of goven bare JID.
      Parameters:
        `jid` - JID of sender
      Returns:
        Presence stanza or `null` if not found.
      Throws:
        `XMLException`

    - #### getPresence

          public Presence getPresence(JID jid)

      Returns presence stanza of given JID.
      Parameters:
        `jid` - JID of sender
      Returns:
        Presence stanza or `null` if not found.

    - #### getPresences

          public Map<String,Presence> getPresences(BareJID jid)

      Returns map of all known resources and related presences stanza of given bare JID.
      Parameters:
        `jid` - basre JID of sender
      Returns:
        map contains resource (key) and related presence stanza (value).

    - #### getPropertyClass

          public Class<PresenceStore> getPropertyClass()

      Description copied from interface: `Property`
      Method which returns class which implements this interface which may be used as a key to store instance of this class in JaxmppCore.
      Specified by:
        `getPropertyClass` in interface `Property`
      Returns:

    - #### isAvailable

          public boolean isAvailable(BareJID jid)
                              throws XMLException

      Throws:
        `XMLException`

    - #### setPresence

          public void setPresence(Presence.Show show,
                                  String status,
                                  Integer priority)
                           throws JaxmppException

      Throws:
        `JaxmppException`

    - #### update

          protected void update(Presence presence)
                         throws XMLException

      Throws:
        `XMLException`

    - #### updateBestPresence

          protected void updateBestPresence(Presence presence)
                                     throws XMLException

      Throws:
        `XMLException`

Copyright © 2006–2019 Tigase. All rights reserved.