Interface: SessionHandler

SessionHandler

Interface for classes that can handle can act as a session handler
Source:

Methods

(static) getName() → {String}

Returns the name of the SessionHandler. If not set, SkillVC will attempt to determine one for you and add the function to your object
Source:
Returns:
The name of the SessionHandler
Type
String

getEndSessionHandlers() → {Array.SessionHandler}

Returns the end SessionHandler.
Source:
Returns:
The end SessionHandler in the order they should be executed
Type
Array.SessionHandler

getOrder() → {Number}

Returns the order location in which the session handlers should be called. If not defined, the order will be assumed to be the order in which it was loaded
Source:
Returns:
The place in execution order (index) of the session handler.
Type
Number

getStartSessionHandlers() → {Array.SessionHandler}

Returns the start SessionHandler.
Source:
Returns:
The end SessionHandler in the order they should be executed
Type
Array.SessionHandler

sessionEnd(event, context, svContext) → {Promise}

Called when a session has ended A essionHandler should implement either sessionStart or sessionEnd, it does not need to implement both. If the SessionHandler has any async operations a `Promise` should be returned to SkillVC so that it will wait until execution of the async operation has completed
Parameters:
Name Type Description
event Object The event for the skill (from lambda)
context OBject The context for the skill (from lambda)
svContext SVContext The context of the execution
Source:
Returns:
The optional `Promise` that can be used to wait until this completes
Type
Promise

sessionStart(event, context, svContext) → {Promise}

Called when a session is started. A SessionHandler should implement either sessionStart or sessionEnd, it does not need to implement both. If the SessionHandler has any async operations a `Promise` should be returned to SkillVC so that it will wait until execution of the async operation has completed
Parameters:
Name Type Description
event Object The event for the skill (from lambda)
context OBject The context for the skill (from lambda)
svContext SVContext The context of the execution
Source:
Returns:
The optional `Promise` that can be used to wait until this completes
Type
Promise