Class ACSPLicense

    • Constructor Detail

      • ACSPLicense

        public ACSPLicense​(java.lang.String path)
                    throws java.lang.Exception
        Конструктор.
        Parameters:
        path - Путь к файлу лицензии.
        Throws:
        java.lang.Exception
    • Method Detail

      • getSerialNumber

        public java.lang.String getSerialNumber()
        Description copied from interface: LicenseInterface
        Получение серийного номера.
        Specified by:
        getSerialNumber in interface LicenseInterface
        Returns:
        серийный номер.
      • getMaskedSerialNumber

        public java.lang.String getMaskedSerialNumber()
        Description copied from interface: LicenseInterface
        Отображение номера лицензии в скрытом виде. Используется в визуальных компонентах.
        Specified by:
        getMaskedSerialNumber in interface LicenseInterface
        Returns:
        номер лицензии в скрытом виде.
      • checkAndSave

        public int checkAndSave()
        Description copied from interface: LicenseInterface
        Проверка (и сохранение) существующего серийного номера лицензии. При этом может быть также сохранена дата установки.
        Specified by:
        checkAndSave in interface LicenseInterface
        Returns:
        статус существующей лицензии.
      • checkAndSave

        public int checkAndSave​(java.lang.String number,
                                boolean strict)
        Description copied from interface: LicenseInterface
        Проверка (и сохранение) нового серийного номера лицензии. При этом в файл лицензии может быть сохранена дата установки, если она отсутствует. Дата установки декодируется в строку.
        Specified by:
        checkAndSave in interface LicenseInterface
        Parameters:
        number - номер лицензии.
        strict - True, если даже expired лицензия должна означать ошибку (invalid) и не допускать обработки, например, при вводе лицензии в окне. В остальных случаях можно применить false.
        Returns:
        статус новой лицензии.
      • saveDefaultLicense

        public void saveDefaultLicense()
        Сброс лицензии.
      • getExistingLicenseStatus

        public int getExistingLicenseStatus()
        Description copied from interface: LicenseInterface
        Возвращает статус существующей лицензии.
        Specified by:
        getExistingLicenseStatus in interface LicenseInterface
        Returns:
        статус существующей лицензии.
      • getLicenseInstallDateAsString

        public java.lang.String getLicenseInstallDateAsString()
        Description copied from interface: LicenseInterface
        Возвращает дату установки лицензии (приложения) в виде строки.
        Specified by:
        getLicenseInstallDateAsString in interface LicenseInterface
        Returns:
        дата установки.
      • getLicenseInstallDate

        public java.util.Date getLicenseInstallDate()
        Description copied from interface: LicenseInterface
        Возвращает дату установки лицензии (приложения).
        Specified by:
        getLicenseInstallDate in interface LicenseInterface
        Returns:
        дата установки.
      • getExpiredThroughDays

        public int getExpiredThroughDays()
        Description copied from interface: LicenseInterface
        Возвращает количество дней, оставшихся до истечения даты лицензии.
        Specified by:
        getExpiredThroughDays in interface LicenseInterface
        Returns:
        количество дней.
      • getLicenseType

        public int getLicenseType()
        Description copied from interface: LicenseInterface
        Возвращает тип лицензии.
        Specified by:
        getLicenseType in interface LicenseInterface
        Returns:
        тип лицензии.
      • save

        public void save()
                  throws java.lang.Exception
        Сохранение настроек. Не используется, т.к. сохранение даты установки и введенного номера лицензии происходит в криптографической библиотеке.
        Specified by:
        save in class ru.cprocsp.ACSP.tools.config.AbstractFile
        Throws:
        java.lang.Exception