diff --git a/src/main/java/com/cryptlex/lexfloatclient/LexFloatClient.java b/src/main/java/com/cryptlex/lexfloatclient/LexFloatClient.java index be75929..d4ef204 100644 --- a/src/main/java/com/cryptlex/lexfloatclient/LexFloatClient.java +++ b/src/main/java/com/cryptlex/lexfloatclient/LexFloatClient.java @@ -58,6 +58,28 @@ public static void SetHostUrl(String hostUrl) throws LexFloatClientException { } } + /** + * Sets the permission flag. This function must be called on every start of your program + * after SetHostProductId() function in case the application allows borrowing of licenses + * or system wide activation. + * + * @param flag depending on your application's requirements, choose one of + * the following values: LF_USER, LF_ALL_USERS. + * + * @throws LexFloatClientException + */ + public static void SetPermissionFlag(int flag) throws LexFloatClientException { + int status; + status = LexFloatClientNative.SetPermissionFlag(flag) + + if (LF_OK != status) { + throw new LexFloatClientException(status); + } + } + /** * Sets the renew license callback function.
* Whenever the license lease is about to expire, a renew request is sent to diff --git a/src/main/java/com/cryptlex/lexfloatclient/LexFloatClientNative.java b/src/main/java/com/cryptlex/lexfloatclient/LexFloatClientNative.java index 4ec002e..a03e00c 100644 --- a/src/main/java/com/cryptlex/lexfloatclient/LexFloatClientNative.java +++ b/src/main/java/com/cryptlex/lexfloatclient/LexFloatClientNative.java @@ -20,6 +20,9 @@ public class LexFloatClientNative implements Library { public interface CallbackType extends Callback { void invoke(int status); } + /* Permission Flags */ + public static final int LF_USER = 10; + public static final int LF_ALL_USERS = 11; public static native int SetHostProductId(String productId); @@ -29,6 +32,8 @@ public interface CallbackType extends Callback { public static native int SetHostUrl(WString hostUrl); + public static native int SetPermissionFlag(int flags); + public static native int SetFloatingLicenseCallback(CallbackType callback); public static native int SetFloatingClientMetadata(String key, String value);