|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mobicents.servlet.sip.core.session.SipApplicationSessionImpl
public class SipApplicationSessionImpl
Implementation of the SipApplicationSession interface.
An instance of this sip application session can only be retrieved through the Session Manager
(extended class from Tomcat's manager classes implementing the Manager interface)
to constrain the creation of sip application session and to make sure that all sessions created
can be retrieved only through the session manager
As a SipApplicationSession represents a call (that can contain multiple call legs, in the B2BUA case by example), the call id and the app name are used as a unique key for a given SipApplicationSession instance.
| Nested Class Summary | |
|---|---|
class |
SipApplicationSessionImpl.SipApplicationSessionTimerTask
Timer task that will notify the listeners that the sip application session has expired It is an improved timer task that is delayed every time setLastAccessedTime is called on it. |
| Nested classes/interfaces inherited from interface javax.servlet.sip.SipApplicationSession |
|---|
SipApplicationSession.Protocol |
| Field Summary | |
|---|---|
protected long |
creationTime
|
protected java.lang.String |
currentRequestHandler
|
protected long |
expirationTime
|
protected java.util.concurrent.ScheduledFuture<MobicentsSipApplicationSession> |
expirationTimerFuture
|
protected SipApplicationSessionImpl.SipApplicationSessionTimerTask |
expirationTimerTask
|
protected boolean |
expired
|
protected MobicentsSipApplicationSessionFacade |
facade
|
protected java.util.concurrent.ConcurrentHashMap<java.lang.String,javax.servlet.http.HttpSession> |
httpSessions
|
protected boolean |
invalidateWhenReady
|
protected boolean |
isValid
|
protected java.lang.String |
jvmRoute
|
protected SipApplicationSessionKey |
key
|
protected long |
lastAccessedTime
|
protected boolean |
readyToInvalidate
|
protected java.util.concurrent.Semaphore |
semaphore
|
protected java.util.concurrent.ConcurrentHashMap<java.lang.String,ServletTimer> |
servletTimers
|
protected java.util.Map<java.lang.String,java.lang.Object> |
sipApplicationSessionAttributeMap
|
protected long |
sipApplicationSessionTimeout
|
protected SipContext |
sipContext
The first sip application for subsequent requests. |
protected java.util.concurrent.ConcurrentHashMap<java.lang.String,MobicentsSipSession> |
sipSessions
|
| Fields inherited from interface org.mobicents.servlet.sip.core.session.MobicentsSipApplicationSession |
|---|
SIP_APPLICATION_KEY_PARAM_NAME |
| Constructor Summary | |
|---|---|
protected |
SipApplicationSessionImpl(SipApplicationSessionKey key,
SipContext sipContext)
|
| Method Summary | |
|---|---|
void |
access()
Update the accessed time information for this session. |
void |
activate()
Perform internal processing required to activate this session. |
void |
addHttpSession(javax.servlet.http.HttpSession httpSession)
|
void |
addServletTimer(ServletTimer servletTimer)
Add a servlet timer to this application session |
void |
addSipSession(MobicentsSipSession mobicentsSipSession)
|
void |
encodeURI(URI uri)
|
java.net.URL |
encodeURL(java.net.URL url)
Adds a get parameter to the URL like this: http://hostname/link -> http://hostname/link? |
boolean |
equals(java.lang.Object obj)
|
javax.servlet.http.HttpSession |
findHttpSession(javax.servlet.http.HttpSession httpSession)
|
java.lang.String |
getApplicationName()
|
java.lang.Object |
getAttribute(java.lang.String name)
|
java.util.Iterator<java.lang.String> |
getAttributeNames()
|
long |
getCreationTime()
|
java.lang.String |
getCurrentRequestHandler()
|
long |
getExpirationTime()
|
java.lang.String |
getId()
|
boolean |
getInvalidateWhenReady()
|
java.lang.String |
getJvmRoute()
|
SipApplicationSessionKey |
getKey()
|
long |
getLastAccessedTime()
|
java.util.concurrent.Semaphore |
getSemaphore()
|
MobicentsSipApplicationSessionFacade |
getSession()
|
java.lang.Object |
getSession(java.lang.String id,
SipApplicationSession.Protocol protocol)
|
java.util.Iterator<?> |
getSessions()
|
java.util.Iterator<?> |
getSessions(java.lang.String protocol)
|
SipContext |
getSipContext()
|
SipSession |
getSipSession(java.lang.String id)
|
ServletTimer |
getTimer(java.lang.String id)
|
java.util.Collection<ServletTimer> |
getTimers()
|
int |
hashCode()
|
boolean |
hasTimerListener()
|
void |
invalidate()
|
boolean |
isExpired()
|
boolean |
isReadyToInvalidate()
|
boolean |
isValid()
|
void |
notifySipApplicationSessionListeners(SipApplicationSessionEventType sipApplicationSessionEventType)
Notifies the listeners that a lifecycle event occured on that sip application session |
void |
onSipSessionReadyToInvalidate(MobicentsSipSession mobicentsSipSession)
|
void |
passivate()
Perform the internal processing required to passivate this session. |
void |
removeAttribute(java.lang.String name)
|
javax.servlet.http.HttpSession |
removeHttpSession(javax.servlet.http.HttpSession httpSession)
|
void |
removeServletTimer(ServletTimer servletTimer)
Remove a servlet timer from this application session |
MobicentsSipSession |
removeSipSession(MobicentsSipSession mobicentsSipSession)
|
void |
setAttribute(java.lang.String key,
java.lang.Object attribute)
|
void |
setCurrentRequestHandler(java.lang.String currentRequestHandler)
|
int |
setExpires(int deltaMinutes)
|
void |
setInvalidateWhenReady(boolean invalidateWhenReady)
|
void |
setJvmRoute(java.lang.String jvmRoute)
|
void |
setKey(SipApplicationSessionKey key)
|
java.lang.String |
toString()
|
void |
tryToInvalidate()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected java.util.Map<java.lang.String,java.lang.Object> sipApplicationSessionAttributeMap
protected transient java.util.concurrent.ConcurrentHashMap<java.lang.String,MobicentsSipSession> sipSessions
protected transient java.util.concurrent.ConcurrentHashMap<java.lang.String,javax.servlet.http.HttpSession> httpSessions
protected SipApplicationSessionKey key
protected long lastAccessedTime
protected long creationTime
protected long expirationTime
protected boolean expired
protected transient SipApplicationSessionImpl.SipApplicationSessionTimerTask expirationTimerTask
protected transient java.util.concurrent.ScheduledFuture<MobicentsSipApplicationSession> expirationTimerFuture
protected transient java.util.concurrent.ConcurrentHashMap<java.lang.String,ServletTimer> servletTimers
protected boolean isValid
protected boolean invalidateWhenReady
protected boolean readyToInvalidate
protected transient SipContext sipContext
protected java.lang.String currentRequestHandler
protected transient java.util.concurrent.Semaphore semaphore
protected transient MobicentsSipApplicationSessionFacade facade
protected long sipApplicationSessionTimeout
protected java.lang.String jvmRoute
| Constructor Detail |
|---|
protected SipApplicationSessionImpl(SipApplicationSessionKey key,
SipContext sipContext)
| Method Detail |
|---|
public void notifySipApplicationSessionListeners(SipApplicationSessionEventType sipApplicationSessionEventType)
notifySipApplicationSessionListeners in interface MobicentsSipApplicationSessionsipApplicationSessionEventType - the type of event that happenedpublic void addSipSession(MobicentsSipSession mobicentsSipSession)
addSipSession in interface MobicentsSipApplicationSessionpublic MobicentsSipSession removeSipSession(MobicentsSipSession mobicentsSipSession)
public void addHttpSession(javax.servlet.http.HttpSession httpSession)
addHttpSession in interface MobicentsSipApplicationSessionpublic javax.servlet.http.HttpSession removeHttpSession(javax.servlet.http.HttpSession httpSession)
removeHttpSession in interface MobicentsSipApplicationSessionpublic javax.servlet.http.HttpSession findHttpSession(javax.servlet.http.HttpSession httpSession)
findHttpSession in interface MobicentsSipApplicationSessionpublic void encodeURI(URI uri)
encodeURI in interface SipApplicationSessionpublic java.net.URL encodeURL(java.net.URL url)
encodeURL in interface SipApplicationSessionpublic java.lang.Object getAttribute(java.lang.String name)
getAttribute in interface SipApplicationSessionpublic java.util.Iterator<java.lang.String> getAttributeNames()
getAttributeNames in interface SipApplicationSessionpublic long getCreationTime()
getCreationTime in interface SipApplicationSessionpublic long getExpirationTime()
getExpirationTime in interface SipApplicationSessionpublic java.lang.String getId()
getId in interface SipApplicationSessionpublic long getLastAccessedTime()
getLastAccessedTime in interface SipApplicationSessionpublic void access()
access in interface MobicentsSipApplicationSessionpublic java.util.Iterator<?> getSessions()
getSessions in interface SipApplicationSessionpublic java.util.Iterator<?> getSessions(java.lang.String protocol)
getSessions in interface SipApplicationSessionpublic SipSession getSipSession(java.lang.String id)
getSipSession in interface SipApplicationSessionpublic java.util.Collection<ServletTimer> getTimers()
getTimers in interface SipApplicationSessionpublic void addServletTimer(ServletTimer servletTimer)
addServletTimer in interface MobicentsSipApplicationSessionservletTimer - the servlet timer to addpublic void removeServletTimer(ServletTimer servletTimer)
removeServletTimer in interface MobicentsSipApplicationSessionservletTimer - the servlet timer to removepublic void invalidate()
invalidate in interface SipApplicationSessionpublic boolean isValid()
isValid in interface SipApplicationSessionpublic void removeAttribute(java.lang.String name)
removeAttribute in interface SipApplicationSession
public void setAttribute(java.lang.String key,
java.lang.Object attribute)
setAttribute in interface SipApplicationSessionpublic int setExpires(int deltaMinutes)
setExpires in interface SipApplicationSessionpublic boolean hasTimerListener()
hasTimerListener in interface MobicentsSipApplicationSessionpublic SipContext getSipContext()
getSipContext in interface MobicentsSipApplicationSessionpublic SipApplicationSessionKey getKey()
getKey in interface MobicentsSipApplicationSessionpublic void setKey(SipApplicationSessionKey key)
key - the key to setpublic java.lang.String getApplicationName()
getApplicationName in interface SipApplicationSessionpublic ServletTimer getTimer(java.lang.String id)
getTimer in interface SipApplicationSessionpublic void passivate()
public void activate()
public boolean getInvalidateWhenReady()
getInvalidateWhenReady in interface SipApplicationSession
public java.lang.Object getSession(java.lang.String id,
SipApplicationSession.Protocol protocol)
getSession in interface SipApplicationSessionpublic boolean isReadyToInvalidate()
isReadyToInvalidate in interface SipApplicationSessionpublic void setInvalidateWhenReady(boolean invalidateWhenReady)
setInvalidateWhenReady in interface SipApplicationSessionpublic void onSipSessionReadyToInvalidate(MobicentsSipSession mobicentsSipSession)
onSipSessionReadyToInvalidate in interface MobicentsSipApplicationSessionpublic void tryToInvalidate()
tryToInvalidate in interface MobicentsSipApplicationSessionpublic boolean isExpired()
isExpired in interface MobicentsSipApplicationSessionpublic void setCurrentRequestHandler(java.lang.String currentRequestHandler)
setCurrentRequestHandler in interface MobicentsSipApplicationSessioncurrentServletHandler - the currentServletHandler to setpublic java.lang.String getCurrentRequestHandler()
getCurrentRequestHandler in interface MobicentsSipApplicationSessionpublic java.util.concurrent.Semaphore getSemaphore()
getSemaphore in interface MobicentsSipApplicationSessionpublic MobicentsSipApplicationSessionFacade getSession()
getSession in interface MobicentsSipApplicationSessionpublic java.lang.String getJvmRoute()
getJvmRoute in interface MobicentsSipApplicationSessionpublic void setJvmRoute(java.lang.String jvmRoute)
setJvmRoute in interface MobicentsSipApplicationSessionpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||