org.mobicents.servlet.sip.core.session
Class SipSessionKey

java.lang.Object
  extended by org.mobicents.servlet.sip.core.session.SipSessionKey
All Implemented Interfaces:
java.io.Serializable

public final class SipSessionKey
extends java.lang.Object
implements java.io.Serializable

Class representing the key (which will also be its id) for a sip session.
It is composed of the From Header parameter Tag, the To Header parameter tag, the Call-Id, the app session id and the application Name.

IT is maaped to the SIP Dialog from RFC3261 (from tag, to tag + call-ID)

It is to be noted that the To Header parameter Tag will not be used in SipSessionKey comparison (equals() and hashcode() methods).
It will only be used to check if a new derived sip session needs to be created.

Author:
Jean Deruelle
See Also:
Serialized Form

Constructor Summary
SipSessionKey(java.lang.String fromTag, java.lang.String toTag, java.lang.String callId, java.lang.String applicationSessionId, java.lang.String applicationName)
           
 
Method Summary
 void computeToString()
           
 boolean equals(java.lang.Object obj)
           
 java.lang.String getApplicationName()
           
 java.lang.String getApplicationSessionId()
           
 java.lang.String getCallId()
           
 java.lang.String getFromTag()
           
 java.lang.String getToTag()
           
 int hashCode()
           
 void setToString(java.lang.String toString)
           
 void setToTag(java.lang.String toTag, boolean recomputeSessionId)
          Sets the to tag on the key when we receive a response.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SipSessionKey

public SipSessionKey(java.lang.String fromTag,
                     java.lang.String toTag,
                     java.lang.String callId,
                     java.lang.String applicationSessionId,
                     java.lang.String applicationName)
Parameters:
fromAddress -
fromTag -
toAddress -
toTag -
callId -
applicationSessionId -
applicationName -
Method Detail

getFromTag

public java.lang.String getFromTag()
Returns:
the fromTag

getToTag

public java.lang.String getToTag()
Returns:
the toTag

getCallId

public java.lang.String getCallId()
Returns:
the callId

getApplicationSessionId

public java.lang.String getApplicationSessionId()
Returns:
the applicationSessionId

getApplicationName

public java.lang.String getApplicationName()
Returns:
the applicationName

hashCode

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

equals

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

toString

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

setToTag

public void setToTag(java.lang.String toTag,
                     boolean recomputeSessionId)
Sets the to tag on the key when we receive a response. We recompute the session id only for derived session otherwise the id will change when the a request is received or sent and the response is sent back or received which should not happen See TCK test SipSessionListenerTest.testSessionDestroyed001

Parameters:
toTag - the toTag to set
recomputeSessionId - check if the sessionid need to be recomputed

setToString

public void setToString(java.lang.String toString)
Parameters:
toString - the toString to set

computeToString

public void computeToString()


Copyright © 2011. All Rights Reserved.