public class Helpers
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
class |
Helpers.MyClass<T> |
Constructor and Description |
---|
Helpers() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
GetMachineCode()
Returns a unique identifier of the device.
|
static boolean |
HasExpired(LicenseKey licenseKey)
Check if the current license has expired.
|
static boolean |
HasFeature(LicenseKey licenseKey,
int feature)
Check if the license has a certain feature enabled (i.e.
|
static boolean |
HasFeature(LicenseKey licenseKey,
java.lang.String featureName)
Uses a special data object associated with the license key to determine if a certain feature exists (instead of the 8 feature flags).
|
static boolean |
HasNotExpired(LicenseKey licenseKey)
Check if the current license has not expired.
|
static boolean |
IsOnRightMachine(LicenseKey license)
Check if the device is registered with the license key.
|
static boolean |
IsOnRightMachine(LicenseKey license,
boolean isFloatingLicense)
Check if the device is registered with the license key.
|
static boolean |
IsOnRightMachine(LicenseKey license,
boolean isFloatingLicense,
boolean allowOverdraft)
Check if the device is registered with the license key.
|
static boolean |
IsOnRightMachine(LicenseKey license,
java.lang.String machineCode)
Check if the device is registered with the license key.
|
static boolean |
IsOnRightMachine(LicenseKey license,
java.lang.String machineCode,
boolean isFloatingLicense)
Check if the device is registered with the license key.
|
static boolean |
IsOnRightMachine(LicenseKey license,
java.lang.String machineCode,
boolean isFloatingLicense,
boolean allowOverdraft)
Check if the device is registered with the license key.
|
static boolean |
IsSuccessful(BasicResult result)
Checks if a response from Cryptolens is successful.
|
public static java.lang.String GetMachineCode()
public static boolean IsOnRightMachine(LicenseKey license)
license
- The license key object.public static boolean IsOnRightMachine(LicenseKey license, boolean isFloatingLicense)
license
- The license key object.isFloatingLicense
- If this is a floating license, this parameter has to be set to true.
You can enable floating licenses by setting @see ActivateModel.FloatingTimeInterval.public static boolean IsOnRightMachine(LicenseKey license, boolean isFloatingLicense, boolean allowOverdraft)
license
- The license key objectisFloatingLicense
- If this is a floating license, this parameter has to be set to true.
You can enable floating licenses by setting @see ActivateModel.FloatingTimeInterval.allowOverdraft
- If floating licensing is enabled with overdraft, this parameter should be set to true.
You can enable overdraft by setting ActivateModel.MaxOverdraft" to a value greater than 0.public static boolean IsOnRightMachine(LicenseKey license, java.lang.String machineCode)
license
- The license key object.machineCode
- The machine code of the current device.public static boolean IsOnRightMachine(LicenseKey license, java.lang.String machineCode, boolean isFloatingLicense)
license
- The license key object.machineCode
- The machine code of the current device.isFloatingLicense
- If this is a floating license, this parameter has to be set to true.
You can enable floating licenses by setting @see ActivateModel.FloatingTimeInterval.public static boolean IsOnRightMachine(LicenseKey license, java.lang.String machineCode, boolean isFloatingLicense, boolean allowOverdraft)
license
- The license key object.machineCode
- The machine code of the current device.isFloatingLicense
- If this is a floating license, this parameter has to be set to true.
You can enable floating licenses by setting @see ActivateModel.FloatingTimeInterval.allowOverdraft
- If floating licensing is enabled with overdraft, this parameter should be set to true.
You can enable overdraft by setting ActivateModel.MaxOverdraft" to a value greater than 0.public static boolean HasExpired(LicenseKey licenseKey)
licenseKey
- a license key object.public static boolean HasNotExpired(LicenseKey licenseKey)
licenseKey
- a license key object.public static boolean HasFeature(LicenseKey licenseKey, int feature)
licenseKey
- a license key object.feature
- The feature, eg 1 to 8.public static boolean HasFeature(LicenseKey licenseKey, java.lang.String featureName)
Uses a special data object associated with the license key to determine if a certain feature exists (instead of the 8 feature flags).
Formatting: The name of the data object should be 'cryptolens_features' and it should be structured as a JSON array.
For example,
["f1", "f2"]
means f1 and f2 are true. You can also have feature bundling, eg.
["f1", ["f2",["voice","image"]]]
which means that f1 and f2 are true, as well as f2.limited and f2.image. You can set any depth, eg. you can have
["f1", ["f2",[["voice",["all"]], "image"]]]
means f2.voice.all is true as well as f2.voice and f2. The dots symbol is used to specify the "sub-features".
licenseKey
- a license key object.featureName
- the name of the feature (case-sensitive).public static boolean IsSuccessful(BasicResult result)
result
- The response from an API call. All responses inherit from BasicResult.