Class LicenseTool


  • public class LicenseTool
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      LicenseTool()
      Constructor
      Don't instantiate this class, it only provides static variables and methods
    • Method Summary

      Modifier and Type Method Description
      static boolean checkFloatingLicense​(Grant g)
      Check floating license
      static boolean checkIP​(java.lang.String hosts)
      Check IP address vs hosts name
      static java.lang.String getCurrentKeyId()
      Search for key ID including the current system date
      static int getLicenseStatus()  
      static int getLicenseStatus​(boolean force)  
      static int getMaxUser()  
      static java.lang.String getType()  
      static boolean isFloating()  
      static boolean isKeyValid​(ObjectDB lkey)
      Is license key valid?
      static boolean isLicensed()
      Is the license key OK ?
      static int isValid()
      License key check
      static int isValid​(ObjectDB lkey)
      License key check
      static void localAuthent​(java.lang.String login, java.lang.String password)
      Local authentication
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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
    • Constructor Detail

      • LicenseTool

        public LicenseTool()
        Constructor
        Don't instantiate this class, it only provides static variables and methods
    • Method Detail

      • isLicensed

        public static boolean isLicensed()
        Is the license key OK ?
        Returns:
        license key OK
      • getLicenseStatus

        public static int getLicenseStatus()
      • getLicenseStatus

        public static int getLicenseStatus​(boolean force)
      • getType

        public static java.lang.String getType()
      • isFloating

        public static boolean isFloating()
      • getMaxUser

        public static int getMaxUser()
      • getCurrentKeyId

        public static java.lang.String getCurrentKeyId()
        Search for key ID including the current system date
      • isValid

        public static int isValid()
        License key check
        Returns:
        one of the possible value LICENSE_*
      • isValid

        public static int isValid​(ObjectDB lkey)
        License key check
        Returns:
        one of the possible value LICENSE_*
      • checkIP

        public static boolean checkIP​(java.lang.String hosts)
        Check IP address vs hosts name
        Parameters:
        hosts - Hosts names
      • isKeyValid

        public static boolean isKeyValid​(ObjectDB lkey)
        Is license key valid?
        Parameters:
        lkey - License key
      • checkFloatingLicense

        public static boolean checkFloatingLicense​(Grant g)
        Check floating license
        Parameters:
        g - Grant
      • localAuthent

        public static void localAuthent​(java.lang.String login,
                                        java.lang.String password)
                                 throws java.lang.Exception
        Local authentication
        Parameters:
        login - Login
        password - Password
        Throws:
        java.lang.Exception