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 RequestOfflineFloatingLicense method for offline license leasing #14

Merged
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
15 changes: 15 additions & 0 deletions src/main/java/com/cryptlex/lexfloatclient/LexFloatClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down