Package com.simplicite.util.tools
Class LicenseTool
- java.lang.Object
-
- com.simplicite.util.tools.LicenseTool
-
public class LicenseTool extends java.lang.Object
License toolbox
This class only provides static variables and methods
-
-
Field Summary
Fields Modifier and Type Field Description static int
LICENSE_ERR_DATE
License key KO, incorrect datestatic int
LICENSE_ERR_IP
License key KO, incorrect IP addressstatic int
LICENSE_ERR_KEY
License key KO, incorrect keystatic int
LICENSE_ERR_NOKEY
No license keystatic int
LICENSE_ERR_OTHER
Other issue on license key (unexpected exception)static int
LICENSE_ERR_URI
License key KO, incorrect URIstatic int
LICENSE_ERR_USER
License key KO, incorrect number of usersstatic int
LICENSE_OK
License key OKstatic java.lang.String
TYPE_BOTH
Max users + Server IPsstatic java.lang.String
TYPE_FLOATING
Floating licensestatic java.lang.String
TYPE_SERVER
Server IPsstatic java.lang.String
TYPE_USER
Max users
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
checkFloatingLicense(Grant g)
Check floating licensestatic boolean
checkIP(java.lang.String hosts)
Check IP address vs hosts namestatic java.lang.String
getCurrentKeyId()
Search for key ID including the current system datestatic int
getLicenseStatus()
Get license key statusstatic int
getLicenseStatus(boolean force)
Get license key statusstatic int
getMaxUser()
Get maximum licensed usersstatic java.lang.String
getType()
Get license typestatic boolean
isFloating()
Is floating license type?static boolean
isKeyValid(ObjectDB lkey)
Is license key valid?static boolean
isLicensed()
Is the license key status OK?static int
isValid()
License key checkstatic int
isValid(ObjectDB lkey)
License key check
-
-
-
Field Detail
-
LICENSE_OK
public static final int LICENSE_OK
License key OK- See Also:
- Constant Field Values
-
LICENSE_ERR_KEY
public static final int LICENSE_ERR_KEY
License key KO, incorrect key- See Also:
- Constant Field Values
-
LICENSE_ERR_URI
public static final int LICENSE_ERR_URI
License key KO, incorrect URI- See Also:
- Constant Field Values
-
LICENSE_ERR_DATE
public static final int LICENSE_ERR_DATE
License key KO, incorrect date- See Also:
- Constant Field Values
-
LICENSE_ERR_USER
public static final int LICENSE_ERR_USER
License key KO, incorrect number of users- See Also:
- Constant Field Values
-
LICENSE_ERR_IP
public static final int LICENSE_ERR_IP
License key KO, incorrect IP address- See Also:
- Constant Field Values
-
LICENSE_ERR_NOKEY
public static final int LICENSE_ERR_NOKEY
No license key- See Also:
- Constant Field Values
-
LICENSE_ERR_OTHER
public static final int LICENSE_ERR_OTHER
Other issue on license key (unexpected exception)- See Also:
- Constant Field Values
-
TYPE_BOTH
public static final java.lang.String TYPE_BOTH
Max users + Server IPs- See Also:
- Constant Field Values
-
TYPE_USER
public static final java.lang.String TYPE_USER
Max users- See Also:
- Constant Field Values
-
TYPE_SERVER
public static final java.lang.String TYPE_SERVER
Server IPs- See Also:
- Constant Field Values
-
TYPE_FLOATING
public static final java.lang.String TYPE_FLOATING
Floating license- See Also:
- Constant Field Values
-
-
Method Detail
-
isLicensed
public static boolean isLicensed()
Is the license key status OK?- Returns:
- True if license key status is OK
-
getLicenseStatus
public static int getLicenseStatus()
Get license key status- Returns:
- License key status (one of LicenseTool.LICENSE_*)
-
getLicenseStatus
public static int getLicenseStatus(boolean force)
Get license key status- Parameters:
force
- Force check- Returns:
- License key status (one of LicenseTool.LICENSE_*)
-
getType
public static java.lang.String getType()
Get license type- Returns:
- License type (one of LicenseTool.TYPE_*)
-
isFloating
public static boolean isFloating()
Is floating license type?- Returns:
- True if floating license type
-
getMaxUser
public static int getMaxUser()
Get maximum licensed users- Returns:
- maximum licensed users
-
getCurrentKeyId
public static java.lang.String getCurrentKeyId()
Search for key ID including the current system date- Returns:
- Key ID
-
isValid
public static int isValid()
License key check- Returns:
- License key status (one of LicenseTool.LICENSE_*)
-
isValid
public static int isValid(ObjectDB lkey)
License key check- Parameters:
lkey
- License key business object- Returns:
- License key status (one of LicenseTool.LICENSE_*)
-
checkIP
public static boolean checkIP(java.lang.String hosts)
Check IP address vs hosts name- Parameters:
hosts
- Hosts names- Returns:
- True if IP address is allowed by license key
-
isKeyValid
public static boolean isKeyValid(ObjectDB lkey)
Is license key valid?- Parameters:
lkey
- License key business object- Returns:
- True if license key is valid
-
checkFloatingLicense
public static boolean checkFloatingLicense(Grant g)
Check floating license- Parameters:
g
- Grant- Returns:
- True if floating license check is OK
-
-