tigase.server.xmppsession
Class SessionManager

java.lang.Object
  extended by tigase.server.BasicComponent
      extended by tigase.server.AbstractMessageReceiver
          extended by tigase.server.xmppsession.SessionManager
All Implemented Interfaces:
Configurable, XMPPService, MessageReceiver, ServerComponent, SessionManagerHandler, StatisticsContainer, OnlineJidsReporter, VHostListener
Direct Known Subclasses:
SessionManagerClustered

public class SessionManager
extends AbstractMessageReceiver
implements Configurable, SessionManagerHandler, OnlineJidsReporter

Class SessionManager Created: Tue Nov 22 07:07:11 2005

Version:
$Rev: 2147 $
Author:
Artur Hefczyc, Peter Sandstr??m - multi-threadin support for pluggins processors.

Field Summary
protected static String ADMIN_COMMAND_NODE
           
protected  ConcurrentHashMap<tigase.xmpp.JID,XMPPResourceConnection> connectionsByFrom
          A Map with connectionID as a key and an object with all the user connection data as a value
 
Fields inherited from class tigase.server.AbstractMessageReceiver
HOUR, INCOMING_FILTERS_PROP_KEY, INCOMING_FILTERS_PROP_VAL, MAX_QUEUE_SIZE_PROP_KEY, MAX_QUEUE_SIZE_PROP_VAL, maxQueueSize, MINUTE, OUTGOING_FILTERS_PROP_KEY, OUTGOING_FILTERS_PROP_VAL, SECOND
 
Fields inherited from class tigase.server.BasicComponent
admins, SCRIPTS_DIR_PROP_DEF, SCRIPTS_DIR_PROP_KEY, vHostManager
 
Fields inherited from interface tigase.conf.Configurable
ADMINS_PROP_KEY, AUTH_REPO_CLASS_PROP_KEY, AUTH_REPO_PARAMS_NODE, AUTH_REPO_URL_PROP_KEY, BOSH_COMP_CLASS_NAME, C2S_CLUST_COMP_CLASS_NAME, C2S_COMP_CLASS_NAME, CL_COMP_CLASS_NAME, CLUSTER_CONECT, CLUSTER_CONTR_CLASS_NAME, CLUSTER_LISTEN, CLUSTER_MODE, CLUSTER_NODES, CLUSTER_NODES_PROP_KEY, COMP_PROT_CLASS_NAME, COMPONENT_ID_PROP_KEY, DEF_BOSH_NAME, DEF_C2S_NAME, DEF_CL_COMP_NAME, DEF_CLUST_CONTR_NAME, DEF_COMP_PROT_NAME, DEF_EXT_COMP_NAME, DEF_HOSTNAME_PROP_KEY, DEF_S2S_NAME, DEF_SM_NAME, DEF_SRECV_NAME, DEF_SSEND_NAME, DEF_STATS_NAME, DEF_VHOST_MAN_NAME, DERBY_REPO_CLASS_PROP_VAL, DERBY_REPO_URL_PROP_VAL, DRUPAL_REPO_CLASS_PROP_VAL, DRUPAL_REPO_URL_PROP_VAL, EXT_COMP_CLASS_NAME, GEN_ADMINS, GEN_AUTH_DB, GEN_AUTH_DB_URI, GEN_COMP_CLASS, GEN_COMP_NAME, GEN_CONF, GEN_CONFIG, GEN_CONFIG_ALL, GEN_CONFIG_COMP, GEN_CONFIG_CS, GEN_CONFIG_DEF, GEN_CONFIG_SM, GEN_DEBUG, GEN_DEBUG_PACKAGES, GEN_EXT_COMP, GEN_MAX_QUEUE_SIZE, GEN_SCRIPT_DIR, GEN_SM_PLUGINS, GEN_SREC_ADMINS, GEN_SREC_DB, GEN_SREC_DB_URI, GEN_TEST, GEN_TRUSTED, GEN_USER_DB, GEN_USER_DB_URI, GEN_VIRT_HOSTS, HOSTNAMES_PROP_KEY, LIBRESOURCE_REPO_CLASS_PROP_VAL, LIBRESOURCE_REPO_URL_PROP_VAL, MONITORING, MYSQL_REPO_CLASS_PROP_VAL, MYSQL_REPO_URL_PROP_VAL, PGSQL_REPO_CLASS_PROP_VAL, PGSQL_REPO_URL_PROP_VAL, ROUTER_COMP_CLASS_NAME, S2S_CLUST_COMP_CLASS_NAME, S2S_COMP_CLASS_NAME, SHARED_AUTH_REPO_PARAMS_PROP_KEY, SHARED_AUTH_REPO_PROP_KEY, SHARED_USER_REPO_PARAMS_PROP_KEY, SHARED_USER_REPO_POOL_PROP_KEY, SHARED_USER_REPO_PROP_KEY, SM_CLUS_COMP_CLASS_NAME, SM_COMP_CLASS_NAME, SRECV_COMP_CLASS_NAME, SSEND_COMP_CLASS_NAME, STATS_CLASS_NAME, STRINGPREP_PROCESSOR, TIGASE_AUTH_REPO_CLASS_PROP_VAL, TIGASE_AUTH_REPO_URL_PROP_VAL, TIGASE_CUSTOM_AUTH_REPO_CLASS_PROP_VAL, TRUSTED_PROP_KEY, USER_REPO_CLASS_PROP_KEY, USER_REPO_PARAMS_NODE, USER_REPO_POOL_SIZE, USER_REPO_POOL_SIZE_PROP_KEY, USER_REPO_URL_PROP_KEY, VHOST_MAN_CLASS_NAME, XML_REPO_CLASS_PROP_VAL, XML_REPO_URL_PROP_VAL
 
