getSessionInfo Supported in On-premises modeSupported in Lease modeSupported in Connected (Cloud LM) mode

Interface Information

>This API belongs to SentinelLicensing.jar.

>The corresponding library is Sentinel RMS licensing library.

Description

Provides session-related information in XML format.

NOTE   From RMS v9.5 onwards, query version 1.1 has been introduced to support license hard limit up to 4,294,967,294. This is applicable to license version 20 and above. The SNTL_SESSIONINFO_LATEST macro is introduced to extract the latest version.

Syntax

String getSessionInfo(String query)

Version Compatibility

Prior to Sentinel RMS v9.5, you had to manually enter the query version at the time of compiling the application. For example, SNTL_SESSIONINFO_VERSION(v); where 'v' represents the query version for the installed SDK.

From Sentinel RMS v9.5 onwards, we have introduced macros for automating this task. When the application is compiled, it automatically takes the latest query version from the header file that is used. For example, for the license info query, when you compile your application using the SNTL_SESSIONINFO_LATEST macro, the latest query version is automatically entered by the application.

Parameters

Parameter Description
query [in]

Type of query.

Refer to the following XML templates for more information about query and output.

Query

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<sentinelQuery query="sessionInfo" version="1.1"/>

Output

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <sessionInfo>
   <featureName>F1</featureName>
   <featureVersion>V1</featureVersion>
   <serverName>localhost</serverName>
   <lastErrorStatus>0</lastErrorStatus>
   <keyTimeLeftInSecs>300</keyTimeLeftInSecs>
   <tokensInUse>1</tokensInUse>
   <driftTime>0</driftTime>
   <chalRespAuthentication>
   <response>
   ...
   </response>
   </chalRespAuthentication>
   <refreshStatus>string</refreshStatus>
 </sessionInfo>
Tag Name Description
featureName The name of the feature.
featureVersion The version of the feature.
serverName The name of the License Manager.
lastErrorStatus The last return status for the specified session.
keyTimeLeftInSecs Indicates the time interval for which the license token (at the server) will remain valid. After the expiry of this interval, the server reclaims the license token. The value of this attribute can be a negative number.
tokensInUse

Details about the license in use.
From RMS 9.5 onwards, query v1.1 supports license hard limit up to 4,294,967,294. This is applicable to license version 20 (or above). For license version less than 20, maximum supported value will be 2,097,150.

driftTime If the time properties of the client and License Manager are not in sync, it returns the difference (in seconds) between the estimated current time on the Network License Server and the estimated time on the client. The estimation error is usually the network latency time.
chalRespAuthentication

In challenge-response, the License Manager associates a secret with a feature, provided by the license code. The application also contains this secret. In the License Manager validation process, an application will “challenge” the License Manager with a data string. The License Manager computes a response according to the arranged algorithm, the values, data, and secret, which it returns. The client application locally computes the expected response using data and secret, and verifies that the expected response matches the response returned by the License Manager.

refreshStatus The current status of the refresh process. This XML field returns one of the following values:

>Local - The license was refreshed
locally. A License Manager was not contacted for refreshing the license.

>Remote - The License Manager was contacted to refresh the license.

>SNTL_NO_REFRESH_SO_FAR (Default) - The license has not been refreshed till now.

Returns

Session information in XML format.

Exception Handling

If unsuccessful, throws LicensingException or UnsupportedEncodingException.