|
||||||||||
| 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 |
|---|
| 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 SipApplicationSessionTimerTask |
expirationTimerTask
|
protected boolean |
expired
|
protected MobicentsSipApplicationSessionFacade |
facade
|
protected java.util.Set<java.lang.String> |
httpSessions
|
protected boolean |
invalidateWhenReady
|
protected boolean |
isValid
|
protected java.util.concurrent.atomic.AtomicBoolean |
isValidInternal
|
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.Set<SipSessionKey> |
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. |
boolean |
addHttpSession(javax.servlet.http.HttpSession httpSession)
|
void |
addServletTimer(ServletTimer servletTimer)
Add a servlet timer to this application session |
boolean |
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?org.mobicents.servlet.sip.ApplicationSessionKey=0 http://hostname/link?something=1 -> http://hostname/link?something=1&org.mobicents.servlet.sip.ApplicationSessionKey=0 |
boolean |
equals(java.lang.Object obj)
|
javax.servlet.http.HttpSession |
findHttpSession(java.lang.String sessionId)
|
java.lang.String |
getApplicationName()
|
java.lang.Object |
getAttribute(java.lang.String name)
|
protected java.util.Map<java.lang.String,java.lang.Object> |
getAttributeMap()
|
java.util.Iterator<java.lang.String> |
getAttributeNames()
|
long |
getCreationTime()
|
java.lang.String |
getCurrentRequestHandler()
|
long |
getExpirationTime()
|
long |
getExpirationTimeInternal()
|
SipApplicationSessionTimerTask |
getExpirationTimerTask()
|
protected java.util.Set<javax.servlet.http.HttpSession> |
getHttpSessions()
|
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)
|
java.util.Set<MobicentsSipSession> |
getSipSessions()
|
ServletTimer |
getTimer(java.lang.String id)
|
java.util.Collection<ServletTimer> |
getTimers()
|
int |
hashCode()
|
boolean |
hasTimerListener()
|
void |
invalidate()
|
void |
invalidate(boolean bypassCheck)
|
boolean |
isExpired()
|
boolean |
isReadyToInvalidate()
|
boolean |
isValid()
|
boolean |
isValidInternal()
|
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)
|
void |
removeAttribute(java.lang.String name,
boolean byPassValidCheck)
|
boolean |
removeHttpSession(javax.servlet.http.HttpSession httpSession)
|
void |
removeServletTimer(ServletTimer servletTimer)
Remove a servlet timer from this application session |
SipSessionKey |
removeSipSession(MobicentsSipSession mobicentsSipSession)
|
void |
setAttribute(java.lang.String key,
java.lang.Object attribute)
|
void |
setCurrentRequestHandler(java.lang.String currentRequestHandler)
|
void |
setExpirationTimerTask(SipApplicationSessionTimerTask expirationTimerTask)
|
void |
setExpired(boolean hasExpired)
|
int |
setExpires(int deltaMinutes)
|
void |
setInvalidateWhenReady(boolean invalidateWhenReady)
|
void |
setJvmRoute(java.lang.String jvmRoute)
|
void |
setKey(SipApplicationSessionKey key)
|
protected void |
setValid(boolean isValid)
|
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.Set<SipSessionKey> sipSessions
protected transient java.util.Set<java.lang.String> httpSessions
protected SipApplicationSessionKey key
protected long lastAccessedTime
protected long creationTime
protected long expirationTime
protected boolean expired
protected transient SipApplicationSessionTimerTask expirationTimerTask
protected transient java.util.concurrent.ConcurrentHashMap<java.lang.String,ServletTimer> servletTimers
protected transient java.util.concurrent.atomic.AtomicBoolean isValidInternal
protected transient 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 |
|---|
protected java.util.Map<java.lang.String,java.lang.Object> getAttributeMap()
public void notifySipApplicationSessionListeners(SipApplicationSessionEventType sipApplicationSessionEventType)
notifySipApplicationSessionListeners in interface MobicentsSipApplicationSessionsipApplicationSessionEventType - the type of event that happenedpublic boolean addSipSession(MobicentsSipSession mobicentsSipSession)
addSipSession in interface MobicentsSipApplicationSessionpublic SipSessionKey removeSipSession(MobicentsSipSession mobicentsSipSession)
public boolean addHttpSession(javax.servlet.http.HttpSession httpSession)
addHttpSession in interface MobicentsSipApplicationSessionpublic boolean removeHttpSession(javax.servlet.http.HttpSession httpSession)
removeHttpSession in interface MobicentsSipApplicationSessionpublic javax.servlet.http.HttpSession findHttpSession(java.lang.String sessionId)
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 java.util.Set<MobicentsSipSession> getSipSessions()
getSipSessions in interface MobicentsSipApplicationSessionprotected java.util.Set<javax.servlet.http.HttpSession> getHttpSessions()
public 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 void invalidate(boolean bypassCheck)
public boolean isValid()
isValid in interface SipApplicationSessionpublic boolean isValidInternal()
isValidInternal in interface MobicentsSipApplicationSessionprotected void setValid(boolean isValid)
isValid - the isValid to setpublic void removeAttribute(java.lang.String name)
removeAttribute in interface SipApplicationSession
public void removeAttribute(java.lang.String name,
boolean byPassValidCheck)
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.Objectpublic void setExpirationTimerTask(SipApplicationSessionTimerTask expirationTimerTask)
setExpirationTimerTask in interface MobicentsSipApplicationSessionpublic SipApplicationSessionTimerTask getExpirationTimerTask()
getExpirationTimerTask in interface MobicentsSipApplicationSessionpublic void setExpired(boolean hasExpired)
setExpired in interface MobicentsSipApplicationSessionpublic long getExpirationTimeInternal()
getExpirationTimeInternal in interface MobicentsSipApplicationSession
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||