Package jetbrains.buildServer.license
Class ServerLicenseList
- java.lang.Object
-
- jetbrains.buildServer.license.ServerLicenseList
-
- All Implemented Interfaces:
LicenseList
public class ServerLicenseList extends Object implements LicenseList
-
-
Constructor Summary
Constructors Constructor Description ServerLicenseList(ReleaseDateHolder releaseDateHolder, PerUsageLicenseData perUsageLicenseData)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddLicense(LicenseKey newKey)booleancontains(LicenseKey key)LicenseKeyfindTimeBasedLicenseKey()Collection<LicenseKey>getActiveLicenses()Collection<LicenseKey>getAllLicenses()Collection<LicenseKey>getInactiveLicenses()JwtLicenseKeygetJwtLicense()intgetLicensedAgentCount()intgetLicensedBuildTypesCount()DategetLicenseExpirationDate()Returns time based license expiration dateintgetNumberOfPredefinedAgents()Returns number of agents which can be authorized on the server for free (currently it is either 3 or 0 if number is unlimited).intgetNumberOfPredefinedBuildTypes()Returns number of predefined build configurations which can be created on the server (currently it is either 20 or 0 if number is unlimited).DategetReleaseDate()booleanhasEnterpriseLicense()booleanhasJwtLicense()booleanisEAPTrialMode()Returns true if server is working in trial mode.booleanisOpenSourceMode()Returns true if server is working in open source evaluation mode.booleanisPerUsageLicenseActive()booleanisPerUsageMode()booleanisTrialMode()Returns true if server is working in trial mode.booleanisUnlimitedAgents()Returns true if server is working in the unlimited agents mode.booleanisUnlimitedBuildTypes()voidremoveJwtLicense()voidremoveLicenses(Collection<LicenseKey> licenseKeys)voidsetJwtLicense(JwtLicenseKey key)
-
-
-
Constructor Detail
-
ServerLicenseList
public ServerLicenseList(@NotNull ReleaseDateHolder releaseDateHolder, @NotNull PerUsageLicenseData perUsageLicenseData)
-
-
Method Detail
-
addLicense
public void addLicense(@NotNull LicenseKey newKey)
-
setJwtLicense
public void setJwtLicense(@NotNull JwtLicenseKey key)
-
removeJwtLicense
public void removeJwtLicense()
-
removeLicenses
public void removeLicenses(Collection<LicenseKey> licenseKeys)
-
hasEnterpriseLicense
public boolean hasEnterpriseLicense()
- Specified by:
hasEnterpriseLicensein interfaceLicenseList- Returns:
- true if there is an active enterprise license.
-
hasJwtLicense
public boolean hasJwtLicense()
- Specified by:
hasJwtLicensein interfaceLicenseList- Returns:
- true if there is a JWT license (either active or inactive)
-
getJwtLicense
@Nullable public JwtLicenseKey getJwtLicense()
- Specified by:
getJwtLicensein interfaceLicenseList- Returns:
- JWT license if it's present (can be inactive), null otherwise
-
getAllLicenses
@NotNull public Collection<LicenseKey> getAllLicenses()
- Specified by:
getAllLicensesin interfaceLicenseList- Returns:
- all entered license keys (active and inactive).
-
getActiveLicenses
@NotNull public Collection<LicenseKey> getActiveLicenses()
- Specified by:
getActiveLicensesin interfaceLicenseList- Returns:
- active license keys only
-
getInactiveLicenses
@NotNull public Collection<LicenseKey> getInactiveLicenses()
- Specified by:
getInactiveLicensesin interfaceLicenseList- Returns:
- inactive license keys - expired trial keys, keys with expired maintenance comparing to server release date. Note that list can also have non expired trial license if valid enterprise license exists.
-
getLicensedAgentCount
public int getLicensedAgentCount()
- Specified by:
getLicensedAgentCountin interfaceLicenseList- Returns:
- computes number of agents from the entered license keys.
-
getLicensedBuildTypesCount
public int getLicensedBuildTypesCount()
- Specified by:
getLicensedBuildTypesCountin interfaceLicenseList- Returns:
- computes number of build configurations from the entered license keys. This method should only be used if
LicenseList.isUnlimitedBuildTypes()returns false.
-
contains
public boolean contains(LicenseKey key)
-
findTimeBasedLicenseKey
@Nullable public LicenseKey findTimeBasedLicenseKey()
- Specified by:
findTimeBasedLicenseKeyin interfaceLicenseList
-
isTrialMode
public boolean isTrialMode()
Description copied from interface:LicenseListReturns true if server is working in trial mode.- Specified by:
isTrialModein interfaceLicenseList- Returns:
-
isEAPTrialMode
public boolean isEAPTrialMode()
Description copied from interface:LicenseListReturns true if server is working in trial mode.- Specified by:
isEAPTrialModein interfaceLicenseList- Returns:
-
isOpenSourceMode
public boolean isOpenSourceMode()
Description copied from interface:LicenseListReturns true if server is working in open source evaluation mode.- Specified by:
isOpenSourceModein interfaceLicenseList- Returns:
-
isUnlimitedAgents
public boolean isUnlimitedAgents()
Description copied from interface:LicenseListReturns true if server is working in the unlimited agents mode.- Specified by:
isUnlimitedAgentsin interfaceLicenseList- Returns:
-
isPerUsageMode
public boolean isPerUsageMode()
- Specified by:
isPerUsageModein interfaceLicenseList- Returns:
- true if server is working in PerUsage enterprise mode. isPerUsageLicenseActive() should be checked as well.
-
isPerUsageLicenseActive
public boolean isPerUsageLicenseActive()
- Specified by:
isPerUsageLicenseActivein interfaceLicenseList- Returns:
- true if PerUsage enterprise mode is active - usage data was sent to the JetProfile recently or server was just restarted or key was just added.
-
isUnlimitedBuildTypes
public boolean isUnlimitedBuildTypes()
- Specified by:
isUnlimitedBuildTypesin interfaceLicenseList- Returns:
- true if number of build types is unlimited
-
getNumberOfPredefinedAgents
public int getNumberOfPredefinedAgents()
Description copied from interface:LicenseListReturns number of agents which can be authorized on the server for free (currently it is either 3 or 0 if number is unlimited). Returns 0 if number of agents is unlimited.- Specified by:
getNumberOfPredefinedAgentsin interfaceLicenseList- Returns:
- number of predefined agents
-
getNumberOfPredefinedBuildTypes
public int getNumberOfPredefinedBuildTypes()
Description copied from interface:LicenseListReturns number of predefined build configurations which can be created on the server (currently it is either 20 or 0 if number is unlimited).- Specified by:
getNumberOfPredefinedBuildTypesin interfaceLicenseList- Returns:
- number of predefined agents
-
getLicenseExpirationDate
@Nullable public Date getLicenseExpirationDate()
Description copied from interface:LicenseListReturns time based license expiration date- Specified by:
getLicenseExpirationDatein interfaceLicenseList- Returns:
-
getReleaseDate
@NotNull public Date getReleaseDate()
- Specified by:
getReleaseDatein interfaceLicenseList- Returns:
- release date of the server
-
-