Fields inherited from interface tigase.server.xmppsession.SessionManagerHandler
COMMIT_HANDLER_KEY
 
Fields inherited from interface tigase.disco.XMPPService
CMD_FEATURES, DEF_FEATURES, INFO_XMLNS, ITEMS_XMLNS
 
Constructor Summary
SessionManager()
           
 
Method Summary
protected  boolean addOutPacket(Packet packet)
           
protected  void addOutPackets(Packet packet, XMPPResourceConnection conn, Queue<Packet> results)
           
protected  boolean addTrusted(tigase.xmpp.JID jid)
           
protected  void closeConnection(tigase.xmpp.JID connectionId, boolean closeOnly)
           
protected  void closeSession(XMPPResourceConnection conn, boolean closeOnly)
           
 boolean containsJid(tigase.xmpp.JID jid)
          Method description
protected  XMPPResourceConnection createUserSession(tigase.xmpp.JID conn_id, String domain)
           
protected  boolean delTrusted(tigase.xmpp.JID jid)
           
protected  boolean fastAddOutPacket(Packet packet)
           
 tigase.xmpp.JID[] getConnectionIdsForJid(tigase.xmpp.JID jid)
          Method description
 Map<String,Object> getDefaults(Map<String,Object> params)
          Method description
 String getDiscoCategoryType()
          Method description
 String getDiscoDescription()
          Method description
 List<tigase.xml.Element> getDiscoFeatures(tigase.xmpp.JID from)
          Method description
 tigase.xml.Element getDiscoInfo(String node, tigase.xmpp.JID jid, tigase.xmpp.JID from)
          Method description
protected  Integer getMaxQueueSize(int def)
           
protected  XMPPResourceConnection getResourceConnection(tigase.xmpp.JID jid)
           
protected  XMPPSession getSession(tigase.xmpp.BareJID jid)
           
 void getStatistics(StatisticsList list)
          Method description
protected  XMPPResourceConnection getXMPPResourceConnection(tigase.xmpp.JID connId)
           
protected  XMPPResourceConnection getXMPPResourceConnection(Packet p)
           
 void handleLogin(String userName, XMPPResourceConnection conn)
          Method description
 void handleLogout(String userName, XMPPResourceConnection conn)
          Method description
 void handlePresenceSet(XMPPResourceConnection conn)
          Method description
 void handleResourceBind(XMPPResourceConnection conn)
          Method description
 boolean handlesLocalDomains()
          Method description
 boolean hasCompleteJidsInfo()
          Method description
 void initBindings(javax.script.Bindings binds)
          Method description
protected  boolean isBrokenPacket(Packet p)
           
 boolean isLocalDomain(String domain, boolean includeComponents)
          Method description
protected  boolean isTrusted(tigase.xmpp.JID jid)
           
protected  boolean isTrusted(String jid)
           
protected  XMPPResourceConnection loginUserSession(tigase.xmpp.JID conn_id, String domain, tigase.xmpp.BareJID user_id, String resource, ConnectionStatus conn_st, String xmpp_sessionId)
           
