|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mobicents.servlet.sip.core.session.SipSessionImpl
public class SipSessionImpl
Implementation of the SipSession interface.
An instance of this sip 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 session and to make sure that all sessions created
can be retrieved only through the session manager
As a SipApplicationSession represents a dialog, the call id and from header URI, from tag, to Header (and to Tag to identify forked requests) are used as a unique key for a given SipSession instance.
| Nested Class Summary | |
|---|---|
protected static class |
SipSessionImpl.SipSessionEventType
|
| Nested classes/interfaces inherited from interface javax.servlet.sip.SipSession |
|---|
SipSession.State |
| Field Summary | |
|---|---|
protected B2buaHelperImpl |
b2buaHelper
|
protected long |
creationTime
Creation time. |
protected java.util.concurrent.ConcurrentHashMap<java.lang.String,MobicentsSipSession> |
derivedSipSessions
|
protected java.util.concurrent.ThreadPoolExecutor |
executorService
|
protected java.lang.String |
handlerServlet
The name of the servlet withing this same app to handle all subsequent requests. |
protected boolean |
invalidateWhenReady
|
protected boolean |
isValid
Is the session valid. |
protected SipSessionKey |
key
|
protected long |
lastAccessedTime
Last access time. |
protected Address |
localParty
|
protected boolean |
okToByeSentOrReceived
|
protected java.util.Set<javax.sip.Transaction> |
ongoingTransactions
|
protected javax.sip.Transaction |
originalTransaction
|
protected SipURI |
outboundInterface
Outbound interface is one of the allowed values in the Servlet Context attribute "javax.servlet.ip.outboundinterfaces" This one is not serialized, it has to be reset by the app on sessionActivated listener method |
protected MobicentsSipSession |
parentSession
|
protected ProxyImpl |
proxy
|
protected boolean |
readyToInvalidate
|
protected Address |
remoteParty
|
protected SipApplicationRoutingRegion |
routingRegion
Routing region per session/dialog. |
protected javax.sip.Dialog |
sessionCreatingDialog
We use this for dialog-related requests. |
protected javax.sip.Transaction |
sessionCreatingTransaction
We use this for REGISTER, where a dialog doesn't exist to carry the session info. |
protected MobicentsSipApplicationSession |
sipApplicationSession
|
protected SipFactoryImpl |
sipFactory
|
protected java.util.Map<java.lang.String,java.lang.Object> |
sipSessionAttributeMap
|
protected SipSession.State |
state
Current state of the session, one of INTITIAL, EARLY, ESTABLISHED and TERMINATED. |
protected java.io.Serializable |
stateInfo
AR state info |
protected URI |
subscriberURI
Subscriber URI should be set for outbound sessions, from requests created in the container. |
protected java.util.Set<javax.sip.header.EventHeader> |
subscriptions
|
protected java.security.Principal |
userPrincipal
|
| Constructor Summary | |
|---|---|
protected |
SipSessionImpl(SipSessionKey key,
SipFactoryImpl sipFactoryImpl,
MobicentsSipApplicationSession mobicentsSipApplicationSession)
|
| Method Summary | |
|---|---|
void |
access()
Update the accessed time information for this session. |
void |
activate()
Perform internal processing required to activate this session. |
void |
addDerivedSipSessions(MobicentsSipSession derivedSession)
Add the derived sip session it will be identified by the To tag from its key |
void |
addOngoingTransaction(javax.sip.Transaction transaction)
Add an ongoing tx to the session. |
void |
addSubscription(SipServletMessageImpl sipServletMessageImpl)
|
SipServletRequest |
createRequest(java.lang.String method)
|
MobicentsSipSession |
findDerivedSipSession(java.lang.String toTag)
Find the derived sip session identified by its to tag |
SipApplicationSession |
getApplicationSession()
|
java.lang.Object |
getAttribute(java.lang.String name)
|
java.util.Enumeration<java.lang.String> |
getAttributeNames()
|
B2buaHelperImpl |
getB2buaHelper()
|
java.lang.String |
getCallId()
|
long |
getCreationTime()
|
java.util.Iterator<MobicentsSipSession> |
getDerivedSipSessions()
|
java.util.concurrent.ThreadPoolExecutor |
getExecutorService()
|
java.lang.String |
getHandler()
Retrieve the handler associated with this sip session |
java.lang.String |
getId()
|
boolean |
getInvalidateWhenReady()
|
SipSessionKey |
getKey()
get the internal Mobicents Sip Session Key |
long |
getLastAccessedTime()
|
Address |
getLocalParty()
|
java.util.Set<javax.sip.Transaction> |
getOngoingTransactions()
|
SipURI |
getOutboundInterface()
|
ProxyImpl |
getProxy()
Retieves the proxy of the sip session if any |
SipApplicationRoutingRegion |
getRegion()
|
SipApplicationRoutingRegion |
getRegionInternal()
|
Address |
getRemoteParty()
|
javax.servlet.ServletContext |
getServletContext()
|
javax.sip.Dialog |
getSessionCreatingDialog()
|
javax.sip.Transaction |
getSessionCreatingTransaction()
|
MobicentsSipApplicationSession |
getSipApplicationSession()
|
java.util.Map<java.lang.String,java.lang.Object> |
getSipSessionAttributeMap()
|
URI |
getSipSubscriberURI()
|
SipSession.State |
getState()
|
java.io.Serializable |
getStateInfo()
|
URI |
getSubscriberURI()
|
java.security.Principal |
getUserPrincipal()
|
protected boolean |
hasOngoingTransaction()
Removed from the interface in PFD stage so making it protected |
void |
invalidate()
|
boolean |
isReadyToInvalidate()
|
boolean |
isSupervisedMode()
|
boolean |
isValid()
|
void |
onDialogTimeout(javax.sip.Dialog dialog)
|
void |
onReadyToInvalidate()
This method is called immediately when the conditions for read to invalidate session are met |
void |
onTerminatedState()
|
void |
passivate()
Perform the internal processing required to passivate this session. |
void |
removeAttribute(java.lang.String name)
|
MobicentsSipSession |
removeDerivedSipSession(java.lang.String toTag)
Removes the derived sip session identified by the To tag in parameter |
void |
removeOngoingTransaction(javax.sip.Transaction transaction)
Remove an ongoing tx to the session. |
void |
removeSubscription(SipServletMessageImpl sipServletMessageImpl)
|
void |
setAttribute(java.lang.String key,
java.lang.Object attribute)
|
void |
setB2buaHelper(B2buaHelperImpl helperImpl)
|
void |
setHandler(java.lang.String name)
|
void |
setInvalidateWhenReady(boolean arg0)
|
void |
setKey(SipSessionKey key)
|
void |
setLocalParty(Address localParty)
|
void |
setOutboundInterface(java.net.InetAddress inetAddress)
|
void |
setOutboundInterface(java.net.InetSocketAddress inetSocketAddress)
|
void |
setParentSession(MobicentsSipSession mobicentsSipSession)
|
void |
setProxy(ProxyImpl proxy)
Set the proxy of the sip session |
void |
setRemoteParty(Address remoteParty)
|
void |
setRoutingRegion(SipApplicationRoutingRegion routingRegion)
This method allows the application to set the region that the application is in with respect to this SipSession |
void |
setSessionCreatingDialog(javax.sip.Dialog dialog)
|
void |
setSessionCreatingTransaction(javax.sip.Transaction sessionCreatingTransaction)
|
protected void |
setSipApplicationSession(MobicentsSipApplicationSession sipApplicationSession)
|
void |
setSipSessionAttributeMap(java.util.Map<java.lang.String,java.lang.Object> sipSessionAttributeMap)
|
void |
setSipSubscriberURI(URI subscriberURI)
|
void |
setState(SipSession.State state)
|
void |
setStateInfo(java.io.Serializable stateInfo)
|
void |
setUserPrincipal(java.security.Principal userPrincipal)
|
void |
updateStateOnResponse(SipServletResponseImpl response,
boolean receive)
Update the sip session state upon sending/receiving a response Covers JSR 289 Section 6.2.1 along with updateStateOnRequest method |
void |
updateStateOnSubsequentRequest(SipServletRequestImpl request,
boolean receive)
Update the sip session state upon sending/receiving a subsequent request Covers JSR 289 Section 6.2.1 along with updateStateOnResponse method |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected transient MobicentsSipApplicationSession sipApplicationSession
protected ProxyImpl proxy
protected B2buaHelperImpl b2buaHelper
protected java.util.Map<java.lang.String,java.lang.Object> sipSessionAttributeMap
protected SipSessionKey key
protected transient java.security.Principal userPrincipal
protected transient java.util.concurrent.ThreadPoolExecutor executorService
protected long creationTime
protected long lastAccessedTime
protected SipApplicationRoutingRegion routingRegion
protected java.io.Serializable stateInfo
protected SipSession.State state
protected boolean isValid
protected java.lang.String handlerServlet
protected URI subscriberURI
protected transient SipURI outboundInterface
protected javax.sip.Dialog sessionCreatingDialog
protected transient javax.sip.Transaction sessionCreatingTransaction
protected transient java.util.Set<javax.sip.Transaction> ongoingTransactions
protected transient java.util.concurrent.ConcurrentHashMap<java.lang.String,MobicentsSipSession> derivedSipSessions
protected transient SipFactoryImpl sipFactory
protected boolean invalidateWhenReady
protected boolean readyToInvalidate
protected transient MobicentsSipSession parentSession
protected transient Address localParty
protected transient Address remoteParty
protected transient java.util.Set<javax.sip.header.EventHeader> subscriptions
protected transient javax.sip.Transaction originalTransaction
protected transient boolean okToByeSentOrReceived
| Constructor Detail |
|---|
protected SipSessionImpl(SipSessionKey key,
SipFactoryImpl sipFactoryImpl,
MobicentsSipApplicationSession mobicentsSipApplicationSession)
| Method Detail |
|---|
public SipServletRequest createRequest(java.lang.String method)
createRequest in interface SipSessionpublic SipApplicationSession getApplicationSession()
getApplicationSession in interface SipSessionpublic java.lang.Object getAttribute(java.lang.String name)
getAttribute in interface SipSessionpublic java.util.Enumeration<java.lang.String> getAttributeNames()
getAttributeNames in interface SipSessionpublic java.lang.String getCallId()
getCallId in interface SipSessionpublic long getCreationTime()
getCreationTime in interface SipSessionpublic java.lang.String getId()
getId in interface SipSessionpublic long getLastAccessedTime()
getLastAccessedTime in interface SipSessionpublic void access()
access in interface MobicentsSipSessionpublic Address getLocalParty()
getLocalParty in interface SipSessionpublic SipApplicationRoutingRegion getRegion()
getRegion in interface SipSessionpublic SipApplicationRoutingRegion getRegionInternal()
getRegionInternal in interface MobicentsSipSessionpublic void setRoutingRegion(SipApplicationRoutingRegion routingRegion)
setRoutingRegion in interface MobicentsSipSessionroutingRegion - the region that the application is inpublic java.io.Serializable getStateInfo()
getStateInfo in interface MobicentsSipSessionpublic void setStateInfo(java.io.Serializable stateInfo)
setStateInfo in interface MobicentsSipSessionstateInfo - the stateInfo to setpublic Address getRemoteParty()
getRemoteParty in interface SipSessionpublic SipSession.State getState()
getState in interface SipSessionpublic java.util.concurrent.ThreadPoolExecutor getExecutorService()
getExecutorService in interface MobicentsSipSessionpublic URI getSubscriberURI()
getSubscriberURI in interface SipSessionpublic void invalidate()
invalidate in interface SipSessionprotected boolean hasOngoingTransaction()
public boolean isValid()
isValid in interface SipSessionpublic void removeAttribute(java.lang.String name)
removeAttribute in interface SipSession
public void setAttribute(java.lang.String key,
java.lang.Object attribute)
setAttribute in interface SipSession
public void setHandler(java.lang.String name)
throws javax.servlet.ServletException
setHandler in interface SipSessionjavax.servlet.ServletExceptionpublic java.lang.String getHandler()
getHandler in interface MobicentsSipSessionpublic void setSessionCreatingDialog(javax.sip.Dialog dialog)
setSessionCreatingDialog in interface MobicentsSipSessiondialog - the dialog to setpublic javax.sip.Dialog getSessionCreatingDialog()
getSessionCreatingDialog in interface MobicentsSipSessionpublic MobicentsSipApplicationSession getSipApplicationSession()
getSipApplicationSession in interface MobicentsSipSessionprotected void setSipApplicationSession(MobicentsSipApplicationSession sipApplicationSession)
public javax.sip.Transaction getSessionCreatingTransaction()
getSessionCreatingTransaction in interface MobicentsSipSessionpublic void setSessionCreatingTransaction(javax.sip.Transaction sessionCreatingTransaction)
setSessionCreatingTransaction in interface MobicentsSipSessionsessionCreatingTransaction - the sessionCreatingTransaction to setpublic boolean isSupervisedMode()
public void setSipSubscriberURI(URI subscriberURI)
setSipSubscriberURI in interface MobicentsSipSessionpublic URI getSipSubscriberURI()
getSipSubscriberURI in interface MobicentsSipSessionpublic SipURI getOutboundInterface()
getOutboundInterface in interface MobicentsSipSessionpublic void onDialogTimeout(javax.sip.Dialog dialog)
public void setState(SipSession.State state)
setState in interface MobicentsSipSessionpublic void onTerminatedState()
onTerminatedState in interface MobicentsSipSessionpublic void addOngoingTransaction(javax.sip.Transaction transaction)
addOngoingTransaction in interface MobicentsSipSessionpublic void removeOngoingTransaction(javax.sip.Transaction transaction)
removeOngoingTransaction in interface MobicentsSipSessionpublic java.util.Set<javax.sip.Transaction> getOngoingTransactions()
getOngoingTransactions in interface MobicentsSipSession
public void updateStateOnResponse(SipServletResponseImpl response,
boolean receive)
updateStateOnResponse in interface MobicentsSipSessionresponse - the response received/to sendreceive - true if the response has been received, false if it is to be sent.
public void updateStateOnSubsequentRequest(SipServletRequestImpl request,
boolean receive)
updateStateOnSubsequentRequest in interface MobicentsSipSessionrequest - the subsequent request received/to sendreceive - true if the subsequent request has been received, false if it is to be sent.public void onReadyToInvalidate()
onReadyToInvalidate in interface MobicentsSipSessionpublic SipSessionKey getKey()
MobicentsSipSession
getKey in interface MobicentsSipSessionpublic void setKey(SipSessionKey key)
key - the key to setpublic ProxyImpl getProxy()
getProxy in interface MobicentsSipSessionpublic void setProxy(ProxyImpl proxy)
setProxy in interface MobicentsSipSessionpublic void setB2buaHelper(B2buaHelperImpl helperImpl)
setB2buaHelper in interface MobicentsSipSessionpublic B2buaHelperImpl getB2buaHelper()
getB2buaHelper in interface MobicentsSipSessionpublic void passivate()
public void activate()
public java.security.Principal getUserPrincipal()
getUserPrincipal in interface MobicentsSipSessionpublic void setUserPrincipal(java.security.Principal userPrincipal)
setUserPrincipal in interface MobicentsSipSessionpublic boolean getInvalidateWhenReady()
getInvalidateWhenReady in interface SipSessionpublic boolean isReadyToInvalidate()
isReadyToInvalidate in interface SipSessionpublic void setInvalidateWhenReady(boolean arg0)
setInvalidateWhenReady in interface SipSessionpublic void setOutboundInterface(java.net.InetAddress inetAddress)
setOutboundInterface in interface SipSessionpublic void setOutboundInterface(java.net.InetSocketAddress inetSocketAddress)
setOutboundInterface in interface SipSessionpublic javax.servlet.ServletContext getServletContext()
getServletContext in interface SipSessionpublic MobicentsSipSession removeDerivedSipSession(java.lang.String toTag)
removeDerivedSipSession in interface MobicentsSipSessiontoTag - the to Tag identifying the sip session to remove
public MobicentsSipSession findDerivedSipSession(java.lang.String toTag)
findDerivedSipSession in interface MobicentsSipSessiontoTag - the to Tag identifying the sip session to remove
public java.util.Iterator<MobicentsSipSession> getDerivedSipSessions()
getDerivedSipSessions in interface MobicentsSipSessionpublic void setParentSession(MobicentsSipSession mobicentsSipSession)
setParentSession in interface MobicentsSipSessionpublic void setSipSessionAttributeMap(java.util.Map<java.lang.String,java.lang.Object> sipSessionAttributeMap)
setSipSessionAttributeMap in interface MobicentsSipSessionpublic void addDerivedSipSessions(MobicentsSipSession derivedSession)
addDerivedSipSessions in interface MobicentsSipSessionderivedSession - the derived session to addpublic java.util.Map<java.lang.String,java.lang.Object> getSipSessionAttributeMap()
getSipSessionAttributeMap in interface MobicentsSipSessionpublic void setLocalParty(Address localParty)
setLocalParty in interface MobicentsSipSessionlocalParty - the localParty to setpublic void setRemoteParty(Address remoteParty)
setRemoteParty in interface MobicentsSipSessionremoteParty - the remoteParty to set
public void addSubscription(SipServletMessageImpl sipServletMessageImpl)
throws javax.sip.SipException
addSubscription in interface MobicentsSipSessionjavax.sip.SipExceptionpublic void removeSubscription(SipServletMessageImpl sipServletMessageImpl)
removeSubscription in interface MobicentsSipSession
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||