Skip to content

Commit

Permalink
Merge pull request #13 from cryptlex/muneeb/status-code
Browse files Browse the repository at this point in the history
feat: add status code
  • Loading branch information
ahmad-kemsan authored Aug 6, 2024
2 parents ac11888 + 4b6de3f commit 77bd83e
Showing 1 changed file with 81 additions and 6 deletions.
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;

/*
* 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;
}
}

0 comments on commit 77bd83e

Please sign in to comment.