Class LicenseTool


  • public class LicenseTool
    extends java.lang.Object
    License toolbox
    This class only provides static variables and methods
    • Field Detail

      • 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_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