org.mobicents.servlet.sip.message
Class MobicentsSipSessionFacade
java.lang.Object
org.mobicents.servlet.sip.message.MobicentsSipSessionFacade
- All Implemented Interfaces:
- java.io.Serializable, SipSession, SipSessionExt, MobicentsSipSession
public class MobicentsSipSessionFacade
- extends java.lang.Object
- implements MobicentsSipSession, java.io.Serializable
The purpose of this class is to be a facade to the real sip 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
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
MobicentsSipSessionFacade
public MobicentsSipSessionFacade(MobicentsSipSession sipSession)
createRequest
public SipServletRequest createRequest(java.lang.String arg0)
- Specified by:
createRequest in interface SipSession
getApplicationSession
public SipApplicationSession getApplicationSession()
- Specified by:
getApplicationSession in interface SipSession
getAttribute
public java.lang.Object getAttribute(java.lang.String arg0)
- Specified by:
getAttribute in interface SipSession
getAttributeNames
public java.util.Enumeration<java.lang.String> getAttributeNames()
- Specified by:
getAttributeNames in interface SipSession
getCallId
public java.lang.String getCallId()
- Specified by:
getCallId in interface SipSession
getCreationTime
public long getCreationTime()
- Specified by:
getCreationTime in interface SipSession
getId
public java.lang.String getId()
- Specified by:
getId in interface SipSession
getInvalidateWhenReady
public boolean getInvalidateWhenReady()
- Specified by:
getInvalidateWhenReady in interface SipSession
getLastAccessedTime
public long getLastAccessedTime()
- Specified by:
getLastAccessedTime in interface SipSession
getLocalParty
public Address getLocalParty()
- Specified by:
getLocalParty in interface SipSession
getRegion
public SipApplicationRoutingRegion getRegion()
- Specified by:
getRegion in interface SipSession
getRemoteParty
public Address getRemoteParty()
- Specified by:
getRemoteParty in interface SipSession
getServletContext
public javax.servlet.ServletContext getServletContext()
- Specified by:
getServletContext in interface SipSession
getState
public SipSession.State getState()
- Specified by:
getState in interface SipSession
getSubscriberURI
public URI getSubscriberURI()
- Specified by:
getSubscriberURI in interface SipSession
invalidate
public void invalidate()
- Specified by:
invalidate in interface SipSession
isReadyToInvalidate
public boolean isReadyToInvalidate()
- Specified by:
isReadyToInvalidate in interface SipSession
isValid
public boolean isValid()
- Specified by:
isValid in interface SipSession
isValidInternal
public boolean isValidInternal()
- Specified by:
isValidInternal in interface MobicentsSipSession
removeAttribute
public void removeAttribute(java.lang.String arg0)
- Specified by:
removeAttribute in interface SipSession
setAttribute
public void setAttribute(java.lang.String arg0,
java.lang.Object arg1)
- Specified by:
setAttribute in interface SipSession
setHandler
public void setHandler(java.lang.String arg0)
throws javax.servlet.ServletException
- Specified by:
setHandler in interface SipSession
- Throws:
javax.servlet.ServletException
setInvalidateWhenReady
public void setInvalidateWhenReady(boolean arg0)
- Specified by:
setInvalidateWhenReady in interface SipSession
setOutboundInterface
public void setOutboundInterface(java.net.InetAddress arg0)
- Specified by:
setOutboundInterface in interface SipSession
setOutboundInterface
public void setOutboundInterface(java.net.InetSocketAddress arg0)
- Specified by:
setOutboundInterface in interface SipSession
setOutboundInterface
public void setOutboundInterface(SipURI arg0)
- Specified by:
setOutboundInterface in interface SipSessionExt
access
public void access()
- Specified by:
access in interface MobicentsSipSession
addDerivedSipSessions
public void addDerivedSipSessions(MobicentsSipSession derivedSession)
- Description copied from interface:
MobicentsSipSession
- Add the derived sip session it will be identified by the To tag from its key
- Specified by:
addDerivedSipSessions in interface MobicentsSipSession
- Parameters:
derivedSession - the derived session to add
addOngoingTransaction
public void addOngoingTransaction(javax.sip.Transaction transaction)
- Specified by:
addOngoingTransaction in interface MobicentsSipSession
addSubscription
public void addSubscription(SipServletMessageImpl sipServletMessage)
throws javax.sip.SipException
- Specified by:
addSubscription in interface MobicentsSipSession
- Throws:
javax.sip.SipException
findDerivedSipSession
public MobicentsSipSession findDerivedSipSession(java.lang.String toTag)
- Description copied from interface:
MobicentsSipSession
- Find the derived sip session identified by its to tag
- Specified by:
findDerivedSipSession in interface MobicentsSipSession
- Parameters:
toTag - the to Tag identifying the sip session to remove
- Returns:
- the derived sip session identified by its to tag or null if none has been found
getB2buaHelper
public B2buaHelperImpl getB2buaHelper()
- Specified by:
getB2buaHelper in interface MobicentsSipSession
getDerivedSipSessions
public java.util.Iterator<MobicentsSipSession> getDerivedSipSessions()
- Specified by:
getDerivedSipSessions in interface MobicentsSipSession
getHandler
public java.lang.String getHandler()
- Specified by:
getHandler in interface MobicentsSipSession
getKey
public SipSessionKey getKey()
- Description copied from interface:
MobicentsSipSession
- get the internal Mobicents Sip Session Key
- Specified by:
getKey in interface MobicentsSipSession
- Returns:
- the internal Mobicents Sip Session Key
getOngoingTransactions
public java.util.Set<javax.sip.Transaction> getOngoingTransactions()
- Specified by:
getOngoingTransactions in interface MobicentsSipSession
getOutboundInterface
public java.lang.String getOutboundInterface()
- Specified by:
getOutboundInterface in interface MobicentsSipSession
getProxy
public ProxyImpl getProxy()
- Description copied from interface:
MobicentsSipSession
- Retieves the proxy of the sip session if any
- Specified by:
getProxy in interface MobicentsSipSession
- Returns:
getRegionInternal
public SipApplicationRoutingRegion getRegionInternal()
- Specified by:
getRegionInternal in interface MobicentsSipSession
getSessionCreatingDialog
public javax.sip.Dialog getSessionCreatingDialog()
- Specified by:
getSessionCreatingDialog in interface MobicentsSipSession
getSessionCreatingTransactionRequest
public SipServletMessageImpl getSessionCreatingTransactionRequest()
- Specified by:
getSessionCreatingTransactionRequest in interface MobicentsSipSession
getSipApplicationSession
public MobicentsSipApplicationSession getSipApplicationSession()
- Specified by:
getSipApplicationSession in interface MobicentsSipSession
getSipSessionAttributeMap
public java.util.Map<java.lang.String,java.lang.Object> getSipSessionAttributeMap()
- Specified by:
getSipSessionAttributeMap in interface MobicentsSipSession
getSipSubscriberURI
public java.lang.String getSipSubscriberURI()
- Specified by:
getSipSubscriberURI in interface MobicentsSipSession
getStateInfo
public java.io.Serializable getStateInfo()
- Specified by:
getStateInfo in interface MobicentsSipSession
getUserPrincipal
public java.security.Principal getUserPrincipal()
- Specified by:
getUserPrincipal in interface MobicentsSipSession
onReadyToInvalidate
public void onReadyToInvalidate()
- Specified by:
onReadyToInvalidate in interface MobicentsSipSession
onTerminatedState
public void onTerminatedState()
- Specified by:
onTerminatedState in interface MobicentsSipSession
removeDerivedSipSession
public MobicentsSipSession removeDerivedSipSession(java.lang.String toTag)
- Description copied from interface:
MobicentsSipSession
- Removes the derived sip session identified by the To tag in parameter
- Specified by:
removeDerivedSipSession in interface MobicentsSipSession
- Parameters:
toTag - the to Tag identifying the sip session to remove
- Returns:
- the removed derived sip session
removeOngoingTransaction
public void removeOngoingTransaction(javax.sip.Transaction transaction)
- Specified by:
removeOngoingTransaction in interface MobicentsSipSession
removeSubscription
public void removeSubscription(SipServletMessageImpl sipServletMessage)
- Specified by:
removeSubscription in interface MobicentsSipSession
setB2buaHelper
public void setB2buaHelper(B2buaHelperImpl helperImpl)
- Specified by:
setB2buaHelper in interface MobicentsSipSession
setLocalParty
public void setLocalParty(Address addressImpl)
- Specified by:
setLocalParty in interface MobicentsSipSession
setParentSession
public void setParentSession(MobicentsSipSession mobicentsSipSession)
- Specified by:
setParentSession in interface MobicentsSipSession
getParentSession
public MobicentsSipSession getParentSession()
- Specified by:
getParentSession in interface MobicentsSipSession
setProxy
public void setProxy(ProxyImpl proxy)
- Specified by:
setProxy in interface MobicentsSipSession
setRemoteParty
public void setRemoteParty(Address addressImpl)
- Specified by:
setRemoteParty in interface MobicentsSipSession
setRoutingRegion
public void setRoutingRegion(SipApplicationRoutingRegion routingRegion)
- Specified by:
setRoutingRegion in interface MobicentsSipSession
setSessionCreatingDialog
public void setSessionCreatingDialog(javax.sip.Dialog dialog)
- Specified by:
setSessionCreatingDialog in interface MobicentsSipSession
setSessionCreatingTransactionRequest
public void setSessionCreatingTransactionRequest(SipServletMessageImpl message)
- Specified by:
setSessionCreatingTransactionRequest in interface MobicentsSipSession
setSipSessionAttributeMap
public void setSipSessionAttributeMap(java.util.Map<java.lang.String,java.lang.Object> sipSessionAttributeMap)
- Specified by:
setSipSessionAttributeMap in interface MobicentsSipSession
setSipSubscriberURI
public void setSipSubscriberURI(java.lang.String subscriberURI)
- Specified by:
setSipSubscriberURI in interface MobicentsSipSession
setState
public void setState(SipSession.State state)
- Specified by:
setState in interface MobicentsSipSession
setStateInfo
public void setStateInfo(java.io.Serializable stateInfo)
- Specified by:
setStateInfo in interface MobicentsSipSession
setUserPrincipal
public void setUserPrincipal(java.security.Principal principal)
- Specified by:
setUserPrincipal in interface MobicentsSipSession
updateStateOnResponse
public void updateStateOnResponse(SipServletResponseImpl sipServletResponseImpl,
boolean receive)
- Specified by:
updateStateOnResponse in interface MobicentsSipSession
updateStateOnSubsequentRequest
public void updateStateOnSubsequentRequest(SipServletRequestImpl sipServletRequestImpl,
boolean receive)
- Specified by:
updateStateOnSubsequentRequest in interface MobicentsSipSession
getSession
public MobicentsSipSessionFacade getSession()
- Specified by:
getSession in interface MobicentsSipSession
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
getNextSipApplicationRouterInfo
public SipApplicationRouterInfo getNextSipApplicationRouterInfo()
- Specified by:
getNextSipApplicationRouterInfo in interface MobicentsSipSession
setNextSipApplicationRouterInfo
public void setNextSipApplicationRouterInfo(SipApplicationRouterInfo routerInfo)
- Specified by:
setNextSipApplicationRouterInfo in interface MobicentsSipSession
setAckReceived
public void setAckReceived(long cSeq,
boolean ackReceived)
- Specified by:
setAckReceived in interface MobicentsSipSession
setCseq
public void setCseq(long cseq)
- Specified by:
setCseq in interface MobicentsSipSession
getCseq
public long getCseq()
- Specified by:
getCseq in interface MobicentsSipSession
validateCSeq
public boolean validateCSeq(SipServletRequestImpl request)
- Specified by:
validateCSeq in interface MobicentsSipSession
getMobicentsSipSession
public MobicentsSipSession getMobicentsSipSession()
getTransport
public java.lang.String getTransport()
- Specified by:
getTransport in interface MobicentsSipSession
setTransport
public void setTransport(java.lang.String transport)
- Specified by:
setTransport in interface MobicentsSipSession
scheduleAsynchronousWork
public void scheduleAsynchronousWork(SipSessionAsynchronousWork work)
- Specified by:
scheduleAsynchronousWork in interface SipSessionExt
getRequestsPending
public int getRequestsPending()
- Specified by:
getRequestsPending in interface MobicentsSipSession
setRequestsPending
public void setRequestsPending(int requests)
- Specified by:
setRequestsPending in interface MobicentsSipSession
notifySipSessionListeners
public void notifySipSessionListeners(SipSessionEventType creation)
- Specified by:
notifySipSessionListeners in interface MobicentsSipSession
setCopyRecordRouteHeadersOnSubsequentResponses
public void setCopyRecordRouteHeadersOnSubsequentResponses(boolean copyRecordRouteHeadersOnSubsequentResponses)
- Specified by:
setCopyRecordRouteHeadersOnSubsequentResponses in interface SipSessionExt
getCopyRecordRouteHeadersOnSubsequentResponses
public boolean getCopyRecordRouteHeadersOnSubsequentResponses()
- Specified by:
getCopyRecordRouteHeadersOnSubsequentResponses in interface SipSessionExt
getSipSessionSecurity
public SipSessionSecurity getSipSessionSecurity()
- Specified by:
getSipSessionSecurity in interface MobicentsSipSession
setSipSessionSecurity
public void setSipSessionSecurity(SipSessionSecurity sipSessionSecurity)
- Specified by:
setSipSessionSecurity in interface MobicentsSipSession
acquire
public void acquire()
- Specified by:
acquire in interface MobicentsSipSession
release
public void release()
- Specified by:
release in interface MobicentsSipSession
Copyright © 2011. All Rights Reserved.