Manage sessions information

Until update 9, the assignment of a session token identifying a session with a unique ID was centralized on a single application server. This introduced a single point of failure.

The version 11 uses a new mechanism to handle X3 sessions identifier. There is no more a single point of failure on the application server.

A consequence of this evolution is that, in update 9, the psadx command is no more usable. Any code that uses System to call psadx will no more work.

The following APIs have been done to replace the use of psadx. The old library PSADX is still present for compatibility reasons and calls the new APIS; but it is of course more efficient to use these new APIs in version 11.

All these API are Subprog (usable with a Call API_NAME if they do not return a value) or Funprog (when they return a value, with the calling syntax RETURN_VALUE=func API_NAME). They are all located in the ASESSIONS script.

Number of sessions for a user

Subprog USER_CONNECT(LOGIN_CODE,FOLD_NAME,SESS_COUNT)Value Char LOGIN_CODE , FOLD_NAMEVariable Integer SESS_COUNT
The parameters given here are:* The login code (the one stored in USER property of the context).* The folder code (the current endpoint by default).

The variable SESS_COUNT returns the number of sessions.

Number of sessions by type and user

Subprog USER_NBCON(LOGIN_CODE,SESSION_TYPE,SESS_COUNT)Value Char LOGIN_CODEValue Integer SESSION_TYPEVariable Integer SESS_COUNT
The parameters given here are:* The login code (the one stored in USER property of the context).* The session type (modulo 8).

The variable SESS_COUNT returns the number of sessions of the right type, for the right user, regardless of the folder on which they are connected.

Number of sessions by type, user, and folder

Subprog NBCON_APP_USER(LOGIN_CODE,FOLD_NAME,SESSION_TYPE,SESS_COUNT)Value Char LOGIN_CODE, FOLD_NAMEValue Integer SESSION_TYPEVariable Integer SESS_COUNT
The parameters given here are:* The login code (the one stored in USER property of the context).* The folder code (the current endpoint by default).* The session type (modulo 8).

The variable SESS_COUNT returns the number of sessions of the right type, for the right user and the right folder.

Number of sessions by adxtyp, user, and folder

Subprog NBCON_APP_USER_ADXTYP(LOGIN_CODE,FOLD_NAME,SESSION_TYPE,SESS_COUNT)Value Char LOGIN_CODE, FOLD_NAMEValue Integer SESSION_TYPEVariable Integer SESS_COUNT
This call is quite the same as the previous, but adxtyp gives more details about the type (usually, the value modulo 8 is enough).The parameters given here are:* The login code (the one stored in USER property of the context).* The folder code (the current endpoint by default).* The value of adxtype to be checked for the session.

The variable SESS_COUNT returns the number of sessions of the right adxtyp, for the right user and the right folder.

Users details for a given session

Subprog USER_QUI(PROCESS_ID,FOLDER,CLIENT_CODE,USER_CODE,EMAIL)Value Char PROCESS_ID , FOLDERVariable Char CLIENT_CODE , USER_CODE , EMAIL
The parameters given here are:* The process ID in string format (corresponds to `num$(adxuid(1))``).* The folder code (the current endpoint by default).

The values returned are:
* The client code (the Syracuse login).
* The login code (the one stored in USER property of the context).
* The email of the user (thus allowing to send him an email in a further notification).

Count the sessions by folder and type

Subprog USER_NBCON_APP(FOLDER,SESSION_TYPE,SESSION_COUNT)Value Char FOLDERValue Integer SESSION_TYPEVariable Integer SESSION_COUNT
The parameters given here are:* The folder code (the current endpoint by default).* The session type (modulo 8).

The variable SESS_COUNT returns the number of sessions of the right type, for the right folder.

List of connected users on a folder

Subprog USER_LISTE(FOLDER,USER_COUNT,LIST)Value Char FOLDERVariable Integer USER_COUNTVariable Char LIST()()
The parameter given here is:* The folder code (the current endpoint by default).

The values returned are:
* The user count.
* The list of user codes.

Current user login

Funprog LOGIN

Current client address

Funprog MYPC

List all session ID running

Subprog CHARGE_UID(TBUID,NBUID)Variable Char TBUID()(1..)Variable Integer NBUID
The values returned are:* The list of running UID found.* The number of elements in the list.

Kill the processes associated to a session ID

Subprog KILL_ALLPROC(UID)Value Char UID
The parameter sent is:* The UID to be killed (corresponds to `adxuid(1)`).

Current user login and client

Subprog USER_SYS(USRSYS,USRCLI)Variable Char USRSYSVariable Char USRCLI
The parameters returned are:* The current user login* The current user client address

Is a process still running?

Funprog PROCESS_RUNNING(PROCESS_ID)Value Integer PROCESS_ID
The parameter sent is:* The process ID

The value returned is 0 (false) if the process is no more running, and 1 (true) if the process is still running.

List of running sessions

Subprog USER_MODULE(SESSION_ID,CLIENTS,FOLDERS,FUNCTIONS,MODULES,SESSION_COUNT)Variable Char SESSION_ID()(1..)Variable Char CLIENTS()(1..)Variable Char FOLDERS()(1..)Variable Char FUNCTIONS()(1..)Variable Char MODULES()(1..)Variable Integer SESSION_COUNT
This function returns a list of session as `psadx` did it previously.

The valueS returned are:
* The session IDs.
* The corresponding client identification.
* The corresponding folders.
* The function run.
* The associated modules.
* The number of lines returned.

List of running sessions (UID)

Subprog LIST_UID(SESSION_ID,SESSION_COUNT)Variable Char SESSION_ID()(1..)Variable Integer SESSION_COUNT
This function returns a list of session (but only the session ID).

The valueS returned are:
* The session IDs.
* The number of lines returned.