public class DefaultEntitlementValidatorImpl extends AbstractLicenseLoader implements EntitlementValidator, LicenseAware
EntitlementValidator for Crafter Enterprise Edition.| Modifier and Type | Field and Description |
|---|---|
protected License |
license
Object loaded from the license file.
|
licenseFile, licenseName, objectMapper, privateKeyName, privateKeyPassword, publicKeyName| Constructor and Description |
|---|
DefaultEntitlementValidatorImpl() |
| Modifier and Type | Method and Description |
|---|---|
long |
getClientId()
Provides the client id of the current validator.
|
String |
getDescription()
Provides a general description of the current validator.
|
long |
getId()
Provides the id of the current validator.
|
String |
getPackageBuild()
Provides the build of the containing JAR file.
|
String |
getPackageVersion()
Provides the version of the containing JAR file.
|
String |
getVersion()
Provides the version of the current validator.
|
void |
init()
Performs an early validation of the license file.
|
void |
loadLicense()
Reads the license file and extracts the relevant data.
|
void |
onApplicationEvent(LicenseUpdatedEvent event)
Handles the license update event
|
void |
reloadLicense()
Performs all actions required when the license is updated.
|
void |
validateEntitlement(Module module,
EntitlementType entitlementType,
int currentValue,
int newAmount)
Checks that an entitlement is below the value indicated in the configuration file.
|
void |
validateLicense()
Performs general validations on the license object.
|
decryptLicense, readPublicKey, setLicenseFile, setLicenseName, setPrivateKeyName, setPrivateKeyPassword, setPublicKeyNameprotected License license
public void init()
throws EntitlementException
EntitlementException - if the license file is not found or can't be read.public void loadLicense()
throws EntitlementException
LicenseAwareloadLicense in interface LicenseAwareEntitlementException - if there is any error reading the license filepublic void validateLicense()
public void validateEntitlement(Module module, EntitlementType entitlementType, int currentValue, int newAmount)
validateEntitlement in interface EntitlementValidatormodule - module requesting the validationentitlementType - entitlement to be validatedcurrentValue - current value provided by the modulenewAmount - amount of items to be createdpublic long getId()
getId in interface EntitlementValidatorpublic long getClientId()
getClientId in interface EntitlementValidatorpublic String getVersion()
getVersion in interface EntitlementValidatorpublic String getDescription()
getDescription in interface EntitlementValidatorpublic String getPackageVersion()
getPackageVersion in interface EntitlementValidatorpublic String getPackageBuild()
getPackageBuild in interface EntitlementValidatorpublic void reloadLicense()
reloadLicense in interface LicenseAwarepublic void onApplicationEvent(LicenseUpdatedEvent event)
onApplicationEvent in interface LicenseAwareonApplicationEvent in interface org.springframework.context.ApplicationListener<LicenseUpdatedEvent>event - the eventCopyright © 2019 CrafterCMS. All rights reserved.