protected  boolean processAdminsOrDomains(Packet packet)
           
protected  boolean processCommand(Packet pc)
           
 int processingThreads()
          Method description
 void processPacket(Packet packet)
          Method description
protected  void processPacket(Packet packet, XMPPResourceConnection conn)
           
protected  void registerNewSession(tigase.xmpp.BareJID userId, XMPPResourceConnection conn)
           
protected  void sendToAdmins(Packet packet)
           
 void setName(String name)
          Method description
 void setProperties(Map<String,Object> props)
          Method description
 boolean skipPrivacy()
          Method description
 
Methods inherited from class tigase.server.AbstractMessageReceiver
addOutPacketNB, addOutPackets, addOutPacketWithTimeout, addPacket, addPacketNB, addPackets, addRegexRouting, addTimerTask, addTimerTask, clearRegexRoutings, everyHour, everyMinute, everySecond, getRegexRoutings, hashCodeForPacket, isInRegexRoutings, newPacketId, processPacket, release, removeRegexRouting, setMaxQueueSize, setParent, start, stop
 
Methods inherited from class tigase.server.BasicComponent
addComponentDomain, getComponentId, getDefHostName, getDiscoFeatures, getDiscoInfo, getDiscoItems, getDiscoItems, getName, getVHostItem, handlesNameSubdomains, handlesNonLocalDomains, initializationCompleted, isAdmin, isLocalDomain, isLocalDomainOrComponent, processScriptCommand, removeComponentDomain, removeServiceDiscoveryItem, setVHostManager, updateServiceDiscoveryItem, updateServiceDiscoveryItem, updateServiceDiscoveryItem
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface tigase.server.ServerComponent
getComponentId, getName, initializationCompleted, processPacket, release
 
Methods inherited from interface tigase.server.xmppsession.SessionManagerHandler
getComponentId
 
Methods inherited from interface tigase.server.MessageReceiver
getDefHostName
 

Field Detail

ADMIN_COMMAND_NODE

protected static final String ADMIN_COMMAND_NODE
See Also:
Constant Field Values

connectionsByFrom

protected ConcurrentHashMap<tigase.xmpp.JID,XMPPResourceConnection> connectionsByFrom
A Map with connectionID as a key and an object with all the user connection data as a value

Constructor Detail

SessionManager

public SessionManager()
Method Detail

containsJid

public boolean containsJid(tigase.xmpp.JID jid)
Method description

Specified by:
containsJid in interface OnlineJidsReporter
Parameters:
jid -
Returns:

getConnectionIdsForJid

public tigase.xmpp.JID[] getConnectionIdsForJid(tigase.xmpp.JID jid)
Method description

Specified by:
getConnectionIdsForJid in interface OnlineJidsReporter
Parameters:
jid -
Returns:

getDefaults

public Map<String,Object> getDefaults(Map<String,Object> params)
Method description

Specified by:
getDefaults in interface Configurable
Overrides:
getDefaults in class AbstractMessageReceiver
Parameters:
params -
Returns:

getDiscoCategoryType

public String getDiscoCategoryType()
Method description

Overrides:
getDiscoCategoryType in class BasicComponent
Returns:

getDiscoDescription

public String getDiscoDescription()
Method description

Overrides:
getDiscoDescription in class BasicComponent
Returns:

getDiscoFeatures

public List<tigase.xml.Element> getDiscoFeatures(tigase.xmpp.JID from)
Method description

Specified by:
getDiscoFeatures in interface XMPPService
Overrides:
getDiscoFeatures in class BasicComponent
Parameters:
from -
Returns:

getDiscoInfo

public tigase.xml.Element getDiscoInfo(String node,
                                       tigase.xmpp.JID jid,
                                       tigase.xmpp.JID from)
Method description

Specified by:
getDiscoInfo in interface XMPPService
Overrides:
getDiscoInfo in class BasicComponent
Parameters:
node -
jid -
from -
Returns:

getStatistics

public void getStatistics(StatisticsList list)
Method description

Specified by:
getStatistics in interface StatisticsContainer
Overrides:
getStatistics in class AbstractMessageReceiver
Parameters:
list -

handleLogin

public void handleLogin(String userName,
                        XMPPResourceConnection conn)
Method description

Specified by:
handleLogin in interface SessionManagerHandler
Parameters:
userName -
conn -

handleLogout

public void handleLogout(String userName,
                         XMPPResourceConnection conn)
Method description

