From 1254304eee9ef71b10ca9ffea1457d0b1459995d Mon Sep 17 00:00:00 2001 From: muneebkq Date: Wed, 24 Jul 2024 23:39:19 +0530 Subject: [PATCH] feat: Add GetFloatingClientLeaseExpiryDate method to LexFloatClient --- .../android/lexfloatclient/LexFloatClient.java | 18 ++++++++++++++++++ .../lexfloatclient/LexFloatClientNative.java | 2 ++ 2 files changed, 20 insertions(+) diff --git a/lexfloatclient/src/main/java/com/cryptlex/android/lexfloatclient/LexFloatClient.java b/lexfloatclient/src/main/java/com/cryptlex/android/lexfloatclient/LexFloatClient.java index 8f140bd..0026e86 100644 --- a/lexfloatclient/src/main/java/com/cryptlex/android/lexfloatclient/LexFloatClient.java +++ b/lexfloatclient/src/main/java/com/cryptlex/android/lexfloatclient/LexFloatClient.java @@ -108,6 +108,24 @@ public static void SetFloatingClientMetadata(String key, String value) throws Le } } + /** + * Gets the lease expiry date timestamp of the floating client. + * + * @return Returns the timestamp + * @throws LexFloatClientException + */ + public static int GetFloatingClientLeaseExpiryDate() throws LexFloatClientException { + int status; + IntByReference expiryDate = new IntByReference(0); + status = LexFloatClientNative.GetFloatingClientLeaseExpiryDate(expiryDate); + switch (status) { + case LF_OK: + return expiryDate.getValue(); + default: + throw new LexFloatClientException(status); + } + } + /** * Gets the version of this library. * diff --git a/lexfloatclient/src/main/java/com/cryptlex/android/lexfloatclient/LexFloatClientNative.java b/lexfloatclient/src/main/java/com/cryptlex/android/lexfloatclient/LexFloatClientNative.java index dcabc29..f721e04 100644 --- a/lexfloatclient/src/main/java/com/cryptlex/android/lexfloatclient/LexFloatClientNative.java +++ b/lexfloatclient/src/main/java/com/cryptlex/android/lexfloatclient/LexFloatClientNative.java @@ -28,6 +28,8 @@ public interface CallbackType extends Callback { public static native int SetFloatingLicenseCallback(CallbackType callback); public static native int SetFloatingClientMetadata(String key, String value); + + public static native int GetFloatingClientLeaseExpiryDate(IntByReference expiryDate); public static native int GetFloatingClientLibraryVersion(ByteBuffer libraryVersion, int length);