tigase.xmpp.impl
Class Presence

java.lang.Object
  extended by tigase.xmpp.impl.Presence

public abstract class Presence
extends java.lang.Object

Describe class Presence here. Created: Wed Feb 22 07:30:03 2006

Version:
$Rev: 1702 $
Author:
Artur Hefczyc

Field Summary
static java.lang.String DIRECT_PRESENCE
          DIRECT_PRESENCE is a key in temporary session data for the collection of JIDs where direct presence was sent.
static java.lang.String PRESENCE_ELEMENT_NAME
           
protected static java.lang.String XMLNS
           
 
Constructor Summary
Presence()
           
 
Method Summary
protected static void addDirectPresenceJID(java.lang.String jid, XMPPResourceConnection session)
           
protected static void broadcastDirectPresences(StanzaType t, XMPPResourceConnection session, java.util.Queue<Packet> results, tigase.xml.Element pres)
           
protected static void broadcastOffline(XMPPResourceConnection session, java.util.Queue<Packet> results, java.util.Map<java.lang.String,java.lang.Object> settings)
          sendPresenceBroadcast method broadcasts given presence to all budies from roster and to all users to which direct presence was sent.
protected static void broadcastProbe(XMPPResourceConnection session, java.util.Queue<Packet> results, java.util.Map<java.lang.String,java.lang.Object> settings)
          sendPresenceBroadcast method broadcasts given presence to all budies from roster and to all users to which direct presence was sent.
protected static void forwardPresence(java.util.Queue<Packet> results, Packet packet, java.lang.String from)
           
protected static void outInitialAnonymous(Packet packet, XMPPResourceConnection session, java.util.Queue<Packet> results)
           
static void process(Packet packet, XMPPResourceConnection session, NonAuthUserRepository repo, java.util.Queue<Packet> results, java.util.Map<java.lang.String,java.lang.Object> settings)
           
protected static void removeDirectPresenceJID(java.lang.String jid, XMPPResourceConnection session)
           
protected static void resendPendingInRequests(XMPPResourceConnection session, java.util.Queue<Packet> results)
           
protected static void sendPresence(StanzaType t, java.lang.String to, java.lang.String from, java.util.Queue<Packet> results, tigase.xml.Element pres)
           
protected static void sendPresenceBroadcast(StanzaType t, XMPPResourceConnection session, java.util.EnumSet<RosterAbstract.SubscriptionType> subscrs, java.util.Queue<Packet> results, tigase.xml.Element pres, java.util.Map<java.lang.String,java.lang.Object> settings, boolean onlineOnly)
          sendPresenceBroadcast method broadcasts given presence to all budies from roster and to all users to which direct presence was sent.
static void stopped(XMPPResourceConnection session, java.util.Queue<Packet> results, java.util.Map<java.lang.String,java.lang.Object> settings)
          stopped method is called when user disconnects or logs-out.
protected static void updateOfflineChange(XMPPResourceConnection session, java.util.Queue<Packet> results)
          updateOfflineChange method broadcast off-line presence to all other user active resources.
protected static void updatePresenceChange(tigase.xml.Element presence, XMPPResourceConnection session, java.util.Queue<Packet> results)
          updatePresenceChange method is used to broadcast to all active resources presence stanza received from other users, like incoming avaiability presence, subscription presence and so on...
protected static void updateUserResources(tigase.xml.Element presence, XMPPResourceConnection session, java.util.Queue<Packet> results)
          updateUserResources method is used to broadcast to all other resources presence stanza from one user resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DIRECT_PRESENCE

public static final java.lang.String DIRECT_PRESENCE
DIRECT_PRESENCE is a key in temporary session data for the collection of JIDs where direct presence was sent. To all these addresses unavailable presence must be sent when user disconnects.

See Also:
Constant Field Values

PRESENCE_ELEMENT_NAME

public static final java.lang.String PRESENCE_ELEMENT_NAME
See Also:
Constant Field Values

XMLNS

protected static final java.lang.String XMLNS
See Also:
Constant Field Values
Constructor Detail

Presence

public Presence()
Method Detail

stopped

public static void stopped(XMPPResourceConnection session,
                           java.util.Queue<Packet> results,
                           java.util.Map<java.lang.String,java.lang.Object> settings)
stopped method is called when user disconnects or logs-out.

Parameters:
session - a XMPPResourceConnection value
results -
settings -

broadcastOffline

protected static void broadcastOffline(XMPPResourceConnection session,
                                       java.util.Queue<Packet> results,
                                       java.util.Map<java.lang.String,java.lang.Object> settings)
                                throws NotAuthorizedException,
                                       TigaseDBException
sendPresenceBroadcast method broadcasts given presence to all budies from roster and to all users to which direct presence was sent.

