Legrand / Raritan Xerus™ JSON-RPC API for Remote Access Devices like KX4-101, KX3G2

Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
session::SessionManager Interface Reference

Session manager interface More...

`import "SessionManager.idl";`

## Classes
struct | SessionClosedEvent
| Event: Session was closed. More...
struct | SessionCreatedEvent
| Event: Session was created. More...

## Public Types
enum | CloseReason { CLOSE_REASON_LOGOUT , CLOSE_REASON_TIMEOUT , CLOSE_REASON_BROWSER_CLOSED , CLOSE_REASON_FORCED_DISCONNECT }
| Session close reasons More...

## Public Member Functions
int | newSession (out Session session, out string token)
| Open a new session.
int | getSessionForCcSessionData (in string sessionId, in string sessionKey, out Session session, out string token)
| Retrieve an existing session using CC-SG provided session data.
Session | getCurrentSession ()
| Retrieve current session information.
vector< Session > | getSessions ()
| Retrieve all open sessions.
void | closeSession (in int sessionId, in CloseReason reason)
| Close a session identified by its token.
void | closeCurrentSession (in CloseReason reason)
| Close the current session.
void | touchCurrentSession (in boolean userActivity)
| Reset the current session's idle timer.
vector< HistoryEntry > | getSessionHistory ()
| Get previous session data for the current user.

## Public Attributes
constant int | ERR_ACTIVE_SESSION_EXCLUSIVE_FOR_USER = 1
| Session creation denied due to single login limitation.
constant int | ERR_NO_SUCH_SESSION = 2
| Session for provided data could not be found.

## Detailed Description

Session manager interface

Session manager allows clients to announce a user session, i.e. consecutive activity that is related to each other, and make use of session services. Depending on transport protocoll an established session allows simplified authentication using the session token. For instance, for HTTP transport implementation sessiontoken can be written into HTTP Header while other authentication schemes may be omitted (for details, see transport mapping documentation). Each session has a defined timeout and an idle timer. A session is deleted once idle time is equal or greater than session timeout. Idle timer is implicitely touched by transport implementation whenever a call arrives that can be mapped to a particular session. In addition a client may decide to call touchCurrentSession with userActivity flag set to true. In this case userIdle attribute of session is reset to 0. This has purely informational character and will not cause any further action of session manager. It may be used to determine user activity under the assumptions that clients may do frequent background calls without actual user activity.

Definition at line 57 of file SessionManager.idl.

## Member Enumeration Documentation

## ◆ CloseReason

enum session::SessionManager::CloseReason

Session close reasons

Enumerator
CLOSE_REASON_LOGOUT | Regular logout.
CLOSE_REASON_TIMEOUT | Session timed out.
CLOSE_REASON_BROWSER_CLOSED | Browser window was closed.
CLOSE_REASON_FORCED_DISCONNECT | Session was forcibly closed.

Definition at line 63 of file SessionManager.idl.

## Member Function Documentation

## ◆ closeCurrentSession()

void session::SessionManager::closeCurrentSession | ( | in CloseReason | reason | ) |

Close the current session.

This call must be authenticated using a session token.

Parameters

  reason | close reason

## ◆ closeSession()

void session::SessionManager::closeSession | ( | in int | sessionId,
|  | in CloseReason | reason )

Close a session identified by its token.

Parameters

  sessionId | ID of the session that should be closed
  reason | close reason

## ◆ getCurrentSession()

Session session::SessionManager::getCurrentSession | ( |  | ) |

Retrieve current session information.

This call must be authenticated using a session token.

Returns
  Session information

## ◆ getSessionForCcSessionData()

int session::SessionManager::getSessionForCcSessionData | ( | in string | sessionId,
|  | in string | sessionKey,
|  | out Session | session,
|  | out string | token )

Retrieve an existing session using CC-SG provided session data.

Parameters

  sessionId | Session ID
  sessionKey | Session key
  session | Session information
  token | Returned session token

Returns
  0 if OK
  1 if session creation was denied due to single login limitation

## ◆ getSessionHistory()

vector< HistoryEntry > session::SessionManager::getSessionHistory | ( |  | ) |

Get previous session data for the current user.

Returns
  History data, sorted from newer to older sessions

## ◆ getSessions()

vector< Session > session::SessionManager::getSessions | ( |  | ) |

Retrieve all open sessions.

Returns
  List of sessions

## ◆ newSession()

int session::SessionManager::newSession | ( | out Session | session,
|  | out string | token )

Open a new session.

This function will create a new session for the authenticated user. Upon success it will return a session token which can be used to authenticate future requests.

Parameters

  session | Session information
  token | Returned token for the newly created session

Returns
  0 if OK
  1 if session creation was denied due to single login limitation

## ◆ touchCurrentSession()

void session::SessionManager::touchCurrentSession | ( | in boolean | userActivity | ) |

Reset the current session's idle timer.

Parameters

  userActivity | Indicates that the session is touched due to user activity.

If userActivity is not set, this is internally a NOP since any RPC call will implicitly touch the session. This call must be authenticated using a session token.

## Member Data Documentation

## ◆ ERR_ACTIVE_SESSION_EXCLUSIVE_FOR_USER

constant int session::SessionManager::ERR_ACTIVE_SESSION_EXCLUSIVE_FOR_USER = 1

Session creation denied due to single login limitation.

Definition at line 59 of file SessionManager.idl.

## ◆ ERR_NO_SUCH_SESSION

constant int session::SessionManager::ERR_NO_SUCH_SESSION = 2

Session for provided data could not be found.

Definition at line 60 of file SessionManager.idl.

The documentation for this interface was generated from the following file:

- SessionManager.idl