License Management
The setLicenseData() function sets or clears the license data. The legal parameter values include unchanged (-1).
Note:Different from the V4 of the Usage Intelligence SDK, a sessionID parameter can be supplied.
The setLicenseData() function can be called between createConfig() and stopSDK() and can be called zero or more times. However, the usage requirements of the sessionID parameter are different if setLicenseData() is called before startSDK() or called after startSDK(). See sessionId for more information.
The setLicenseData() function can be called while a New Registration is being performed (createConfig(), startSDK()). However, the event data is not written to the log file until the New Registration completes, and if the New Registration fails, the data will be lost.
The setLicenseData() function is an asynchronous function, returning immediately with further functionality executed on separate thread(s).
RUIResult setLicenseData(RUIKeyType keyType, RUIKeyStatus keyExpired, RUIKeyStatus keyActivated, RUIKeyStatus keyBlocked, RUIKeyStatus keyAllowed)
Parameters
The setLicenseData() function has the following parameters.
Parameter |
Description |
|||||||||
keyType (RUIKeyType) |
One of the key types from the RUIKeyType enum. Note that custom types can be used for application specific license types: UNCHANGED (-1) EVALUATION (0) PURCHASED (1) FREEWARE (2) UNKNOWN (3) NFR (4) // Not for Resale CUSTOM1 (5) CUSTOM2 (6) CUSTOM3 (7) |
|||||||||
keyExpired (RUIKeyStatus) |
Indicates whether the client license has expired. Use one of the RUIKeyStatus enum choices for the values: UNCHANGED (-1) NO (0) YES (1) |
|||||||||
keyActivated (RUIKeyStatus) |
Indicates whether the client license has been activated. Use one of the RUIKeyStatus enum choices for the values: UNCHANGED (-1) NO (0) YES (1) |
|||||||||
keyBlocked (RUIKeyStatus) |
Indicates whether the client license key has been blocked. Use one of the RUIKeyStatus enum choices for the values: UNCHANGED (-1) NO (0) YES (1) |
|||||||||
keyAllowed (RUIKeyStatus) |
Indicates whether the client license key has been allowed. Use one of the RUIKeyStatus enum choices for the values: UNCHANGED (-1) NO (0) YES (1) |
|||||||||
An optional session ID complying with above usage (content conditioning and validation rules in startSession(). The usage requirements of the sessionID parameter are different if setLicenseData() is called before startSDK() or called after startSDK().
|
Returns
The setLicenseData() function returns RUIResult enum value with the following possible values:
Return |
Description |
OK |
Function successful. |
SDK_INTERNAL_ERROR_FATAL |
Irrecoverable internal fatal error. No further API calls should be made. |
SDK_ABORTED |
A required New Registration has failed, and hence the SDK is aborted. stopSDK() is possible. |
SDK_SUSPENDED |
The Server has instructed a temporary back-off. |
SDK_PERMANENTLY_DISABLED |
The Server has instructed a permanent disable. |
SDK_OPTED_OUT |
Instance has been instructed by the application to opt-out. |
CONFIG_NOT_CREATED |
Configuration has not been successfully created. |
SDK_ALREADY_STOPPED |
SDK has already been successfully stopped. |
INVALID_SESSION_ID_EXPECTED_EMPTY |
The sessionID is expected to be empty, and it was not. |
INVALID_SESSION_ID_EXPECTED_NON_EMPTY |
The sessionID is expected to be non-empty, and it was not. |
INVALID_SESSION_ID_TOO_SHORT |
The sessionID violates its allowable minimum length. |
INVALID_SESSION_ID_TOO_LONG |
The sessionID violates its allowable maximum length. |
INVALID_SESSION_ID_NOT_ACTIVE |
The sessionID is not currently in use. |