Parameters:
session - a XMPPResourceConnection value
results -
settings -
Throws:
NotAuthorizedException - if an error occurs
TigaseDBException

broadcastProbe

protected static void broadcastProbe(XMPPResourceConnection session,
                                     java.util.Queue<Packet> results,
                                     java.util.Map<java.lang.String,java.lang.Object> settings)
                              throws NotAuthorizedException,
                                     TigaseDBException
sendPresenceBroadcast method broadcasts given presence to all budies from roster and to all users to which direct presence was sent.

Parameters:
session - a XMPPResourceConnection value
results -
settings -
Throws:
NotAuthorizedException - if an error occurs
TigaseDBException

sendPresenceBroadcast

protected static void sendPresenceBroadcast(StanzaType t,
                                            XMPPResourceConnection session,
                                            java.util.EnumSet<RosterAbstract.SubscriptionType> subscrs,
                                            java.util.Queue<Packet> results,
                                            tigase.xml.Element pres,
                                            java.util.Map<java.lang.String,java.lang.Object> settings,
                                            boolean onlineOnly)
                                     throws NotAuthorizedException,
                                            TigaseDBException
sendPresenceBroadcast method broadcasts given presence to all budies from roster and to all users to which direct presence was sent.

Parameters:
t - a StanzaType value
session - a XMPPResourceConnection value
subscrs -
results -
pres - an Element value
settings -
Throws:
NotAuthorizedException - if an error occurs
TigaseDBException

broadcastDirectPresences

protected static void broadcastDirectPresences(StanzaType t,
                                               XMPPResourceConnection session,
                                               java.util.Queue<Packet> results,
                                               tigase.xml.Element pres)
                                        throws NotAuthorizedException,
                                               TigaseDBException
Throws:
NotAuthorizedException
TigaseDBException

resendPendingInRequests

protected static void resendPendingInRequests(XMPPResourceConnection session,
                                              java.util.Queue<Packet> results)
                                       throws NotAuthorizedException,
                                              TigaseDBException
Throws:
NotAuthorizedException
TigaseDBException

updateOfflineChange

protected static void updateOfflineChange(XMPPResourceConnection session,
                                          java.util.Queue<Packet> results)
                                   throws NotAuthorizedException
updateOfflineChange method broadcast off-line presence to all other user active resources.

Parameters:
session - a XMPPResourceConnection value
results -
Throws:
NotAuthorizedException - if an error occurs

updateUserResources

protected static void updateUserResources(tigase.xml.Element presence,
                                          XMPPResourceConnection session,
                                          java.util.Queue<Packet> results)
                                   throws NotAuthorizedException
updateUserResources method is used to broadcast to all other resources presence stanza from one user resource. So if new resource connects this method updates presence information about new resource to old resources and about old resources to new resource.

Parameters:
presence - an Element presence received from other users, we have to change 'to' attribute to full resource JID.
session - a XMPPResourceConnection value keeping connection session object.
results -
Throws:
NotAuthorizedException - if an error occurs

updatePresenceChange

protected static void updatePresenceChange(tigase.xml.Element presence,
                                           XMPPResourceConnection session,
                                           java.util.Queue<Packet> results)
                                    throws NotAuthorizedException
updatePresenceChange method is used to broadcast to all active resources presence stanza received from other users, like incoming avaiability presence, subscription presence and so on... Initial presences are however sent only to those resources which already have sent initial presence.

Parameters:
presence - an Element presence received from other users, we have to change 'to' attribute to full resource JID.
session - a XMPPResourceConnection value keeping connection session object.
results -
Throws:
NotAuthorizedException - if an error occurs

forwardPresence

protected static void forwardPresence(java.util.Queue<Packet> results,
                                      Packet packet,
                                      java.lang.String from)

sendPresence

protected static void sendPresence(StanzaType t,
                                   java.lang.String to,
                                   java.lang.String from,
                                   java.util.Queue<Packet> results,
                                   tigase.xml.Element pres)

addDirectPresenceJID

protected static void addDirectPresenceJID(java.lang.String jid,
                                           XMPPResourceConnection session)

removeDirectPresenceJID

protected static void removeDirectPresenceJID(java.lang.String jid,
                                              XMPPResourceConnection session)

outInitialAnonymous

protected static void outInitialAnonymous(Packet packet,
                                          XMPPResourceConnection session,
                                          java.util.Queue<Packet> results)
                                   throws NotAuthorizedException
Throws:
NotAuthorizedException

process

public static void process(Packet packet,
                           XMPPResourceConnection session,
                           NonAuthUserRepository repo,
                           java.util.Queue<Packet> results,
                           java.util.Map<java.lang.String,java.lang.Object> settings)
                    throws XMPPException
Throws:
XMPPException


Copyright © 2009 Tigase. All Rights Reserved.