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

java.lang.Object
  extended by org.mobicents.servlet.sip.core.session.SessionManagerUtil

public class SessionManagerUtil
extends java.lang.Object

This class is used as a central place to get a session be it a sip session or an sip application session. Here are the semantics of the key used for storing each kind of session :

It is not possible to create a sip session or an application session directly, this class should be used to get a session whatever its type. If the session already exsits it will be returned otherwise it will be created. One should be expected to remove the sessions from this manager through the remove methods when the sessions are no longer used.


Field Summary
static java.lang.String TAG_PARAMETER_NAME
           
 
Constructor Summary
SessionManagerUtil()
           
 
Method Summary
static SipApplicationSessionKey getSipApplicationSessionKey(java.lang.String applicationName, java.lang.String id)
          Computes the sip application session key from the input parameters.
static SipSessionKey getSipSessionKey(java.lang.String applicationSessionId, java.lang.String applicationName, javax.sip.message.Message message, boolean inverted)
          Computes the sip session key from the input parameters.
static SipApplicationSessionKey parseSipApplicationSessionKey(java.lang.String sipApplicationKey)
          Parse a sip application key that was previously generated and put as an http request param through the encodeURL method of SipApplicationSession
static SipSessionKey parseSipSessionKey(java.lang.String sipSessionKey)
          Parse a sip application key that was previously generated and put as an http request param through the encodeURL method of SipApplicationSession
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TAG_PARAMETER_NAME

public static final java.lang.String TAG_PARAMETER_NAME
See Also:
Constant Field Values
Constructor Detail

SessionManagerUtil

public SessionManagerUtil()
Method Detail

getSipSessionKey

public static SipSessionKey getSipSessionKey(java.lang.String applicationSessionId,
                                             java.lang.String applicationName,
                                             javax.sip.message.Message message,
                                             boolean inverted)
Computes the sip session key from the input parameters. The sip session key will be of the form (FROM-ADDR,FROM-TAG,TO-ADDR,CALL-ID,APPNAME)

Parameters:
applicationName - the name of the application that will be the fifth component of the key
message - the message to get the 4 components of the key from
inverted - TODO
Returns:
the computed key
Throws:
java.lang.NullPointerException - if application name is null

getSipApplicationSessionKey

public static SipApplicationSessionKey getSipApplicationSessionKey(java.lang.String applicationName,
                                                                   java.lang.String id)
Computes the sip application session key from the input parameters. The sip application session key will be of the form (UUID,APPNAME)

Parameters:
applicationName - the name of the application that will be the second component of the key
id - the Id composing the first component of the key
Returns:
the computed key
Throws:
java.lang.NullPointerException - if one of the two parameters is null

parseSipApplicationSessionKey

public static SipApplicationSessionKey parseSipApplicationSessionKey(java.lang.String sipApplicationKey)
                                                              throws java.text.ParseException
Parse a sip application key that was previously generated and put as an http request param through the encodeURL method of SipApplicationSession

Parameters:
sipApplicationKey - the stringified version of the sip application key
Returns:
the corresponding sip application session key
Throws:
java.text.ParseException - if the stringfied key cannot be parse to a valid key

parseSipSessionKey

public static SipSessionKey parseSipSessionKey(java.lang.String sipSessionKey)
                                        throws java.text.ParseException
Parse a sip application key that was previously generated and put as an http request param through the encodeURL method of SipApplicationSession

Parameters:
sipSessionKey - the stringified version of the sip application key
Returns:
the corresponding sip application session key
Throws:
java.text.ParseException - if the stringfied key cannot be parse to a valid key


Copyright © 2009. All Rights Reserved.