org.mobicents.servlet.sip.core.session
Class SipStandardManager

java.lang.Object
  extended by org.apache.catalina.session.ManagerBase
      extended by org.apache.catalina.session.StandardManager
          extended by org.mobicents.servlet.sip.core.session.SipStandardManager
All Implemented Interfaces:
java.beans.PropertyChangeListener, java.util.EventListener, javax.management.MBeanRegistration, org.apache.catalina.Lifecycle, org.apache.catalina.Manager, SipManager

public class SipStandardManager
extends org.apache.catalina.session.StandardManager
implements SipManager

Extension of the Standard implementation of the Manager interface provided by Tomcat to be able to make the httpsession available as ConvergedHttpSession as for Spec JSR289 Section 13.5 and to handle management of sip sessions and sip application sessions for a given container (context)

Author:
Jean Deruelle

Field Summary
protected static java.lang.String info
          The descriptive information about this implementation.
 
Fields inherited from class org.apache.catalina.session.StandardManager
lifecycle, maxActiveSessions, name, pathname, processingTime, rejectedSessions, started
 
Fields inherited from class org.apache.catalina.session.ManagerBase
algorithm, container, DEFAULT_ALGORITHM, devRandomSource, digest, distributable, domain, duplicates, entropy, expiredSessions, initialized, log, maxActive, maxInactiveInterval, mserver, oname, processExpiresFrequency, random, randomClass, randomIS, sessionAverageAliveTime, sessionCounter, sessionIdLength, sessionMaxAliveTime, sessions, sm, support
 
Fields inherited from interface org.apache.catalina.Lifecycle
AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, DESTROY_EVENT, INIT_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT
 
Constructor Summary
SipStandardManager()
           
 
Method Summary
 void dumpSipApplicationSessions()
           
 void dumpSipSessions()
           
 MobicentsSipApplicationSession findSipApplicationSession(javax.servlet.http.HttpSession httpSession)
          Retrieves the sip application session holding the converged http session in parameter
 java.util.Iterator<MobicentsSipApplicationSession> getAllSipApplicationSessions()
          
 java.util.Iterator<MobicentsSipSession> getAllSipSessions()
          
 org.apache.catalina.Container getContainer()
           
protected  org.apache.catalina.session.StandardSession getNewSession()
           
 MobicentsSipApplicationSession getSipApplicationSession(SipApplicationSessionKey key, boolean create)
          Retrieve a sip application session from its key.
 SipFactoryImpl getSipFactoryImpl()
           
 MobicentsSipSession getSipSession(SipSessionKey key, boolean create, SipFactoryImpl sipFactoryImpl, MobicentsSipApplicationSession sipApplicationSessionImpl)
          Retrieve a sip session from its key.
 void removeAllSessions()
          Remove the sip sessions and sip application sessions
 MobicentsSipApplicationSession removeSipApplicationSession(SipApplicationSessionKey key)
          Removes a sip application session from the manager by its key
 MobicentsSipSession removeSipSession(SipSessionKey key)
          Removes a sip session from the manager by its key
 void setContainer(org.apache.catalina.Container container)
           
 void setSipFactoryImpl(SipFactoryImpl sipFactoryImpl)
           
 
Methods inherited from class org.apache.catalina.session.StandardManager
addLifecycleListener, createSession, doLoad, doUnload, file, findLifecycleListeners, getInfo, getMaxActiveSessions, getName, getPathname, getRejectedSessions, load, propertyChange, removeLifecycleListener, setMaxActiveSessions, setPathname, setRejectedSessions, start, stop, unload
 
Methods inherited from class org.apache.catalina.session.ManagerBase
add, addPropertyChangeListener, backgroundProcess, createEmptySession, createSession, destroy, expireSession, findSession, findSessions, generateSessionId, getActiveSessions, getAlgorithm, getClassName, getDigest, getDistributable, getDomain, getDuplicates, getEngine, getEntropy, getExpiredSessions, getJvmRoute, getLastAccessedTime, getMaxActive, getMaxInactiveInterval, getObjectName, getProcessExpiresFrequency, getProcessingTime, getRandom, getRandomBytes, getRandomClass, getRandomFile, getSession, getSessionAttribute, getSessionAverageAliveTime, getSessionCounter, getSessionIdLength, getSessionMaxAliveTime, init, listSessionIds, postDeregister, postRegister, preDeregister, preRegister, processExpires, remove, removePropertyChangeListener, setAlgorithm, setDistributable, setDuplicates, setEntropy, setExpiredSessions, setMaxActive, setMaxInactiveInterval, setProcessExpiresFrequency, setProcessingTime, setRandomClass, setRandomFile, setSessionAverageAliveTime, setSessionCounter, setSessionIdLength, setSessionMaxAliveTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.catalina.Manager
add, addPropertyChangeListener, backgroundProcess, createEmptySession, createSession, createSession, findSession, findSessions, getActiveSessions, getDistributable, getExpiredSessions, getInfo, getMaxActive, getMaxInactiveInterval, getRejectedSessions, getSessionAverageAliveTime, getSessionCounter, getSessionIdLength, getSessionMaxAliveTime, load, remove, removePropertyChangeListener, setDistributable, setExpiredSessions, setMaxActive, setMaxInactiveInterval, setRejectedSessions, setSessionAverageAliveTime, setSessionCounter, setSessionIdLength, setSessionMaxAliveTime, unload
 

