Index


Class wsc.ExtensibleSession

This object exposes functions required for package developers (SPI).

Class Summary
Constructor Attributes Constructor Name and Description
 
wsc.ExtensibleSession(useName, webSocketUri, successCallback, failureCallback, sessionId)
Method Summary
Method Attributes Method Name and Description
 
Generate a correlation ID based on current outbound sequence number of this session.
 
Gets all sub-sessions managed by this session.
 
getPackage(packageType)
Gets the specified package from the session.
 
Gets sub-session by sub-session id.
 
Gets all sub-sessions that belong to the specified package.
 
putSubSession(packageType, id, subSession)
Puts a sub-session object into the session.
 
registerPackage(package)
Registers the package with the Session.
 
Removes sub-session object by id.
 
Saves the session data to html5 client sessionStorage.
 
sendMessage(message)
Sends the message to WebRTC Session Controller server.
 
setSessionState(sessionState)
Set the session's current state.
Class Detail
wsc.ExtensibleSession(useName, webSocketUri, successCallback, failureCallback, sessionId)
Parameters:
{String} useName
the current user name.
{String} webSocketUri
the WebSocket server URI.
successCallback
the success callback function.
failureCallback
the failure callback function.
{String} sessionId
If application provides the sessionId, the client will try to rehydrate the Session with the that id; otherwise, the client will create a new Session.
Method Detail
genNewCorrelationId()
Generate a correlation ID based on current outbound sequence number of this session.
For example, if the current outbound sequence number is 100, "c101" is returned by calling this method. Calling this method does not change value of current outbound sequence number itself.

{Array} getAllSubSessions()
Gets all sub-sessions managed by this session.
Returns:
{Array} An array of sub-session objects

getPackage(packageType)
Gets the specified package from the session.
Parameters:
{String} packageType
the type of the package
Returns:
the package with the specified name, or null if not found.

getSubSession(id)
Gets sub-session by sub-session id.
Parameters:
{String} id
the sub-session id
Returns:
sub-session with the given id.

{Map} getSubSessionsByPackageType(packageType)
Gets all sub-sessions that belong to the specified package.
Parameters:
{String} packageType
the package type.
Returns:
{Map} Map that contains all sub-sessions. The key is sub-session ID and the value is the sub-session.

putSubSession(packageType, id, subSession)
Puts a sub-session object into the session.
Parameters:
{String} packageType
the package type.
{String} id
the sub-session id.
subSession
a sub-session object.

registerPackage(package)
Registers the package with the Session. When implementing a package, a public property named packageType is required, and is used as a the key in the session.
Parameters:
package
the package that needs to register with the session.

removeSubSession(id)
Removes sub-session object by id.
Parameters:
{String} id
the sub-session id

saveToStorage()
Saves the session data to html5 client sessionStorage.

sendMessage(message)
Sends the message to WebRTC Session Controller server. The sequence number of this session is updated according to the parameter impactSeqNum
Parameters:
{wsc.Message} message
the wsc.Message object which denotes the message data to send to WebRTC Session Controller server

setSessionState(sessionState)
Set the session's current state.
Parameters:
{String} sessionState
the new session state.

Copyright © 2005, 2013, Oracle and/or its affiliates. All rights reserved.