Legrand / Raritan / Server Technology Xerus™ JSON-RPC API

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

Session manager interface More...

`import <SessionManager.idl;`

## 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.
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.

## 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 54 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 59 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

## ◆ 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 56 of file SessionManager.idl.

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

- SessionManager.idl