org.mobicents.servlet.sip.message
Class MobicentsSipApplicationSessionFacade

java.lang.Object
  extended by org.mobicents.servlet.sip.message.MobicentsSipApplicationSessionFacade
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, SipApplicationSession, SipApplicationSessionExt, MobicentsSipApplicationSession

public class MobicentsSipApplicationSessionFacade
extends java.lang.Object
implements MobicentsSipApplicationSession, java.io.Externalizable

The purpose of this class is to be a facade to the real sip application session as well as a serializable session class that can be put as a session attribute in other sessions or even its own session. Basically instead of replicating the whole attribute map, we will replicate the id, then on the remote side we will read the ID and look it up in the remote session manager.

Author:
vralev, jean.deruelle@gmail.com
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface javax.servlet.sip.SipApplicationSession
SipApplicationSession.Protocol
 
Field Summary
 
Fields inherited from interface org.mobicents.servlet.sip.core.session.MobicentsSipApplicationSession
SIP_APPLICATION_KEY_PARAM_NAME
 
Constructor Summary
MobicentsSipApplicationSessionFacade()
           
MobicentsSipApplicationSessionFacade(MobicentsSipApplicationSession sipApplicationSession)
           
 
Method Summary
 void access()
           
 boolean addHttpSession(javax.servlet.http.HttpSession httpSession)
           
 void addServletTimer(ServletTimer servletTimer)
           
 boolean addSipSession(MobicentsSipSession mobicentsSipSession)
           
 void encodeURI(URI uri)
           
 java.net.URL encodeURL(java.net.URL url)
           
 boolean equals(java.lang.Object obj)
           
 javax.servlet.http.HttpSession findHttpSession(java.lang.String id)
           
 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()
           
 long getExpirationTimeInternal()
           
 SipApplicationSessionTimerTask getExpirationTimerTask()
           
 java.lang.String getId()
           
 boolean getInvalidateWhenReady()
           
 java.lang.String getJvmRoute()
           
 SipApplicationSessionKey getKey()
           
 long getLastAccessedTime()
           
 MobicentsSipApplicationSession getMobicentstSipApplicationSession()
           
 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)
           
 long getSipApplicationSessionTimeout()
           
 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 expiration)
           
 void onSipSessionReadyToInvalidate(MobicentsSipSession mobicentsSipSession)
           
 void readExternal(java.io.ObjectInput arg0)
           
 void removeAttribute(java.lang.String name)
           
 boolean removeHttpSession(javax.servlet.http.HttpSession httpSession)
           
 void removeServletTimer(ServletTimer servletTimer)
           
 void scheduleAsynchronousWork(SipApplicationSessionAsynchronousWork work)
           
 void setAttribute(java.lang.String name, 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)
           
 java.lang.String toString()
           
 void tryToInvalidate()
           
 void writeExternal(java.io.ObjectOutput arg0)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MobicentsSipApplicationSessionFacade

public MobicentsSipApplicationSessionFacade()

MobicentsSipApplicationSessionFacade

public MobicentsSipApplicationSessionFacade(MobicentsSipApplicationSession sipApplicationSession)
Method Detail

getMobicentstSipApplicationSession

public MobicentsSipApplicationSession getMobicentstSipApplicationSession()

access

public void access()
Specified by:
access in interface MobicentsSipApplicationSession

addHttpSession

public boolean addHttpSession(javax.servlet.http.HttpSession httpSession)
Specified by:
addHttpSession in interface MobicentsSipApplicationSession

addServletTimer

public void addServletTimer(ServletTimer servletTimer)
Specified by:
addServletTimer in interface MobicentsSipApplicationSession

addSipSession

public boolean addSipSession(MobicentsSipSession mobicentsSipSession)
Specified by:
addSipSession in interface MobicentsSipApplicationSession

findHttpSession

public javax.servlet.http.HttpSession findHttpSession(java.lang.String id)
Specified by:
findHttpSession in interface MobicentsSipApplicationSession

getCurrentRequestHandler

public java.lang.String getCurrentRequestHandler()
Specified by:
getCurrentRequestHandler in interface MobicentsSipApplicationSession

getKey

public SipApplicationSessionKey getKey()
Specified by:
getKey in interface MobicentsSipApplicationSession

getSemaphore

public java.util.concurrent.Semaphore getSemaphore()
Specified by:
getSemaphore in interface MobicentsSipApplicationSession

getSipContext

public SipContext getSipContext()
Specified by:
getSipContext in interface MobicentsSipApplicationSession

hasTimerListener

public boolean hasTimerListener()
Specified by:
hasTimerListener in interface MobicentsSipApplicationSession

isExpired

public boolean isExpired()
Specified by:
isExpired in interface MobicentsSipApplicationSession

notifySipApplicationSessionListeners

public void notifySipApplicationSessionListeners(SipApplicationSessionEventType expiration)
Specified by:
notifySipApplicationSessionListeners in interface MobicentsSipApplicationSession

onSipSessionReadyToInvalidate

public void onSipSessionReadyToInvalidate(MobicentsSipSession mobicentsSipSession)
Specified by:
onSipSessionReadyToInvalidate in interface MobicentsSipApplicationSession

removeHttpSession

public boolean removeHttpSession(javax.servlet.http.HttpSession httpSession)
Specified by:
removeHttpSession in interface MobicentsSipApplicationSession

removeServletTimer

