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 status code #13

Merged
merged 9 commits into from
Aug 6, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,32 @@ public static String getErrorMessage(int errorCode) {
message = "No product version is linked with the license.";
break;
case LF_E_FEATURE_FLAG_NOT_FOUND:
message = "The product version feature flag does not exist.";
message = "The product version feature flag does not exist.";
break;
case LF_E_IP:
message = "IP address is not allowed.";
break;
case LF_E_SYSTEM_PERMISSION:
message = "Insufficient system permissions.";
break;
case LF_E_INVALID_PERMISSION_FLAG:
message = "Invalid permission flag.";
break;
case LF_E_OFFLINE_FLOATING_LICENSE_NOT_ALLOWED:
message = "Offline floating license is not allowed for per-instance leasing strategy.";
break;
case LF_E_MAX_OFFLINE_LEASE_DURATION_EXCEEDED:
message = "Maximum offline lease duration exceeded.";
break;
case LF_E_ALLOWED_OFFLINE_FLOATING_CLIENTS_LIMIT_REACHED:
message = "Allowed offline floating clients limit reached.";
break;
case LF_E_WMIC:
message = "Fingerprint couldn't be generated because Windows Management Instrumentation (WMI) service has been disabled.";
break;
case LF_E_MACHINE_FINGERPRINT:
message = "Machine fingerprint has changed since activation.";
break;
case LF_E_CLIENT:
message = "Client error.";
break;
Expand All @@ -101,13 +122,14 @@ public static String getErrorMessage(int errorCode) {
case LF_E_SERVER_LICENSE_GRACE_PERIOD_OVER:
message = "The grace period for server license is over.";
break;
case LF_E_PROXY_NOT_TRUSTED:
message = "Request blocked due to untrusted proxy.";
break;
default:
message = "Unknown error!";

}
return message;
}

/*
* CODE: LF_OK
*
Expand Down Expand Up @@ -245,25 +267,78 @@ public static String getErrorMessage(int errorCode) {

/*
* CODE: LF_E_PRODUCT_VERSION_NOT_LINKED
*
*
* MESSAGE: No product version is linked with the license.
*/
public static final int LF_E_PRODUCT_VERSION_NOT_LINKED = 57;

/*
* CODE: LF_E_FEATURE_FLAG_NOT_FOUND
*
*
* MESSAGE: The product version feature flag does not exist.
*/
public static final int LF_E_FEATURE_FLAG_NOT_FOUND = 58;

/*
* Insufficient system permissions.
*/
public static final int LF_E_SYSTEM_PERMISSION = 59;

/*
* CODE: LF_E_IP
*
* MESSAGE: IP address is not allowed.
*/
public static final int LF_E_IP = 60;

/*
* CODE: LF_E_INVALID_PERMISSION_FLAG
*
* MESSAGE: Invalid permission flag.
*/
public static final int LF_E_INVALID_PERMISSION_FLAG = 61;

/*
* CODE: LF_E_OFFLINE_FLOATING_LICENSE_NOT_ALLOWED
*
* MESSAGE: Offline floating license is not allowed for per-instance leasing strategy.
*/
public static final int LF_E_OFFLINE_FLOATING_LICENSE_NOT_ALLOWED = 62;

/*
* CODE: LF_E_MAX_OFFLINE_LEASE_DURATION_EXCEEDED
*
* MESSAGE: Maximum offline lease duration exceeded.
*/
public static final int LF_E_MAX_OFFLINE_LEASE_DURATION_EXCEEDED = 63;

/*
* CODE: LF_E_ALLOWED_OFFLINE_FLOATING_CLIENTS_LIMIT_REACHED
*
* MESSAGE: Allowed offline floating clients limit reached.
*/
public static final int LF_E_ALLOWED_OFFLINE_FLOATING_CLIENTS_LIMIT_REACHED = 64;

/*
* CODE: LF_E_WMIC
*
* MESSAGE: Fingerprint couldn't be generated because Windows Management Instrumentation (WMI) service has been disabled.
*/
public static final int LF_E_WMIC = 65;

/*
* CODE: LF_E_MACHINE_FINGERPRINT
*
* MESSAGE: Machine fingerprint has changed since activation.
*/
public static final int LF_E_MACHINE_FINGERPRINT = 66;
/*
* CODE: LF_E_PROXY_NOT_TRUSTED
*
* MESSAGE: Request blocked due to untrusted proxy.
*/
public static final int LF_E_PROXY_NOT_TRUSTED = 67;

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@muneebkq please check error code properly.

/*
* CODE: LF_E_CLIENT
*
Expand Down Expand Up @@ -313,4 +388,4 @@ public static String getErrorMessage(int errorCode) {
* MESSAGE: The grace period for server license is over.
*/
public static final int LF_E_SERVER_LICENSE_GRACE_PERIOD_OVER = 76;
}
}