The method
License.getInstance().getStatus()
is designed to obtain the current status of a
license, which is represented by the
Status
class. Within this class, the
isValid()
method provides a boolean response that indicates whether the license status is
valid. In the event that
isValid()
returns
false
, the system assigns an error code
and an accompanying error message. This information is crucial as it offers detailed insights into the
specific reasons for the invalid license status, thereby assisting users in diagnosing the underlying
issues.
To obtain the error code and the corresponding error message, you can use the methods
License.getInstance().getStatus().getCode()
and
License.getInstance().getStatus().getMessage()
, respectively.
You can add a listener for license status changes, which will trigger notifications when the license status
code changes. This is especially useful if the license validation process runs in a separate thread or if
you have a long-running application. With this listener, you will be informed when the license status
changes (for example, if it expires or if you disable the license). The licensing library starts a timer
task after a successful license. For node-locked licenses it tries to validate license daily, for floating
licenses it tries to validate the license each 10 minutes.
License.getInstance().setStatusChangeListener((status) -> {
// do anything depending on status
});
When log level is set to error or higher, following logs are also send with logging framework.
-
1000: "not validated, use validate method"
-
1001: "license not built, use getBuilder() and build() first"
-
1002: "product hash code invalid"
-
1003: "license file not writable"
-
1004: "license registry location not writable"
-
1005: "license key format invalid"
-
1006: "custom fingerprint max size 255 characters"
-
1007: "usb dongle license file invalid, min 1 characters"
-
1008: "both custom fingerprint and usb dongle cannot be used"
-
1009: "license server address invalid"
-
1010: "usb dongle cannot be used with file and registry parameters"
-
1011: "usb dongle not detected"
-
2001: "license file or registry not exists"
-
2002: "license file read error"
-
2003: "license registry location read error"
-
2004: "loaded license data invalid"
-
3002: "license signature invalid"
-
3003: "system device fingerprint mismatch"
-
3004: "license expired"
-
3005: "license feature mismatch"
-
3006: "license key not found on the license server"
-
3007: "product, license or device disabled"
-
3008: "license max validation count reached"
-
4001: "local saved license data deleted, invalidated on the license server"
-
4002: "local saved license data deleted, not invalidated on the license server"
-
9001: "license server connection error"