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 void
addLicense(LicenseKey newKey)
boolean
contains(LicenseKey key)
LicenseKey
findTimeBasedLicenseKey()
Collection<LicenseKey>
getActiveLicenses()
Collection<LicenseKey>
getAllLicenses()
Collection<LicenseKey>
getInactiveLicenses()
JwtLicenseKey
getJwtLicense()
int
getLicensedAgentCount()
int
getLicensedBuildTypesCount()
Date
getLicenseExpirationDate()
Returns time based license expiration dateint
getNumberOfPredefinedAgents()
Returns number of agents which can be authorized on the server for free (currently it is either 3 or 0 if number is unlimited).int
getNumberOfPredefinedBuildTypes()
Returns number of predefined build configurations which can be created on the server (currently it is either 20 or 0 if number is unlimited).Date
getReleaseDate()
boolean
hasEnterpriseLicense()
boolean
hasJwtLicense()
boolean
isEAPTrialMode()
Returns true if server is working in trial mode.boolean
isOpenSourceMode()
Returns true if server is working in open source evaluation mode.boolean
isPerUsageLicenseActive()
boolean
isPerUsageMode()
boolean
isTrialMode()
Returns true if server is working in trial mode.boolean
isUnlimitedAgents()
Returns true if server is working in the unlimited agents mode.boolean
isUnlimitedBuildTypes()
void
removeJwtLicense()
void
removeLicenses(Collection<LicenseKey> licenseKeys)
void
setJwtLicense(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:
hasEnterpriseLicense
in interfaceLicenseList
- Returns:
- true if there is an active enterprise license.
-
hasJwtLicense
public boolean hasJwtLicense()
- Specified by:
hasJwtLicense
in interfaceLicenseList
- Returns:
- true if there is a JWT license (either active or inactive)
-
getJwtLicense
@Nullable public JwtLicenseKey getJwtLicense()
- Specified by:
getJwtLicense
in interfaceLicenseList
- Returns:
- JWT license if it's present (can be inactive), null otherwise
-
getAllLicenses
@NotNull public Collection<LicenseKey> getAllLicenses()
- Specified by:
getAllLicenses
in interfaceLicenseList
- Returns:
- all entered license keys (active and inactive).
-
getActiveLicenses
@NotNull public Collection<LicenseKey> getActiveLicenses()
- Specified by:
getActiveLicenses
in interfaceLicenseList
- Returns:
- active license keys only
-
getInactiveLicenses
@NotNull public Collection<LicenseKey> getInactiveLicenses()
- Specified by:
getInactiveLicenses
in 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:
getLicensedAgentCount
in interfaceLicenseList
- Returns:
- computes number of agents from the entered license keys.
-
getLicensedBuildTypesCount
public int getLicensedBuildTypesCount()
- Specified by:
getLicensedBuildTypesCount
in 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:
findTimeBasedLicenseKey
in interfaceLicenseList
-
isTrialMode
public boolean isTrialMode()
Description copied from interface:LicenseList
Returns true if server is working in trial mode.- Specified by:
isTrialMode
in interfaceLicenseList
- Returns:
-
isEAPTrialMode
public boolean isEAPTrialMode()
Description copied from interface:LicenseList
Returns true if server is working in trial mode.- Specified by:
isEAPTrialMode
in interfaceLicenseList
- Returns:
-
isOpenSourceMode
public boolean isOpenSourceMode()
Description copied from interface:LicenseList
Returns true if server is working in open source evaluation mode.- Specified by:
isOpenSourceMode
in interfaceLicenseList
- Returns:
-
isUnlimitedAgents
public boolean isUnlimitedAgents()
Description copied from interface:LicenseList
Returns true if server is working in the unlimited agents mode.- Specified by:
isUnlimitedAgents
in interfaceLicenseList
- Returns:
-
isPerUsageMode
public boolean isPerUsageMode()
- Specified by:
isPerUsageMode
in interfaceLicenseList
- Returns:
- true if server is working in PerUsage enterprise mode. isPerUsageLicenseActive() should be checked as well.
-
isPerUsageLicenseActive
public boolean isPerUsageLicenseActive()
- Specified by:
isPerUsageLicenseActive
in 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:
isUnlimitedBuildTypes
in interfaceLicenseList
- Returns:
- true if number of build types is unlimited
-
getNumberOfPredefinedAgents
public int getNumberOfPredefinedAgents()
Description copied from interface:LicenseList
Returns 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:
getNumberOfPredefinedAgents
in interfaceLicenseList
- Returns:
- number of predefined agents
-
getNumberOfPredefinedBuildTypes
public int getNumberOfPredefinedBuildTypes()
Description copied from interface:LicenseList
Returns 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:
getNumberOfPredefinedBuildTypes
in interfaceLicenseList
- Returns:
- number of predefined agents
-
getLicenseExpirationDate
@Nullable public Date getLicenseExpirationDate()
Description copied from interface:LicenseList
Returns time based license expiration date- Specified by:
getLicenseExpirationDate
in interfaceLicenseList
- Returns:
-
getReleaseDate
@NotNull public Date getReleaseDate()
- Specified by:
getReleaseDate
in interfaceLicenseList
- Returns:
- release date of the server
-
-