Class HybrisLicenceValidator
- java.lang.Object
-
- de.hybris.platform.licence.internal.HybrisLicenceValidator
-
public class HybrisLicenceValidator extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEMO_LICENCE_DAYS
-
Constructor Summary
Constructors Constructor Description HybrisLicenceValidator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ValidationResult
checkLicence(Licence licence)
Checks whether passed licence file is valid.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.protected HybrisLicenceCrypto
getHybrisCrypto()
protected HybrisLicenceDAO
getHybrisLicenceDAO()
boolean
isLicenceExpiredIfDemoLicence(Licence licence, HybrisDataSource dataSource)
This method checks whether demo/develop has expired.
-
-
-
Field Detail
-
DEMO_LICENCE_DAYS
public static final int DEMO_LICENCE_DAYS
- See Also:
- Constant Field Values
-
-
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 failurejava.lang.NullPointerException
- when passed licence parameter is null
-
getHybrisCrypto
protected HybrisLicenceCrypto getHybrisCrypto()
-
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
-
getHybrisLicenceDAO
protected HybrisLicenceDAO getHybrisLicenceDAO()
-
-