Interface WlssSipApplicationSession
- All Superinterfaces:
javax.servlet.sip.AttributeStore,javax.servlet.sip.SipApplicationSession
SipApplicationSession
interface.- Author:
- Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
- See Also:
-
SipApplicationSessionWlssAction
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumNested classes/interfaces inherited from interface javax.servlet.sip.SipApplicationSession
javax.servlet.sip.SipApplicationSession.Protocol -
Method Summary
Modifier and TypeMethodDescriptiondoAction(WlssAction action) This methods executes WlssTask in a transactional manner.voiddoAsynchronousAction(WlssAsynchronousAction asyncWork) This method allows an application to access a SipApplicationSession in an asynchronous manner.byteThe site identifier.<T> TgetSession(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> TgetSession(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 immutableSetof all valid "protocol" session objects associated with the specified type associated with this application session.voidsetPersist(WlssSipApplicationSession.PersistenceType type, boolean value) This method can be used to override the default call-state persistence characteristics.Methods inherited from interface javax.servlet.sip.AttributeStore
clearAttributes, getAttribute, getAttributeNameSet, removeAttribute, setAttributeMethods inherited from interface javax.servlet.sip.SipApplicationSession
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
-
Method Details
-
doAction
This methods executes WlssTask in a transactional manner. During the execution of this method, no other thread or engine will be allowed access to the call-state pertaining to the SipApplicationSession. It has been introduced to provide a mechanism to control concurrency across the entire engine cluster while the application is interacting with the SipApplicationSession. This method is intended to be used by non-SIP scoped servlets (e.g. HTTP servlets in converged applications). When this API is used by the applications, the container guarentees that the business logic contained within the WlssAction will be executed with a lock on the SipApplicationSession instance. If used within the SIP scope (in call) and the Call-ID matches, this method will be a no-op, since the container already guarentees concurrency control during the execution of the service method for SIP servlets. If the SipApplicationSession belongs to a different call-state, than the current SIP request, then container will acquire a lock.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; } });
- Parameters:
action- WlssAction which is passed by the application- Returns:
- Returns the result of the WlssTask's run method (may be null)
- Throws:
Exception- - propagates the Exception thrown by the run method
-
doAsynchronousAction
This method allows an application to access a SipApplicationSession in an asynchronous manner. This method is useful for accessing the SipApplicationSession from Web or EJB modules in a converged application. When this API is used by the above modules, the container guarantees that the business logic contained within the SipApplicationSessionAsynchronousWork will be executed in a thread-safe manner.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); } });
- Parameters:
asyncWork- the work to be done on this SipApplicationSession. The run method of this object contains the work (business logic) to be performed.- See Also:
-
setPersist
This method can be used to override the default call-state persistence characteristics.
- Parameters:
type-DATABASEdenotes that the state should be saved to database to save RAM space.GEO_REDUNDANCYindicates that the state should be propagated to the remote site.value- whether or not to enable the action.
-
getGeoSiteId
byte getGeoSiteId()The site identifier.- Returns:
- the site identifier for this session
-
getSession
Returns a protocol session object with the specified id and specified type belonging to this application session, or null if not found.If
javax.servlet.sip.SipSessionis specified the result will be an validSipSessionobject with the specified id belonging to this application session. Forjavax.servlet.http.HttpSessionthe result will be a validjavax.servlet.http.HttpSessionwith the specified id belonging to this application session.- Parameters:
id- the session idsessionType- Type of the protocol session.- Returns:
- the corresponding protocol session object or null if none is found.
- Throws:
NullPointerException- on nullidorsessionTypeIllegalStateException- if this application session is not valid- Since:
- 2.0
- See Also:
-
javax.servlet.sip.spi.ProtocolSessionAdapter#getSessionType()
-
getSessions
Returns an immutableSetof all valid "protocol" session objects associated with the specified type associated with this application session. If the specified type is not found, an emptySetis returned.If
javax.servlet.sip.SipSessionis specified the result will be aSetof validSipSessionobjects belonging to this application session. Forjavax.servlet.http.HttpSessionthe result will be aSetof validjavax.servlet.http.HttpSessionobjects.- Parameters:
sessionType- Type of the protocol session.- Returns:
Setof all valid protocol sessions of the specified protocol- Throws:
IllegalStateException- if this application session is not validNullPointerException- if thesessionTypeis nullIllegalArgumentException- if thesessionTypeis not understood by container.- Since:
- 2.0
- See Also:
-
javax.servlet.sip.spi.ProtocolSessionAdapter#getSessionType()
-
getSession
Returns the protocol session object with the specified id associated with the specified protocol belonging to this application session, or null if not found.If "SIP" is specified the result will be a valid
SipSessionobject with the specified id belonging to this application session. For "HTTP" the result will be a validjavax.servlet.http.HttpSessionwith the specified id belonging to this application session. For "DIAMETER" the result will be a validcom.bea.wcp.diameter.sessionwith the specified id belonging to this application session.- Parameters:
id- the session idprotocol- an string identifying the protocol- Returns:
- the corresponding protocol session object or null if none is found.
- Throws:
NullPointerException- on nullidorprotocolIllegalStateException- if this application session is not valid- Since:
- 2.0
- See Also:
-
SipServletContext#register(String protocol)
-