Skip to content

Commit ef4e765

Browse files
authored
Merge pull request #14 from cryptlex/muneeb/request-offline-floating-license
feat: add RequestOfflineFloatingLicense method for offline license leasing
2 parents c62a261 + ab3f56b commit ef4e765

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

src/main/java/com/cryptlex/lexfloatclient/LexFloatClient.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,21 @@ public static int GetFloatingClientMeterAttributeUses(String name) throws LexFlo
387387
throw new LexFloatClientException(status);
388388
}
389389

390+
/**
391+
* Sends the request to lease the license from the LexFloatServer for offline usage.
392+
* The maximum value of lease duration is configured in the config.yml of LexFloatServer.
393+
*
394+
* @param leaseDuration value of the lease duration.
395+
* @throws LexFloatClientException
396+
*/
397+
public static void RequestOfflineFloatingLicense(int leaseDuration) throws LexFloatClientException {
398+
int status;
399+
status = LexFloatClientNative.RequestOfflineFloatingLicense(leaseDuration);
400+
if (LF_OK != status) {
401+
throw new LexFloatClientException(status);
402+
}
403+
}
404+
390405
/**
391406
* Sends the request to lease the license from the LexFloatServer
392407
*

src/main/java/com/cryptlex/lexfloatclient/LexFloatClientNative.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ public interface CallbackType extends Callback {
7575

7676
public static native int GetFloatingClientMeterAttributeUses(WString name, IntByReference uses);
7777

78+
public static native int RequestOfflineFloatingLicense(int leaseDuration);
79+
7880
public static native int RequestFloatingLicense();
7981

8082
public static native int DropFloatingLicense();

0 commit comments

Comments
 (0)