public class LicenseValidationInfo extends Object implements LicenseValidationInformation
ApplicationKey
of the currently installed license.Constructor and Description |
---|
LicenseValidationInfo(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) |
Modifier and Type | Method and Description |
---|---|
Optional<com.atlassian.application.api.ApplicationKey> |
getApplicationKey() |
Optional<LicenseDetails> |
getLicenseDetail() |
com.atlassian.sal.api.validate.LicenseValidationResult |
getLicenseValidationResult() |
boolean |
isDeleteLicense() |
boolean |
isLicenseDetailsValid() |
boolean |
isLicensePairWithCorrectProductKey() |
boolean |
isProductKeyValid() |
boolean |
needMoreValidation() |
LicenseValidationInfo |
with(com.atlassian.sal.api.validate.LicenseValidationResult licenseValidationResult) |
LicenseValidationInfo |
withError(com.atlassian.sal.api.validate.LicenseErrorCode licenseErrorCode,
String errorMessage) |
LicenseValidationInfo |
withWarning(com.atlassian.sal.api.validate.LicenseWarningCode licenseWarningCode,
String warningMessage) |
LicenseValidationInfo |
withWarnings(Set<com.atlassian.sal.api.validate.LicenseValidationWarning> warnings) |
public LicenseValidationInfo(@Nonnull com.atlassian.sal.api.license.RawProductLicense rawProductLicense, @Nonnull Optional<LicenseDetails> licenseDetail)
rawProductLicense
- the productKey and license string that plan to be validated.licenseDetail
- the license detail of the RawProductLicense.getLicense()
public LicenseValidationInfo(@Nonnull com.atlassian.sal.api.license.RawProductLicense rawProductLicense, @Nonnull Optional<LicenseDetails> licenseDetail, @Nonnull com.atlassian.sal.api.validate.LicenseValidationResult licenseValidationResult)
rawProductLicense
- the productKey and license string that plan to be validated.licenseDetail
- the license detail of the RawProductLicense.getLicense()
licenseValidationResult
- the licenseDetail's validation resultpublic Optional<LicenseDetails> getLicenseDetail()
getLicenseDetail
in interface LicenseValidationInformation
Optional
of the license detail.public com.atlassian.sal.api.validate.LicenseValidationResult getLicenseValidationResult()
getLicenseValidationResult
in interface LicenseValidationInformation
public boolean isDeleteLicense()
isDeleteLicense
in interface LicenseValidationInformation
LicenseValidationInformation.getLicenseDetail()
out from the product, false otherwise.public Optional<com.atlassian.application.api.ApplicationKey> getApplicationKey()
getApplicationKey
in interface LicenseValidationInformation
public boolean isProductKeyValid()
isProductKeyValid
in interface LicenseValidationInformation
LicenseValidationInformation.getApplicationKey()
is valid, false otherwise.public boolean isLicenseDetailsValid()
isLicenseDetailsValid
in interface LicenseValidationInformation
LicenseValidationInformation.getLicenseDetail()
is valid, false otherwise.public boolean isLicensePairWithCorrectProductKey()
isLicensePairWithCorrectProductKey
in interface LicenseValidationInformation
LicenseValidationInformation.getLicenseDetail()
can apply to LicenseValidationInformation.getApplicationKey()
, false otherwise.public boolean needMoreValidation()
needMoreValidation
in interface LicenseValidationInformation
LicenseValidationInformation.getLicenseValidationResult()
is valid,
false when the LicenseValidationInformation.getLicenseDetail()
has failed at least one validation
or LicenseValidationInformation.isDeleteLicense()
is true.public LicenseValidationInfo with(@Nonnull com.atlassian.sal.api.validate.LicenseValidationResult licenseValidationResult)
with
in interface LicenseValidationInformation
LicenseValidationResult
.public LicenseValidationInfo withError(@Nonnull com.atlassian.sal.api.validate.LicenseErrorCode licenseErrorCode, @Nonnull String errorMessage)
withError
in interface LicenseValidationInformation
licenseErrorCode
- the validation error codeerrorMessage
- the error messagepublic LicenseValidationInfo withWarning(@Nonnull com.atlassian.sal.api.validate.LicenseWarningCode licenseWarningCode, @Nonnull String warningMessage)
withWarning
in interface LicenseValidationInformation
licenseWarningCode
- the validation warning codewarningMessage
- the warning messagepublic LicenseValidationInfo withWarnings(@Nonnull Set<com.atlassian.sal.api.validate.LicenseValidationWarning> warnings)
withWarnings
in interface LicenseValidationInformation
warnings
- the list of warning validation resultsCopyright © 2002-2021 Atlassian. All Rights Reserved.