Skip to content

Commit ab3f56b

Browse files
committed
feat: add RequestOfflineFloatingLicense method for offline license leasing
1 parent ac11888 commit ab3f56b

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
@@ -318,6 +318,21 @@ public static int GetFloatingClientMeterAttributeUses(String name) throws LexFlo
318318
throw new LexFloatClientException(status);
319319
}
320320

321+
/**
322+
* Sends the request to lease the license from the LexFloatServer for offline usage.
323+
* The maximum value of lease duration is configured in the config.yml of LexFloatServer.
324+
*
325+
* @param leaseDuration value of the lease duration.
326+
* @throws LexFloatClientException
327+
*/
328+
public static void RequestOfflineFloatingLicense(int leaseDuration) throws LexFloatClientException {
329+
int status;
330+
status = LexFloatClientNative.RequestOfflineFloatingLicense(leaseDuration);
331+
if (LF_OK != status) {
332+
throw new LexFloatClientException(status);
333+
}
334+
}
335+
321336
/**
322337
* Sends the request to lease the license from the LexFloatServer
323338
*

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

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

6666
public static native int GetFloatingClientMeterAttributeUses(WString name, IntByReference uses);
6767

68+
public static native int RequestOfflineFloatingLicense(int leaseDuration);
69+
6870
public static native int RequestFloatingLicense();
6971

7072
public static native int DropFloatingLicense();

0 commit comments

Comments
 (0)