Package jetbrains.buildServer.license
Class AbstractLicenseKey<T extends LicenseKeyData>
- java.lang.Object
-
- jetbrains.buildServer.license.AbstractLicenseKey<T>
-
- All Implemented Interfaces:
LicenseKey
- Direct Known Subclasses:
JwtLicenseKey,LicenseKeyImpl
public abstract class AbstractLicenseKey<T extends LicenseKeyData> extends Object implements LicenseKey
-
-
Field Summary
Fields Modifier and Type Field Description protected StringmyKeyprotected LicenseInfomyLicenseInfoprotected booleanmyObsoleteprotected StringmyValidateError
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractLicenseKey(String key, Function<String,? extends LicenseInfo> licenseDecoder)protectedAbstractLicenseKey(LicenseInfo licenseInfo, String key)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)StringgetKey()abstract TgetLicenseKeyData()StringgetUniquePartOfKey()StringgetValidateError()inthashCode()booleanhasMaintenancePeriodValidFor(Date releaseDate)booleanisEAPLicenseKey()booleanisEnterpriseLicense()booleanisJwtProfessionalLicense()booleanisLicenseExpiringIn(int days)booleanisMaintenanceExpiringIn(int days)booleanisMultipleTrialKey()booleanisObsolete()booleanisOpenSourceLicenseKey()booleanisPerUsageLicense()booleanisTrialLicenseKey()booleanisUnlimitedAgentsLicense()booleanisValid()voidsetObsolete(boolean obsolete)voidsetValidateError(String validateError)StringtoString()
-
-
-
Field Detail
-
myKey
protected final String myKey
-
myLicenseInfo
@Nullable protected final LicenseInfo myLicenseInfo
-
myValidateError
protected String myValidateError
-
myObsolete
protected boolean myObsolete
-
-
Constructor Detail
-
AbstractLicenseKey
@TestOnly protected AbstractLicenseKey(@NotNull LicenseInfo licenseInfo, @NotNull String key)
-
AbstractLicenseKey
protected AbstractLicenseKey(@NotNull String key, Function<String,? extends LicenseInfo> licenseDecoder)
-
-
Method Detail
-
isMaintenanceExpiringIn
public boolean isMaintenanceExpiringIn(int days)
- Specified by:
isMaintenanceExpiringInin interfaceLicenseKey
-
isLicenseExpiringIn
public boolean isLicenseExpiringIn(int days)
- Specified by:
isLicenseExpiringInin interfaceLicenseKey
-
getKey
public String getKey()
- Specified by:
getKeyin interfaceLicenseKey- Returns:
- license key itself
-
getUniquePartOfKey
public String getUniquePartOfKey()
- Specified by:
getUniquePartOfKeyin interfaceLicenseKey
-
setValidateError
public void setValidateError(String validateError)
-
isValid
public boolean isValid()
- Specified by:
isValidin interfaceLicenseKey- Returns:
- true if key is valid
-
getValidateError
public String getValidateError()
- Specified by:
getValidateErrorin interfaceLicenseKey- Returns:
- validation error if it exists
-
isTrialLicenseKey
public boolean isTrialLicenseKey()
- Specified by:
isTrialLicenseKeyin interfaceLicenseKey
-
isMultipleTrialKey
public boolean isMultipleTrialKey()
- Specified by:
isMultipleTrialKeyin interfaceLicenseKey- Returns:
- true if number of performed trials should not be checked for this key
-
isEAPLicenseKey
public boolean isEAPLicenseKey()
- Specified by:
isEAPLicenseKeyin interfaceLicenseKey
-
hasMaintenancePeriodValidFor
public boolean hasMaintenancePeriodValidFor(@NotNull Date releaseDate)- Specified by:
hasMaintenancePeriodValidForin interfaceLicenseKey- Returns:
- true if this key maintenance period covers provided date
-
isEnterpriseLicense
public boolean isEnterpriseLicense()
- Specified by:
isEnterpriseLicensein interfaceLicenseKey
-
isOpenSourceLicenseKey
public boolean isOpenSourceLicenseKey()
- Specified by:
isOpenSourceLicenseKeyin interfaceLicenseKey
-
isUnlimitedAgentsLicense
public boolean isUnlimitedAgentsLicense()
- Specified by:
isUnlimitedAgentsLicensein interfaceLicenseKey
-
isPerUsageLicense
public boolean isPerUsageLicense()
- Specified by:
isPerUsageLicensein interfaceLicenseKey
-
isJwtProfessionalLicense
public boolean isJwtProfessionalLicense()
- Specified by:
isJwtProfessionalLicensein interfaceLicenseKey
-
isObsolete
public boolean isObsolete()
- Specified by:
isObsoletein interfaceLicenseKey- Returns:
- true if current server release date is after the maintenance date written in the key
-
setObsolete
public void setObsolete(boolean obsolete)
-
getLicenseKeyData
public abstract T getLicenseKeyData()
- Specified by:
getLicenseKeyDatain interfaceLicenseKey- Returns:
- license key information, or null if license key was not recognized
-
-