|
||||||||||
| 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 |
|---|
| Nested classes/interfaces inherited from interface javax.servlet.sip.SipSession |
|---|
SipSession.State |
| Field Summary | |
|---|---|
protected java.util.concurrent.ConcurrentHashMap<java.lang.Long,java.lang.Boolean> |
acksReceived
|
protected B2buaHelperImpl |
b2buaHelper
|
protected boolean |
copyRecordRouteHeadersOnSubsequentResponses
|
protected long |
creationTime
Creation time. |
protected long |
cseq
|
protected java.util.concurrent.ConcurrentHashMap<java.lang.String,MobicentsSipSession> |
derivedSipSessions
|
protected MobicentsSipSessionFacade |
facade
|
protected java.lang.String |
handlerServlet
The name of the servlet withing this same app to handle all subsequent requests. |
protected boolean |
invalidateWhenReady
|
protected boolean |
isSessionCreatingTransactionServer
|
protected boolean |
isValid
|
protected java.util.concurrent.atomic.AtomicBoolean |
isValidInternal
Is the session valid. |
protected SipSessionKey |
key
|
protected long |
lastAccessedTime
Last access time. |
protected Address |
localParty
|
protected SipApplicationRouterInfo |
nextSipApplicationRouterInfo
AR router info for the next app in chain |
protected boolean |
okToByeSentOrReceived
|
protected java.util.Set<javax.sip.Transaction> |
ongoingTransactions
|
protected java.lang.String |
originalMethod
|
protected java.lang.String |
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 int |
requestsPending
|
protected SipApplicationRoutingRegion |
routingRegion
Routing region per session/dialog. |
protected java.util.concurrent.Semaphore |
semaphore
|
protected javax.sip.Dialog |
sessionCreatingDialog
We use this for dialog-related requests. |
protected SipServletRequestImpl |
sessionCreatingTransactionRequest
We use this for REGISTER or MESSAGE, where a dialog doesn't exist to carry the session info. |
protected MobicentsSipApplicationSession |
sipApplicationSession
|
protected SipApplicationSessionKey |
sipApplicationSessionKey
|
protected SipFactoryImpl |
sipFactory
|
protected java.util.Map<java.lang.String,java.lang.Object> |
sipSessionAttributeMap
|
protected SipSessionSecurity |
sipSessionSecurity
|
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 java.lang.String |
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.lang.String |
transport
|
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)
|
protected void |
cleanupAcksReceived(long remoteCSeq)
We clean up the stored acks received when the remoteCSeq in param is greater and that the ackReceived is true |
SipServletRequest |
createRequest(java.lang.String method)
|
boolean |
equals(java.lang.Object obj)
|
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)
|
protected java.util.Map<java.lang.String,java.lang.Object> |
getAttributeMap()
|
java.util.Enumeration<java.lang.String> |
getAttributeNames()
|
B2buaHelperImpl |
getB2buaHelper()
|
java.lang.String |
getCallId()
|
boolean |
getCopyRecordRouteHeadersOnSubsequentResponses()
|
long |
getCreationTime()
|
long |
getCseq()
|
java.util.Iterator<MobicentsSipSession> |
getDerivedSipSessions()
|
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()
|
SipApplicationRouterInfo |
getNextSipApplicationRouterInfo()
|
java.util.Set<javax.sip.Transaction> |
getOngoingTransactions()
|
java.lang.String |
getOutboundInterface()
|
ProxyImpl |
getProxy()
Retieves the proxy of the sip session if any |
SipApplicationRoutingRegion |
getRegion()
|
SipApplicationRoutingRegion |
getRegionInternal()
|
Address |
getRemoteParty()
|
int |
getRequestsPending()
|
java.util.concurrent.Semaphore |
getSemaphore()
|
javax.servlet.ServletContext |
getServletContext()
|
MobicentsSipSessionFacade |
getSession()
|
javax.sip.Dialog |
getSessionCreatingDialog()
|
SipServletRequestImpl |
getSessionCreatingTransactionRequest()
|
MobicentsSipApplicationSession |
getSipApplicationSession()
|
java.util.Map<java.lang.String,java.lang.Object> |
getSipSessionAttributeMap()
|
SipSessionSecurity |
getSipSessionSecurity()
|
java.lang.String |
getSipSubscriberURI()
|
SipSession.State |
getState()
|
java.io.Serializable |
getStateInfo()
|
URI |
getSubscriberURI()
|
java.lang.String |
getTransport()
|
java.security.Principal |
getUserPrincipal()
|
int |
hashCode()
|
protected boolean |
hasOngoingTransaction()
Removed from the interface in PFD stage so making it protected |
void |
invalidate()
|
protected boolean |
isAckReceived(long cSeq)
check if the ack has been received for the cseq in param it may happen that the ackReceived has been removed already if that's the case it will return true |
boolean |
isReadyToInvalidate()
|
boolean |
isReadyToInvalidateInternal()
|
boolean |
isSupervisedMode()
|
boolean |
isValid()
|
boolean |
isValidInternal()
|
void |
notifySipSessionListeners(SipSessionEventType sipSessionEventType)
Notifies the listeners that a lifecycle event occured on that sip session |
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)
|
void |
removeAttribute(java.lang.String name,
boolean byPassValidCheck)
|
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 |
scheduleAsynchronousWork(SipSessionAsynchronousWork work)
|
void |
setAckReceived(long cSeq,
boolean ackReceived)
Setting ackReceived for CSeq to specified value in second param. |
void |
setAttribute(java.lang.String key,
java.lang.Object attribute)
|
void |
setB2buaHelper(B2buaHelperImpl helperImpl)
|
void |
setCopyRecordRouteHeadersOnSubsequentResponses(boolean copyRecordRouteHeadersOnSubsequentResponses)
|
void |
setCseq(long cseq)
|
void |
setHandler(java.lang.String name)
|
void |
setInvalidateWhenReady(boolean arg0)
|
void |
setKey(SipSessionKey key)
|
void |
setLocalParty(Address localParty)
|
void |
setNextSipApplicationRouterInfo(SipApplicationRouterInfo routerInfo)
|
void |
setOutboundInterface(java.net.InetAddress inetAddress)
|
void |
setOutboundInterface(java.net.InetSocketAddress inetSocketAddress)
|
void |
setOutboundInterface(SipURI outboundInterface)
|
void |
setParentSession(MobicentsSipSession mobicentsSipSession)
|
void |
setProxy(ProxyImpl proxy)
|
void |
setReadyToInvalidate(boolean readyToInvalidate)
|
void |
setRemoteParty(Address remoteParty)
|
void |
setRequestsPending(int requests)
|
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 |
setSessionCreatingTransactionRequest(SipServletMessageImpl message)
|
protected void |
setSipApplicationSession(MobicentsSipApplicationSession sipApplicationSession)
|
void |
setSipSessionAttributeMap(java.util.Map<java.lang.String,java.lang.Object> sipSessionAttributeMap)
|
void |
setSipSessionSecurity(SipSessionSecurity sipSessionSecurity)
|
void |
setSipSubscriberURI(java.lang.String subscriberURI)
|
void |
setState(SipSession.State state)
|
void |
setStateInfo(java.io.Serializable stateInfo)
|
void |
setTransport(java.lang.String transport)
|
void |
setUserPrincipal(java.security.Principal userPrincipal)
|
void |
setValid(boolean isValid)
|
java.lang.String |
toString()
|
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 |
boolean |
validateCSeq(SipServletRequestImpl sipServletRequest)
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected transient SipApplicationSessionKey sipApplicationSessionKey
protected transient MobicentsSipApplicationSession sipApplicationSession
protected ProxyImpl proxy
protected B2buaHelperImpl b2buaHelper
protected transient int requestsPending
protected volatile java.util.Map<java.lang.String,java.lang.Object> sipSessionAttributeMap
protected transient SipSessionKey key
protected transient java.security.Principal userPrincipal
protected long cseq
protected java.lang.String transport
protected long creationTime
protected long lastAccessedTime
protected transient SipApplicationRoutingRegion routingRegion
protected transient java.io.Serializable stateInfo
protected transient SipApplicationRouterInfo nextSipApplicationRouterInfo
protected SipSession.State state
protected java.util.concurrent.atomic.AtomicBoolean isValidInternal
protected transient boolean isValid
protected java.lang.String handlerServlet
protected transient java.lang.String subscriberURI
protected transient java.lang.String outboundInterface
protected transient javax.sip.Dialog sessionCreatingDialog
protected transient SipServletRequestImpl sessionCreatingTransactionRequest
protected transient boolean isSessionCreatingTransactionServer
protected transient java.util.Set<javax.sip.Transaction> ongoingTransactions
protected transient volatile 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 volatile java.util.Set<javax.sip.header.EventHeader> subscriptions
protected transient java.lang.String originalMethod
protected transient boolean okToByeSentOrReceived
protected transient boolean copyRecordRouteHeadersOnSubsequentResponses
protected transient java.util.concurrent.Semaphore semaphore
protected transient MobicentsSipSessionFacade facade
protected transient java.util.concurrent.ConcurrentHashMap<java.lang.Long,java.lang.Boolean> acksReceived
protected transient SipSessionSecurity sipSessionSecurity
| Constructor Detail |
|---|
protected SipSessionImpl(SipSessionKey key,
SipFactoryImpl sipFactoryImpl,
MobicentsSipApplicationSession mobicentsSipApplicationSession)
| Method Detail |
|---|
public void notifySipSessionListeners(SipSessionEventType sipSessionEventType)
notifySipSessionListeners in interface MobicentsSipSessionsipSessionEventType - the type of event that happenedpublic SipServletRequest createRequest(java.lang.String method)
createRequest in interface SipSessionpublic SipApplicationSession getApplicationSession()
getApplicationSession in interface SipSessionprotected java.util.Map<java.lang.String,java.lang.Object> getAttributeMap()
public 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 URI getSubscriberURI()
getSubscriberURI in interface SipSessionpublic void invalidate()
invalidate in interface SipSessionprotected boolean hasOngoingTransaction()
public boolean isValid()
isValid in interface SipSessionpublic boolean isValidInternal()
isValidInternal in interface MobicentsSipSessionpublic void setValid(boolean isValid)
isValid - the isValid to setpublic void removeAttribute(java.lang.String name)
removeAttribute in interface SipSession
public void removeAttribute(java.lang.String name,
boolean byPassValidCheck)
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 SipServletRequestImpl getSessionCreatingTransactionRequest()
getSessionCreatingTransactionRequest in interface MobicentsSipSessionpublic void setSessionCreatingTransactionRequest(SipServletMessageImpl message)
setSessionCreatingTransactionRequest in interface MobicentsSipSessionsessionCreatingTransaction - the sessionCreatingTransaction to setpublic boolean isSupervisedMode()
public void setSipSubscriberURI(java.lang.String subscriberURI)
setSipSubscriberURI in interface MobicentsSipSessionpublic java.lang.String getSipSubscriberURI()
getSipSubscriberURI in interface MobicentsSipSessionpublic java.lang.String 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 setReadyToInvalidate(boolean readyToInvalidate)
readyToInvalidate - the readyToInvalidate to setpublic boolean isReadyToInvalidateInternal()
public 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 void setOutboundInterface(SipURI outboundInterface)
setOutboundInterface in interface SipSessionExtpublic javax.servlet.ServletContext getServletContext()
getServletContext in interface SipSessionpublic MobicentsSipSession removeDerivedSipSession(java.lang.String toTag)
MobicentsSipSession
removeDerivedSipSession in interface MobicentsSipSessiontoTag - the to Tag identifying the sip session to remove
public MobicentsSipSession findDerivedSipSession(java.lang.String toTag)
MobicentsSipSession
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)
MobicentsSipSession
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 MobicentsSipSessionpublic void setRemoteParty(Address remoteParty)
setRemoteParty in interface MobicentsSipSession
public void addSubscription(SipServletMessageImpl sipServletMessageImpl)
throws javax.sip.SipException
addSubscription in interface MobicentsSipSessionjavax.sip.SipExceptionpublic void removeSubscription(SipServletMessageImpl sipServletMessageImpl)
removeSubscription in interface MobicentsSipSessionpublic java.util.concurrent.Semaphore getSemaphore()
getSemaphore in interface MobicentsSipSessionpublic MobicentsSipSessionFacade getSession()
getSession in interface MobicentsSipSessionpublic 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 SipApplicationRouterInfo getNextSipApplicationRouterInfo()
getNextSipApplicationRouterInfo in interface MobicentsSipSessionpublic void setNextSipApplicationRouterInfo(SipApplicationRouterInfo routerInfo)
setNextSipApplicationRouterInfo in interface MobicentsSipSession
public void setAckReceived(long cSeq,
boolean ackReceived)
setAckReceived in interface MobicentsSipSessioncSeq - cseq to set the ackReceivedackReceived - whether or not the ack has been received for this cseqprotected boolean isAckReceived(long cSeq)
cSeq - CSeq number to check if the ack has already been received
protected void cleanupAcksReceived(long remoteCSeq)
remoteCSeq - remoteCSeq the basis CSeq for cleaning up earlier (lower CSeq) stored ackReceivedpublic long getCseq()
getCseq in interface MobicentsSipSessionpublic void setCseq(long cseq)
setCseq in interface MobicentsSipSessionpublic boolean validateCSeq(SipServletRequestImpl sipServletRequest)
validateCSeq in interface MobicentsSipSessionpublic java.lang.String getTransport()
getTransport in interface MobicentsSipSessionpublic void setTransport(java.lang.String transport)
setTransport in interface MobicentsSipSessionpublic void scheduleAsynchronousWork(SipSessionAsynchronousWork work)
scheduleAsynchronousWork in interface SipSessionExtpublic int getRequestsPending()
getRequestsPending in interface MobicentsSipSessionpublic void setRequestsPending(int requests)
setRequestsPending in interface MobicentsSipSessionpublic void setCopyRecordRouteHeadersOnSubsequentResponses(boolean copyRecordRouteHeadersOnSubsequentResponses)
setCopyRecordRouteHeadersOnSubsequentResponses in interface SipSessionExtpublic boolean getCopyRecordRouteHeadersOnSubsequentResponses()
getCopyRecordRouteHeadersOnSubsequentResponses in interface SipSessionExtpublic void setSipSessionSecurity(SipSessionSecurity sipSessionSecurity)
setSipSessionSecurity in interface MobicentsSipSessionsipSessionSecurity - the sipSessionSecurity to setpublic SipSessionSecurity getSipSessionSecurity()
getSipSessionSecurity in interface MobicentsSipSession
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||