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

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

public abstract class PresenceStore
extends Object

Storage for keep received presences of buddies.


Field Summary
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
PresenceStore()
           
 
Method Summary
 void clear()
          Removes all known presence information.
 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.
 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

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).

isAvailable

public boolean isAvailable(BareJID jid)
                    throws XMLException
Throws:
XMLException

setPresence

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

update

protected void update(Presence presence)
               throws XMLException
Throws:
XMLException

updateBestPresence

protected void updateBestPresence(Presence presence)
                           throws XMLException
Throws:
XMLException


Copyright © 2006-2013 Tigase. All Rights Reserved.