diff --git a/src/main/java/com/cryptlex/lexfloatclient/LexFloatClient.java b/src/main/java/com/cryptlex/lexfloatclient/LexFloatClient.java index db09553..33743d2 100644 --- a/src/main/java/com/cryptlex/lexfloatclient/LexFloatClient.java +++ b/src/main/java/com/cryptlex/lexfloatclient/LexFloatClient.java @@ -318,6 +318,21 @@ public static int GetFloatingClientMeterAttributeUses(String name) throws LexFlo throw new LexFloatClientException(status); } + /** + * Sends the request to lease the license from the LexFloatServer for offline usage. + * The maximum value of lease duration is configured in the config.yml of LexFloatServer. + * + * @param leaseDuration value of the lease duration. + * @throws LexFloatClientException + */ + public static void RequestOfflineFloatingLicense(int leaseDuration) throws LexFloatClientException { + int status; + status = LexFloatClientNative.RequestOfflineFloatingLicense(leaseDuration); + if (LF_OK != status) { + throw new LexFloatClientException(status); + } + } + /** * Sends the request to lease the license from the LexFloatServer * diff --git a/src/main/java/com/cryptlex/lexfloatclient/LexFloatClientNative.java b/src/main/java/com/cryptlex/lexfloatclient/LexFloatClientNative.java index 90cd0e3..4e99cb9 100644 --- a/src/main/java/com/cryptlex/lexfloatclient/LexFloatClientNative.java +++ b/src/main/java/com/cryptlex/lexfloatclient/LexFloatClientNative.java @@ -65,6 +65,8 @@ public interface CallbackType extends Callback { public static native int GetFloatingClientMeterAttributeUses(WString name, IntByReference uses); + public static native int RequestOfflineFloatingLicense(int leaseDuration); + public static native int RequestFloatingLicense(); public static native int DropFloatingLicense();