public class SipApplicationSessionImpl extends Object implements MobicentsSipApplicationSession
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.
SipApplicationSession.Protocol| Modifier and Type | Field and Description |
|---|---|
protected long |
creationTime |
protected String |
currentRequestHandler |
protected long |
expirationTime |
protected SipApplicationSessionTimerTask |
expirationTimerTask |
protected boolean |
expired |
protected MobicentsSipApplicationSessionFacade |
facade |
protected Set<String> |
httpSessions |
protected boolean |
invalidateWhenReady |
protected boolean |
isValid |
protected AtomicBoolean |
isValidInternal |
protected String |
jvmRoute |
protected SipApplicationSessionKey |
key |
protected long |
lastAccessedTime |
protected boolean |
orphan |
protected boolean |
readyToInvalidate |
protected Semaphore |
semaphore |
protected ConcurrentHashMap<String,ServletTimer> |
servletTimers |
protected Map<String,Object> |
sipApplicationSessionAttributeMap |
protected long |
sipApplicationSessionTimeout |
protected SipContext |
sipContext
The first sip application for subsequent requests.
|
protected Set<SipSessionKey> |
sipSessions |
SIP_APPLICATION_KEY_PARAM_NAME| Modifier | Constructor and Description |
|---|---|
protected |
SipApplicationSessionImpl(SipApplicationSessionKey key,
SipContext sipContext) |
| Modifier and Type | Method and Description |
|---|---|
void |
access()
Update the accessed time information for this session.
|
void |
acquire() |
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 |
cancelAllTimers() |
void |
encodeURI(URI uri) |
URL |
encodeURL(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(Object obj) |
javax.servlet.http.HttpSession |
findHttpSession(String sessionId) |
String |
getApplicationName() |
Object |
getAttribute(String name) |
protected Map<String,Object> |
getAttributeMap() |
Iterator<String> |
getAttributeNames() |
long |
getCreationTime() |
String |
getCurrentRequestHandler() |
long |
getExpirationTime() |
long |
getExpirationTimeInternal() |
SipApplicationSessionTimerTask |
getExpirationTimerTask() |
MobicentsSipApplicationSession |
getFacade() |
protected Set<javax.servlet.http.HttpSession> |
getHttpSessions() |
String |
getId() |
boolean |
getInvalidateWhenReady() |
String |
getJvmRoute() |
SipApplicationSessionKey |
getKey() |
long |
getLastAccessedTime() |
Semaphore |
getSemaphore() |
Object |
getSession(String id,
SipApplicationSession.Protocol protocol) |
Iterator<?> |
getSessions() |
Iterator<?> |
getSessions(String protocol) |
long |
getSipApplicationSessionTimeout() |
SipContext |
getSipContext() |
SipSession |
getSipSession(String id) |
Set<MobicentsSipSession> |
getSipSessions() |
ServletTimer |
getTimer(String id) |
Collection<ServletTimer> |
getTimers() |
int |
hashCode() |
boolean |
hasTimerListener() |
void |
invalidate() |
void |
invalidate(boolean bypassCheck) |
boolean |
isExpired() |
boolean |
isOrphan() |
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 |
release() |
void |
removeAttribute(String name) |
void |
removeAttribute(String name,
boolean byPassValidCheck) |
boolean |
removeHttpSession(javax.servlet.http.HttpSession httpSession) |
void |
removeServletTimer(ServletTimer servletTimer,
boolean updateAppSessionReadyToInvalidateState)
Remove a servlet timer from this application session
|
SipSessionKey |
removeSipSession(MobicentsSipSession mobicentsSipSession) |
void |
scheduleAsynchronousWork(SipApplicationSessionAsynchronousWork work) |
void |
setAttribute(String key,
Object attribute) |
void |
setCurrentRequestHandler(String currentRequestHandler) |
void |
setExpirationTimerTask(SipApplicationSessionTimerTask expirationTimerTask) |
void |
setExpired(boolean hasExpired) |
int |
setExpires(int deltaMinutes) |
void |
setInvalidateWhenReady(boolean invalidateWhenReady) |
void |
setJvmRoute(String jvmRoute) |
void |
setKey(SipApplicationSessionKey key) |
protected void |
setLastAccessedTime(long lastAccessTime) |
void |
setOrphan(boolean orphan) |
protected void |
setValid(boolean isValid) |
String |
toString() |
void |
tryToInvalidate() |
protected transient Set<SipSessionKey> sipSessions
protected SipApplicationSessionKey key
protected long lastAccessedTime
protected long creationTime
protected long expirationTime
protected boolean expired
protected transient SipApplicationSessionTimerTask expirationTimerTask
protected transient ConcurrentHashMap<String,ServletTimer> servletTimers
protected transient AtomicBoolean isValidInternal
protected transient boolean isValid
protected boolean invalidateWhenReady
protected boolean readyToInvalidate
protected transient SipContext sipContext
protected String currentRequestHandler
protected transient Semaphore semaphore
protected transient MobicentsSipApplicationSessionFacade facade
protected long sipApplicationSessionTimeout
protected String jvmRoute
protected boolean orphan
protected SipApplicationSessionImpl(SipApplicationSessionKey key, SipContext sipContext)
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(String sessionId)
findHttpSession in interface MobicentsSipApplicationSessionpublic void encodeURI(URI uri)
encodeURI in interface SipApplicationSessionpublic URL encodeURL(URL url)
encodeURL in interface SipApplicationSessionpublic Object getAttribute(String name)
getAttribute in interface SipApplicationSessionpublic Iterator<String> getAttributeNames()
getAttributeNames in interface SipApplicationSessionpublic long getCreationTime()
getCreationTime in interface SipApplicationSessionpublic long getExpirationTime()
getExpirationTime in interface SipApplicationSessionpublic String getId()
getId in interface SipApplicationSessionpublic long getLastAccessedTime()
getLastAccessedTime in interface SipApplicationSessionprotected void setLastAccessedTime(long lastAccessTime)
public void access()
access in interface MobicentsSipApplicationSessionpublic Iterator<?> getSessions()
getSessions in interface SipApplicationSessionpublic Iterator<?> getSessions(String protocol)
getSessions in interface SipApplicationSessionpublic Set<MobicentsSipSession> getSipSessions()
getSipSessions in interface MobicentsSipApplicationSessionprotected Set<javax.servlet.http.HttpSession> getHttpSessions()
public SipSession getSipSession(String id)
getSipSession in interface SipApplicationSessionpublic Collection<ServletTimer> getTimers()
getTimers in interface SipApplicationSessionpublic void addServletTimer(ServletTimer servletTimer)
addServletTimer in interface MobicentsSipApplicationSessionservletTimer - the servlet timer to addpublic void removeServletTimer(ServletTimer servletTimer, boolean updateAppSessionReadyToInvalidateState)
removeServletTimer in interface MobicentsSipApplicationSessionservletTimer - the servlet timer to removepublic void invalidate()
invalidate in interface SipApplicationSessionpublic void invalidate(boolean bypassCheck)
invalidate in interface MobicentsSipApplicationSessionpublic void cancelAllTimers()
public boolean isValid()
isValid in interface SipApplicationSessionpublic boolean isValidInternal()
isValidInternal in interface MobicentsSipApplicationSessionprotected void setValid(boolean isValid)
isValid - the isValid to setpublic void removeAttribute(String name)
removeAttribute in interface SipApplicationSessionpublic void removeAttribute(String name, boolean byPassValidCheck)
public void setAttribute(String key, 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 String getApplicationName()
getApplicationName in interface SipApplicationSessionpublic ServletTimer getTimer(String id)
getTimer in interface SipApplicationSessionpublic void passivate()
public void activate()
public boolean getInvalidateWhenReady()
getInvalidateWhenReady in interface SipApplicationSessionpublic Object getSession(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(String currentRequestHandler)
setCurrentRequestHandler in interface MobicentsSipApplicationSessioncurrentServletHandler - the currentServletHandler to setpublic String getCurrentRequestHandler()
getCurrentRequestHandler in interface MobicentsSipApplicationSessionpublic Semaphore getSemaphore()
public MobicentsSipApplicationSession getFacade()
getFacade in interface MobicentsSipApplicationSessionpublic String getJvmRoute()
getJvmRoute in interface MobicentsSipApplicationSessionpublic void setJvmRoute(String jvmRoute)
setJvmRoute in interface MobicentsSipApplicationSessionpublic void setExpirationTimerTask(SipApplicationSessionTimerTask expirationTimerTask)
setExpirationTimerTask in interface MobicentsSipApplicationSessionpublic SipApplicationSessionTimerTask getExpirationTimerTask()
getExpirationTimerTask in interface MobicentsSipApplicationSessionpublic long getSipApplicationSessionTimeout()
getSipApplicationSessionTimeout in interface MobicentsSipApplicationSessionpublic void setExpired(boolean hasExpired)
setExpired in interface MobicentsSipApplicationSessionpublic long getExpirationTimeInternal()
getExpirationTimeInternal in interface MobicentsSipApplicationSessionpublic void scheduleAsynchronousWork(SipApplicationSessionAsynchronousWork work)
scheduleAsynchronousWork in interface SipApplicationSessionExtpublic void acquire()
acquire in interface MobicentsSipApplicationSessionpublic void release()
release in interface MobicentsSipApplicationSessionpublic boolean isOrphan()
isOrphan in interface MobicentsSipApplicationSessionpublic void setOrphan(boolean orphan)
setOrphan in interface MobicentsSipApplicationSessionCopyright © 2014. All Rights Reserved.