Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add SetPermissionFlag() function to LexFloatClient and LexFloatClientNative classes #18

Merged
merged 6 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/main/java/com/cryptlex/lexfloatclient/LexFloatClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,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.
* <ul>
* <li> LF_USER: This flag indicates that the application does not require admin or root permissions to run.</li>
* <li> LF_ALL_USERS: This flag is specifically designed for Windows and should be used for system-wide activations.</li>
* </ul>
* @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.<br>
* Whenever the license lease is about to expire, a renew request is sent to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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);
Expand Down