public void removeServletTimer(ServletTimer servletTimer)
Specified by:
removeServletTimer in interface MobicentsSipApplicationSession

setCurrentRequestHandler

public void setCurrentRequestHandler(java.lang.String currentRequestHandler)
Specified by:
setCurrentRequestHandler in interface MobicentsSipApplicationSession

tryToInvalidate

public void tryToInvalidate()
Specified by:
tryToInvalidate in interface MobicentsSipApplicationSession

encodeURI

public void encodeURI(URI uri)
Specified by:
encodeURI in interface SipApplicationSession

encodeURL

public java.net.URL encodeURL(java.net.URL url)
Specified by:
encodeURL in interface SipApplicationSession

getApplicationName

public java.lang.String getApplicationName()
Specified by:
getApplicationName in interface SipApplicationSession

getAttribute

public java.lang.Object getAttribute(java.lang.String name)
Specified by:
getAttribute in interface SipApplicationSession

getAttributeNames

public java.util.Iterator<java.lang.String> getAttributeNames()
Specified by:
getAttributeNames in interface SipApplicationSession

getCreationTime

public long getCreationTime()
Specified by:
getCreationTime in interface SipApplicationSession

getExpirationTime

public long getExpirationTime()
Specified by:
getExpirationTime in interface SipApplicationSession

getId

public java.lang.String getId()
Specified by:
getId in interface SipApplicationSession

getInvalidateWhenReady

public boolean getInvalidateWhenReady()
Specified by:
getInvalidateWhenReady in interface SipApplicationSession

getLastAccessedTime

public long getLastAccessedTime()
Specified by:
getLastAccessedTime in interface SipApplicationSession

getSession

public java.lang.Object getSession(java.lang.String id,
                                   SipApplicationSession.Protocol protocol)
Specified by:
getSession in interface SipApplicationSession

getSessions

public java.util.Iterator<?> getSessions()
Specified by:
getSessions in interface SipApplicationSession

getSessions

public java.util.Iterator<?> getSessions(java.lang.String protocol)
Specified by:
getSessions in interface SipApplicationSession

getSipSession

public SipSession getSipSession(java.lang.String id)
Specified by:
getSipSession in interface SipApplicationSession

getTimer

public ServletTimer getTimer(java.lang.String id)
Specified by:
getTimer in interface SipApplicationSession

getTimers

public java.util.Collection<ServletTimer> getTimers()
Specified by:
getTimers in interface SipApplicationSession

invalidate

public void invalidate()
Specified by:
invalidate in interface SipApplicationSession

isReadyToInvalidate

public boolean isReadyToInvalidate()
Specified by:
isReadyToInvalidate in interface SipApplicationSession

isValid

public boolean isValid()
Specified by:
isValid in interface SipApplicationSession

isValidInternal

public boolean isValidInternal()
Specified by:
isValidInternal in interface MobicentsSipApplicationSession

removeAttribute

public void removeAttribute(java.lang.String name)
Specified by:
removeAttribute in interface SipApplicationSession

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.Object attribute)
Specified by:
setAttribute in interface SipApplicationSession

setExpires

public int setExpires(int deltaMinutes)
Specified by:
setExpires in interface SipApplicationSession

setInvalidateWhenReady

public void setInvalidateWhenReady(boolean invalidateWhenReady)
Specified by:
setInvalidateWhenReady in interface SipApplicationSession

getSession

public MobicentsSipApplicationSessionFacade getSession()
Specified by:
getSession in interface MobicentsSipApplicationSession

readExternal

public void readExternal(java.io.ObjectInput arg0)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable
Throws:
java.io.IOException
java.lang.ClassNotFoundException

writeExternal

public void writeExternal(java.io.ObjectOutput arg0)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable
Throws:
java.io.IOException

getJvmRoute

public java.lang.String getJvmRoute()
Specified by:
getJvmRoute in interface MobicentsSipApplicationSession

setJvmRoute

public void setJvmRoute(java.lang.String jvmRoute)
Specified by:
setJvmRoute in interface MobicentsSipApplicationSession

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

setExpirationTimerTask

public void setExpirationTimerTask(SipApplicationSessionTimerTask expirationTimerTask)
Specified by:
setExpirationTimerTask in interface MobicentsSipApplicationSession

setExpired

public void setExpired(boolean hasExpired)
Specified by:
setExpired in interface MobicentsSipApplicationSession

getExpirationTimeInternal

public long getExpirationTimeInternal()
Specified by:
getExpirationTimeInternal in interface MobicentsSipApplicationSession

getSipSessions

public java.util.Set<MobicentsSipSession> getSipSessions()
Specified by:
getSipSessions in interface MobicentsSipApplicationSession

getExpirationTimerTask

public SipApplicationSessionTimerTask getExpirationTimerTask()
Specified by:
getExpirationTimerTask in interface MobicentsSipApplicationSession

scheduleAsynchronousWork

public void scheduleAsynchronousWork(SipApplicationSessionAsynchronousWork work)
Specified by:
scheduleAsynchronousWork in interface SipApplicationSessionExt

getSipApplicationSessionTimeout

public long getSipApplicationSessionTimeout()
Specified by:
getSipApplicationSessionTimeout in interface MobicentsSipApplicationSession

invalidate

public void invalidate(boolean bypassCheck)
Specified by:
invalidate in interface MobicentsSipApplicationSession


Copyright © 2010. All Rights Reserved.