Class HybrisLicenceValidator


  • public class HybrisLicenceValidator
    extends java.lang.Object
    • Constructor Detail

      • HybrisLicenceValidator

        public HybrisLicenceValidator()
    • Method Detail

      • checkLicence

        public ValidationResult checkLicence​(Licence licence)
                                      throws java.lang.IllegalStateException,
                                             java.lang.NullPointerException
        Checks whether passed licence file is valid.
        Parameters:
        licence - to check
        Throws:
        java.lang.IllegalStateException - in case of validation failure, exception message contains reason of validation failure
        java.lang.NullPointerException - when passed licence parameter is null
      • isLicenceExpiredIfDemoLicence

        public boolean isLicenceExpiredIfDemoLicence​(Licence licence,
                                                     HybrisDataSource dataSource)
        This method checks whether demo/develop has expired. Demo/develop licence is valid for 30 days since last initialization. This method required system to be initialized.
        Parameters:
        licence - to check
        Returns:
        true if licence has expired, false otherwise
      • getDaysLeft

        public java.lang.Integer getDaysLeft​(Licence licence,
                                             HybrisDataSource dataSource)
        This method returns number of days left for licence if it is develop/demo licence, otherwise null.
        Parameters:
        licence - to check
        Returns:
        number of days left (negative value if expired) or null if it is not develop/demo licence