Class LicenseModel

    • Constructor Detail

      • LicenseModel

        public LicenseModel​(byte[] licenseFileData)
        Parameters:
        licenseFileData - the license-file
    • Method Detail

      • getLicense

        public javax0.license3j.License getLicense()
        Initializes the license (if needed) and returns them
        Returns:
        the license
      • getLicenseFileData

        public byte[] getLicenseFileData()
        The license binary
        Returns:
        the binary data of the license
      • isSkipHardwareIdCheck

        public boolean isSkipHardwareIdCheck()
        Returns:
        true to skip the hardware check and allow all hardware IDs, false to perform the hardware ID check. May be useful for development and testing.
      • isSubLicense

        public boolean isSubLicense()
        Returns:
        true if the license is an sub-license, false otherwise
      • isLicenseOK

        public boolean isLicenseOK()
        Returns:
        true if the license-file is ok, false otherwise
      • isValidLicense

        public boolean isValidLicense​(String parentKey)
        Parameters:
        parentKey - the parent-key to check
        Returns:
        true if the license is valid, false otherwise
      • isDemoLicense

        public boolean isDemoLicense()
        Returns:
        true if the license is an demo, false otherwise
      • getLicenseStatus

        public ELicenseState getLicenseStatus​(String parentKey)
        Checks the license state
        Parameters:
        parentKey - the parent-key to check
        Returns:
        the license state
      • isNewHardwareId

        public boolean isNewHardwareId()
      • isMaintenanceExpired

        public boolean isMaintenanceExpired()
        Returns:
        true if the maintenance-period is expired, false otherwise
      • isExpired

        public boolean isExpired()
        Returns:
        true if the license is expired, false otherwise
      • getLicenseKey

        public String getLicenseKey()
        Returns:
        the license key or null
      • getHardwareIds

        public String[] getHardwareIds()
        Returns:
        the array of hardware-ids
      • getLicenseName

        public String getLicenseName()
        Returns:
        the name of the license
      • getLicenseMappingName

        public String getLicenseMappingName()
        Returns:
        the mapping name of the licnese
      • getVersionKey

        public String getVersionKey()
        Returns:
        the key of the license version
      • getParentLicenseKey

        public String getParentLicenseKey()
        Returns:
        the key of the parent license
      • getProductKey

        public String getProductKey()
        Returns:
        the key of the product
      • getProductName

        public String getProductName()
        Returns:
        the name of the product
      • getProductVersion

        public String getProductVersion()
        Returns:
        the version of the product
      • getUserFullName

        public String getUserFullName()
        Returns:
        the name of the license user
      • getUserEMail

        public String getUserEMail()
        Returns:
        the email of the license user
      • getUserCompanyName

        public String getUserCompanyName()
        Returns:
        the name of the company
      • getUserTelNumber

        public String getUserTelNumber()
        Returns:
        the phone number of the user
      • getLicenseCreationDate

        public LocalDateTime getLicenseCreationDate()
        Returns:
        the creation date of the license
      • getLicenseModificationDate

        public LocalDateTime getLicenseModificationDate()
        Returns:
        the modification date of the license
      • getLicenseExpireDate

        public LocalDateTime getLicenseExpireDate()
        Returns:
        the expire date of the license
      • getMaintenanceExpireDate

        public LocalDateTime getMaintenanceExpireDate()
        Returns:
        the maintenance expire date of the license
      • hasFeature

        public boolean hasFeature​(ELicenseFeature feature)
        Parameters:
        feature - ELicenseFeature the feature to check
        Returns:
        true if the feature is defined, false otherwise
      • hasFeature

        public boolean hasFeature​(String featureName)
        Parameters:
        featureName - the name of the feature to check
        Returns:
        true if the feature is defined, false otherwise
      • getString

        public String getString​(ELicenseFeature feature)
        Parameters:
        feature - the feature to get
        Returns:
        the value
      • getBoolean

        public boolean getBoolean​(ELicenseFeature feature)
        Parameters:
        feature - the feature to get
        Returns:
        the value
      • getNumber

        public Number getNumber​(ELicenseFeature feature)
        Parameters:
        feature - the feature to get
        Returns:
        the value
      • getString

        public String getString​(ELicenseFeature feature,
                                String defaultValue)
        Parameters:
        feature - the feature to get
        defaultValue - the default value to return if the feature is not defined
        Returns:
        the value
      • getBoolean

        public boolean getBoolean​(ELicenseFeature feature,
                                  boolean defaultValue)
        Parameters:
        feature - the feature to get
        defaultValue - the default value to return if the feature is not defined
        Returns:
        the value
      • getNumber

        public Number getNumber​(ELicenseFeature feature,
                                Number defaultValue)
        Parameters:
        feature - the feature to get
        defaultValue - the default value to return if the feature is not defined
        Returns:
        the value
      • getDate

        public LocalDateTime getDate​(ELicenseFeature feature,
                                     LocalDateTime defaultValue)
        Parameters:
        feature - the feature to get
        defaultValue - the default value to return if the feature is not defined
        Returns:
        the value
      • isValid

        public boolean isValid​(ELicenseFeature feature)
        Parameters:
        feature - the feature to check
        Returns:
        true if the feature is valid, false otherwise
      • isValid

        public boolean isValid​(String featureName)
        Parameters:
        featureName - the name of the feature to check
        Returns:
        true if the feature is valid, false otherwise
      • getExpireDate

        public LocalDateTime getExpireDate​(ELicenseFeature feature)
        Parameters:
        feature - the feature to get the expire date of
        Returns:
        the expire date of the feature or null
      • getExpireDate

        public LocalDateTime getExpireDate​(String featureName)
        Parameters:
        featureName - the name of the feature to get the expire date of
        Returns:
        the expire date of the feature or null
      • getComment

        public String getComment​(ELicenseFeature feature)
        Parameters:
        feature - the feature to get the comment of
        Returns:
        the comment of the feature or null
      • getComment

        public String getComment​(String featureName)
        Parameters:
        featureName - the name of the feature to get the comment of
        Returns:
        the comment of the feature or null
      • getDate

        public LocalDateTime getDate​(String featureName)
        Parameters:
        featureName - the name of the feature to get the date value from
        Returns:
        the date value of the feature or null
      • getDate

        public LocalDateTime getDate​(String featureName,
                                     LocalDateTime defaultValue)
        Parameters:
        featureName - the name of the feature to get the date value from
        defaultValue - the default value to return if the feature is not defined
        Returns:
        the date value of the feature or the default value
      • getString

        public String getString​(String featureName)
        Parameters:
        featureName - the name of the feature to get the string value from
        Returns:
        the string value of the feature or null
      • getString

        public String getString​(String featureName,
                                String defaultValue)
        Parameters:
        featureName - the name of the feature to get the string value from
        defaultValue - the default value to return if the feature is not defined
        Returns:
        the string value of the feature or the default value
      • getBoolean

        public boolean getBoolean​(String featureName)
        Parameters:
        featureName - the name of the feature to get the boolean value from
        Returns:
        the boolean value of the feature or null
      • getBoolean

        public boolean getBoolean​(String featureName,
                                  boolean defaultValue)
        Parameters:
        featureName - the name of the feature to get the boolean value from
        defaultValue - the default value to return if the feature is not defined
        Returns:
        the boolean value of the feature or the default value
      • getNumber

        public Number getNumber​(String featureName)
        Parameters:
        featureName - the name of the feature to get the string value from
        Returns:
        the number value of the feature or 0
      • getNumber

        public Number getNumber​(String featureName,
                                Number defaultValue)
        Parameters:
        featureName - the name of the feature to get the number value from
        defaultValue - the default value to return if the feature is not defined
        Returns:
        the number value of the feature or the default value
      • getProcessingLicenseKey

        public static String getProcessingLicenseKey​(String typeSubKey)
      • getRawData

        public String getRawData()
      • getTriggerLicenseKey

        public static String getTriggerLicenseKey​(String typeSubKey)