Field Detail

info

protected static final java.lang.String info
The descriptive information about this implementation.

See Also:
Constant Field Values
Constructor Detail

SipStandardManager

public SipStandardManager()
Parameters:
sipFactoryImpl -
Method Detail

getNewSession

protected org.apache.catalina.session.StandardSession getNewSession()
Overrides:
getNewSession in class org.apache.catalina.session.ManagerBase

getSipFactoryImpl

public SipFactoryImpl getSipFactoryImpl()
Specified by:
getSipFactoryImpl in interface SipManager
Returns:
the SipFactoryImpl

setSipFactoryImpl

public void setSipFactoryImpl(SipFactoryImpl sipFactoryImpl)
Specified by:
setSipFactoryImpl in interface SipManager
Parameters:
sipFactoryImpl - the SipFactoryImpl to set

getContainer

public org.apache.catalina.Container getContainer()
Specified by:
getContainer in interface org.apache.catalina.Manager
Overrides:
getContainer in class org.apache.catalina.session.ManagerBase
Returns:
the container

setContainer

public void setContainer(org.apache.catalina.Container container)
Specified by:
setContainer in interface org.apache.catalina.Manager
Overrides:
setContainer in class org.apache.catalina.session.StandardManager
Parameters:
container - the container to set

removeSipSession

public MobicentsSipSession removeSipSession(SipSessionKey key)
Removes a sip session from the manager by its key

Specified by:
removeSipSession in interface SipManager
Parameters:
key - the identifier for this session
Returns:
the sip session that had just been removed, null otherwise

removeSipApplicationSession

public MobicentsSipApplicationSession removeSipApplicationSession(SipApplicationSessionKey key)
Removes a sip application session from the manager by its key

Specified by:
removeSipApplicationSession in interface SipManager
Parameters:
key - the identifier for this session
Returns:
the sip application session that had just been removed, null otherwise

getSipApplicationSession

public MobicentsSipApplicationSession getSipApplicationSession(SipApplicationSessionKey key,
                                                               boolean create)
Retrieve a sip application session from its key. If none exists, one can enforce the creation through the create parameter to true.

Specified by:
getSipApplicationSession in interface SipManager
Parameters:
key - the key identifying the sip application session to retrieve
create - if set to true, if no session has been found one will be created
Returns:
the sip application session matching the key

getSipSession

public MobicentsSipSession getSipSession(SipSessionKey key,
                                         boolean create,
                                         SipFactoryImpl sipFactoryImpl,
                                         MobicentsSipApplicationSession sipApplicationSessionImpl)
Retrieve a sip session from its key. If none exists, one can enforce the creation through the create parameter to true. the sip factory cannot be null if create is set to true.

Specified by:
getSipSession in interface SipManager
Parameters:
key - the key identifying the sip session to retrieve
create - if set to true, if no session has been found one will be created
sipFactoryImpl - needed only for sip session creation.
sipApplicationSessionImpl - to associate the SipSession with if create is set to true, if false it won't be used
Returns:
the sip session matching the key

getAllSipSessions

public java.util.Iterator<MobicentsSipSession> getAllSipSessions()


getAllSipApplicationSessions

public java.util.Iterator<MobicentsSipApplicationSession> getAllSipApplicationSessions()


findSipApplicationSession

public MobicentsSipApplicationSession findSipApplicationSession(javax.servlet.http.HttpSession httpSession)
Retrieves the sip application session holding the converged http session in parameter

Specified by:
findSipApplicationSession in interface SipManager
Returns:
the sip application session holding a reference to it or null if none references it

dumpSipSessions

public void dumpSipSessions()
Specified by:
dumpSipSessions in interface SipManager

dumpSipApplicationSessions

public void dumpSipApplicationSessions()
Specified by:
dumpSipApplicationSessions in interface SipManager

removeAllSessions

public void removeAllSessions()
Remove the sip sessions and sip application sessions

Specified by:
removeAllSessions in interface SipManager


Copyright © 2008. All Rights Reserved.