Package com.atlassian.jira.bc.license
Class LicenseValidationInfo
java.lang.Object
com.atlassian.jira.bc.license.LicenseValidationInfo
- All Implemented Interfaces:
LicenseValidationInformation
A set of methods which describe the validation information of a specific license details of a specific
ApplicationKey
of the currently installed license.- Since:
- v8.9
-
Constructor Summary
ConstructorsConstructorDescriptionLicenseValidationInfo(com.atlassian.sal.api.license.RawProductLicense rawProductLicense, Optional<LicenseDetails> licenseDetail) LicenseValidationInfo(com.atlassian.sal.api.license.RawProductLicense rawProductLicense, Optional<LicenseDetails> licenseDetail, com.atlassian.sal.api.validate.LicenseValidationResult licenseValidationResult) -
Method Summary
Modifier and TypeMethodDescriptionOptional<com.atlassian.application.api.ApplicationKey>com.atlassian.sal.api.validate.LicenseValidationResultbooleanbooleanbooleanbooleanbooleanwith(com.atlassian.sal.api.validate.LicenseValidationResult licenseValidationResult) withWarning(com.atlassian.sal.api.validate.LicenseWarningCode licenseWarningCode, String warningMessage) withWarnings(Set<com.atlassian.sal.api.validate.LicenseValidationWarning> warnings)
-
Constructor Details
-
LicenseValidationInfo
public LicenseValidationInfo(@Nonnull com.atlassian.sal.api.license.RawProductLicense rawProductLicense, @Nonnull Optional<LicenseDetails> licenseDetail) - Parameters:
rawProductLicense- the productKey and license string that plan to be validated.licenseDetail- the license detail of theRawProductLicense.getLicense()
-
LicenseValidationInfo
public LicenseValidationInfo(@Nonnull com.atlassian.sal.api.license.RawProductLicense rawProductLicense, @Nonnull Optional<LicenseDetails> licenseDetail, @Nonnull com.atlassian.sal.api.validate.LicenseValidationResult licenseValidationResult) - Parameters:
rawProductLicense- the productKey and license string that plan to be validated.licenseDetail- the license detail of theRawProductLicense.getLicense()licenseValidationResult- the licenseDetail's validation result
-
-
Method Details
-
getLicenseDetail
- Specified by:
getLicenseDetailin interfaceLicenseValidationInformation- Returns:
- the
Optionalof the license detail.
-
getLicenseValidationResult
public com.atlassian.sal.api.validate.LicenseValidationResult getLicenseValidationResult()- Specified by:
getLicenseValidationResultin interfaceLicenseValidationInformation- Returns:
- the license validation result
-
isDeleteLicense
public boolean isDeleteLicense()- Specified by:
isDeleteLicensein interfaceLicenseValidationInformation- Returns:
- true if plan to removed
LicenseValidationInformation.getLicenseDetail()out from the product, false otherwise.
-
getApplicationKey
- Specified by:
getApplicationKeyin interfaceLicenseValidationInformation- Returns:
- the valid application key that the license is applied to
-
isProductKeyValid
public boolean isProductKeyValid()- Specified by:
isProductKeyValidin interfaceLicenseValidationInformation- Returns:
- true if the value of
LicenseValidationInformation.getApplicationKey()is valid, false otherwise.
-
isLicenseDetailsValid
public boolean isLicenseDetailsValid()- Specified by:
isLicenseDetailsValidin interfaceLicenseValidationInformation- Returns:
- true if the
LicenseValidationInformation.getLicenseDetail()is valid, false otherwise.
-
isLicensePairWithCorrectProductKey
public boolean isLicensePairWithCorrectProductKey()- Specified by:
isLicensePairWithCorrectProductKeyin interfaceLicenseValidationInformation- Returns:
- true if
LicenseValidationInformation.getLicenseDetail()can apply toLicenseValidationInformation.getApplicationKey(), false otherwise.
-
needMoreValidation
public boolean needMoreValidation()- Specified by:
needMoreValidationin interfaceLicenseValidationInformation- Returns:
- true if the
LicenseValidationInformation.getLicenseValidationResult()is valid, false when theLicenseValidationInformation.getLicenseDetail()has failed at least one validation orLicenseValidationInformation.isDeleteLicense()is true.
-
with
public LicenseValidationInfo with(@Nonnull com.atlassian.sal.api.validate.LicenseValidationResult licenseValidationResult) - Specified by:
within interfaceLicenseValidationInformation- Returns:
- a defensive copy of this LicenseValidationInformation with a giving
LicenseValidationResult.
-
withError
public LicenseValidationInfo withError(@Nonnull com.atlassian.sal.api.validate.LicenseErrorCode licenseErrorCode, @Nonnull String errorMessage) - Specified by:
withErrorin interfaceLicenseValidationInformation- Parameters:
licenseErrorCode- the validation error codeerrorMessage- the error message- Returns:
- a defensive copy of this LicenseValidationInformation with error validation result
-
withWarning
public LicenseValidationInfo withWarning(@Nonnull com.atlassian.sal.api.validate.LicenseWarningCode licenseWarningCode, @Nonnull String warningMessage) - Specified by:
withWarningin interfaceLicenseValidationInformation- Parameters:
licenseWarningCode- the validation warning codewarningMessage- the warning message- Returns:
- a defensive copy of this LicenseValidationInformatio with warning validation result
-
withWarnings
public LicenseValidationInfo withWarnings(@Nonnull Set<com.atlassian.sal.api.validate.LicenseValidationWarning> warnings) - Specified by:
withWarningsin interfaceLicenseValidationInformation- Parameters:
warnings- the list of warning validation results- Returns:
- a defensive copy of this LicenseValidationInformatio with warning validation result
-