Specified by:
handleLogout in interface SessionManagerHandler
Parameters:
userName -
conn -

handlePresenceSet

public void handlePresenceSet(XMPPResourceConnection conn)
Method description

Specified by:
handlePresenceSet in interface SessionManagerHandler
Parameters:
conn -

handleResourceBind

public void handleResourceBind(XMPPResourceConnection conn)
Method description

Specified by:
handleResourceBind in interface SessionManagerHandler
Parameters:
conn -

handlesLocalDomains

public boolean handlesLocalDomains()
Method description

Specified by:
handlesLocalDomains in interface VHostListener
Overrides:
handlesLocalDomains in class BasicComponent
Returns:

hasCompleteJidsInfo

public boolean hasCompleteJidsInfo()
Method description

Specified by:
hasCompleteJidsInfo in interface OnlineJidsReporter
Returns:

initBindings

public void initBindings(javax.script.Bindings binds)
Method description

Overrides:
initBindings in class BasicComponent
Parameters:
binds -

isLocalDomain

public boolean isLocalDomain(String domain,
                             boolean includeComponents)
Method description

Specified by:
isLocalDomain in interface SessionManagerHandler
Parameters:
domain -
includeComponents -
Returns:

processPacket

public void processPacket(Packet packet)
Method description

Specified by:
processPacket in class AbstractMessageReceiver
Parameters:
packet -

processingThreads

public int processingThreads()
Method description

Overrides:
processingThreads in class AbstractMessageReceiver
Returns:

setName

public void setName(String name)
Method description

Specified by:
setName in interface ServerComponent
Overrides:
setName in class AbstractMessageReceiver
Parameters:
name -

setProperties

public void setProperties(Map<String,Object> props)
Method description

Specified by:
setProperties in interface Configurable
Overrides:
setProperties in class AbstractMessageReceiver
Parameters:
props -

skipPrivacy

public boolean skipPrivacy()
Method description

Returns:

addOutPacket

protected boolean addOutPacket(Packet packet)
Overrides:
addOutPacket in class AbstractMessageReceiver

addOutPackets

protected void addOutPackets(Packet packet,
                             XMPPResourceConnection conn,
                             Queue<Packet> results)

addTrusted

protected boolean addTrusted(tigase.xmpp.JID jid)

closeConnection

protected void closeConnection(tigase.xmpp.JID connectionId,
                               boolean closeOnly)

closeSession

protected void closeSession(XMPPResourceConnection conn,
                            boolean closeOnly)

createUserSession

protected XMPPResourceConnection createUserSession(tigase.xmpp.JID conn_id,
                                                   String domain)
                                            throws tigase.util.TigaseStringprepException
Throws:
tigase.util.TigaseStringprepException

delTrusted

protected boolean delTrusted(tigase.xmpp.JID jid)

fastAddOutPacket

protected boolean fastAddOutPacket(Packet packet)

getMaxQueueSize

protected Integer getMaxQueueSize(int def)
Overrides:
getMaxQueueSize in class AbstractMessageReceiver

getResourceConnection

protected XMPPResourceConnection getResourceConnection(tigase.xmpp.JID jid)

getSession

protected XMPPSession getSession(tigase.xmpp.BareJID jid)

getXMPPResourceConnection

protected XMPPResourceConnection getXMPPResourceConnection(tigase.xmpp.JID connId)

getXMPPResourceConnection

protected XMPPResourceConnection getXMPPResourceConnection(Packet p)

isBrokenPacket

protected boolean isBrokenPacket(Packet p)

isTrusted

protected boolean isTrusted(tigase.xmpp.JID jid)

isTrusted

protected boolean isTrusted(String jid)

loginUserSession

protected XMPPResourceConnection loginUserSession(tigase.xmpp.JID conn_id,
                                                  String domain,
                                                  tigase.xmpp.BareJID user_id,
                                                  String resource,
                                                  ConnectionStatus conn_st,
                                                  String xmpp_sessionId)

processAdminsOrDomains

protected boolean processAdminsOrDomains(Packet packet)

processCommand

protected boolean processCommand(Packet pc)

processPacket

protected void processPacket(Packet packet,
                             XMPPResourceConnection conn)

registerNewSession

protected void registerNewSession(tigase.xmpp.BareJID userId,
                                  XMPPResourceConnection conn)

sendToAdmins

protected void sendToAdmins(Packet packet)


Copyright © 2001-2006 Tigase Developers Team. All rights Reserved.