This sample demonstrates the use of the Sentinel LDK-EMS web services (product key and fetch pending updates using C2V) for the Java programming language.
Sentinel LDK-EMS web services are used in conjunction with various Sentinel Licensing API functions to communicate with the Sentinel LDK-EMS Server.
If no protection key exists on the user's machine, use the Product Key Activation web service.
If an HL or SL key exists on the machine, use the Fetch Pending Updates by C2V web service. This fetches all pending updates (if such exist), combined into a single package and returned in the V2CP (Vendor-to-Customer package) format.
Java SE 8 (JRE 8 and JDK 8).
Refer to the Sentinel LDK Release Notes - "Supported Platforms for Code Samples" and "Tested Compilers for Code Samples" sections.
This section describes how to customize and compile the sample.
The Sentinel Java Activation sample contains the Sentinel LDK Java samples, together with the Sentinel LDK Java package and the JRE libraries.
To use the Sentinel LDK Java API, copy the JRE libraries and the generated API library to the directory in which the operating system's dynamic libraries are residing.
Under Linux, copy the JRE libraries to one of the following:
Under macOS, copy the JRE libraries to the following:
Before compiling the samples with build_samples
, set the
JDK environment variable to the path where Java is installed.
For example: set JDK=p:\java\j2sdk1.8
To compile the samples, run the build_samples script.
To run the samples, run the run_sample script.
The sample consists of two flows: Product Key Activation and Fetch Pending Updates using C2V.
The steps performed in Product Key Activation flow are as follows:
The steps performed in the Fetch Pending Updates using C2V flow are as follows:
Method fetchPollingFreqFromResponse(HttpURLConnection conn) can be used to read the header polling-frequency value from the web service response.
If you want to write a routine to periodically call the Fetch Pending Updates using C2V web service to check for updates, you can use this value to set the polling frequency.
For more information, see the Sentinel LDK–EMS Web Services Guide.
The Activation sample contains the following components:
Operating System | Directory or File | Description |
---|---|---|
All | classes
|
Directory that contains the Activation Sample compiled files |
All | src
|
Directory that contains the Activation Java sources |
Windows: Mac: Linux: |
build_sample.bat
|
Batch file for building the Java samples |
All | activation.properties
|
This file contains the folllowing properties:
Modify the properties as required. Save the file using the UTF-8 format. |
Windows: Mac: Linux: |
run_sample.bat
|
Batch file for running the activation sample. Note: (For Windows) If proxy settings are required, update the batch file with this line: (Enter this as a single line of text .Modify the host, port, user, and password parameters as required.)
Dhttp with Dhttps .
|
All | hasp-srm-api.jar
|
JAR file with the compiled Sentinel LDK Runtime Java package |
Windows: Mac: |
HASPJava.dll
|
Sentinel LDK Runtime JRE library for x86 |
Windows: Mac: Linux: |
HASPJava_x64.dll
|
Sentinel LDK Runtime JRE library for x64 |
Windows: Mac: |
hasp_windows_demo.dll
|
Sentinel LDK Runtime API library for x86 |
Windows: Mac: Linux: |
hasp_windows_x64_demo.dll
|
Sentinel LDK Runtime API library for x64 |
Copyright © 2022 Thales Group. All rights reserved. Support