public interface WlssSipApplicationSession
extends javax.servlet.sip.SipApplicationSession
SipApplicationSession
interface.SipApplicationSession
,
WlssAction
Modifier and Type | Interface and Description |
---|---|
static class |
WlssSipApplicationSession.PersistenceType
|
Modifier and Type | Method and Description |
---|---|
Object |
doAction(WlssAction action)
This methods executes WlssTask in a transactional manner.
|
void |
doAsynchronousAction(WlssAsynchronousAction asyncWork)
This method allows an application to access a SipApplicationSession in an
asynchronous manner.
|
byte |
getGeoSiteId()
The site identifier.
|
<T> T |
getSession(String id,
Class<T> sessionType)
Returns a protocol session object with the specified id and specified type
belonging to this application session, or null if not found.
|
<T> T |
getSession(String id,
String protocol)
Returns the protocol session object with the specified id associated with the
specified protocol belonging to this application session, or null if not
found.
|
<T> Set<T> |
getSessions(Class<T> sessionType)
Returns an immutable
Set of all valid "protocol" session objects
associated with the specified type associated with this application
session. |
void |
setPersist(WlssSipApplicationSession.PersistenceType type,
boolean value)
This method can be used to override the default call-state persistence
characteristics.
|
addIndexKey, encodeURI, encodeURL, getApplicationName, getAttributeNames, getCreationTime, getExpirationTime, getId, getIndexKeys, getInvalidateWhenReady, getLastAccessedTime, getSession, getSessions, getSessions, getSessionSet, getSessionSet, getSipSession, getTaskFuture, getTaskFutures, getTimer, getTimers, invalidate, isReadyToInvalidate, isValid, removeIndexKey, setExpires, setInvalidateWhenReady
Object doAction(WlssAction action) throws Exception
Example usage:
SipApplicationSession appSession = ...; WlssSipApplicationSession wlssAppSession = (WlssSipApplicationSession) appSession; wlssAppSession.doAction(new WlssAction() { public Object run() throws Exception { // add your business logic here appSession.setAttribute("counter", latestCounterValue); sipSession.setAttribute("currentState", latestAppState); // The container will make sure that the run method will be invoked // the with appSession locked return null; } });
action
- WlssAction which is passed by the applicationException
- - propagates the Exception thrown by the run methodvoid doAsynchronousAction(WlssAsynchronousAction asyncWork)
Example Usage:
SipApplicationSession appSession = ...; appSession.doAsynchronousAction(new WlssAsynchronousAction() { void run(SipApplicationSession appSession) { // add your business logic here int counter = appSession.getAttribute("counter"); ++ counter; appSession.setAttribute("counter", counter); } });
asyncWork
- the work to be done on this SipApplicationSession. The
run method of this object contains the work (business logic) to be
performed.WlssAsynchronousAction
void setPersist(WlssSipApplicationSession.PersistenceType type, boolean value)
This method can be used to override the default call-state persistence characteristics.
type
- DATABASE
denotes that the state should be saved to database to save RAM space.
GEO_REDUNDANCY
indicates that the state should be propagated to the remote site.value
- whether or not to enable the action.byte getGeoSiteId()
<T> T getSession(String id, Class<T> sessionType)
If javax.servlet.sip.SipSession
is specified the result
will be an valid SipSession
object with the specified id
belonging to this application session. For javax.servlet.http.HttpSession
the result will be a valid javax.servlet.http.HttpSession
with the specified id belonging to this application session.
id
- the session idsessionType
- Type of the protocol session.NullPointerException
- on null id
or sessionType
IllegalStateException
- if this application session is not validjavax.servlet.sip.spi.ProtocolSessionAdapter#getSessionType()
<T> Set<T> getSessions(Class<T> sessionType)
Set
of all valid "protocol" session objects
associated with the specified type associated with this application
session. If the specified type is not found, an empty
Set
is returned.
If javax.servlet.sip.SipSession
is specified the result will
be a Set
of valid SipSession
objects
belonging to this application session. For
javax.servlet.http.HttpSession
the result will be a Set
of
valid javax.servlet.http.HttpSession
objects.
sessionType
- Type of the protocol session.Set
of all valid protocol sessions of the
specified protocolIllegalStateException
- if this application session is not validNullPointerException
- if the sessionType
is nullIllegalArgumentException
- if the sessionType
is not understood by container.javax.servlet.sip.spi.ProtocolSessionAdapter#getSessionType()
<T> T getSession(String id, String protocol)
If "SIP" is specified the result will be a valid SipSession
object
with the specified id belonging to this application
session. For "HTTP" the result will be a valid
javax.servlet.http.HttpSession
with the specified id belonging
to this application session. For "DIAMETER" the result will be a valid
com.bea.wcp.diameter.session
with the specified id belonging to
this application session.
id
- the session idprotocol
- an string identifying the protocolNullPointerException
- on null id
or protocol
IllegalStateException
- if this application session is not validSipServletContext#register(String protocol)