Package com.atlassian.bamboo.build
Class BuildNumberGeneratorServiceImpl
java.lang.Object
com.atlassian.bamboo.build.BuildNumberGeneratorServiceImpl
- All Implemented Interfaces:
BuildNumberGeneratorService
-
Constructor Summary
ConstructorDescriptionBuildNumberGeneratorServiceImpl
(BuildNumberGeneratorDao buildNumberGeneratorDao, AuditLogService auditLogService) -
Method Summary
Modifier and TypeMethodDescriptionint
generateBuildNumber
(@NotNull PlanIdentifier planIdentifier) Returns a unique(consecutive) build number for a plan with the given key.int
getNextBuildNumber
(@NotNull PlanIdentifier planIdentifier) Returns next build number for a plan with the given key without bumping it.void
initBuildNumbers
(@NotNull PlanIdentifier planIdentifier) Initialise build numbers for a plan.void
initBuildNumberWithinTransaction
(@NotNull PlanIdentifier planIdentifier) boolean
setBuildNumber
(@NotNull PlanIdentifier planIdentifier, int newBuildNumber) Sets new build number for a plan with the given key.
-
Constructor Details
-
BuildNumberGeneratorServiceImpl
public BuildNumberGeneratorServiceImpl(BuildNumberGeneratorDao buildNumberGeneratorDao, AuditLogService auditLogService)
-
-
Method Details
-
generateBuildNumber
Description copied from interface:BuildNumberGeneratorService
Returns a unique(consecutive) build number for a plan with the given key.- Specified by:
generateBuildNumber
in interfaceBuildNumberGeneratorService
- Parameters:
planIdentifier
- Identifier of a plan- Returns:
- generated unique build number
-
initBuildNumbers
Description copied from interface:BuildNumberGeneratorService
Initialise build numbers for a plan.- Specified by:
initBuildNumbers
in interfaceBuildNumberGeneratorService
-
initBuildNumberWithinTransaction
-
setBuildNumber
Description copied from interface:BuildNumberGeneratorService
Sets new build number for a plan with the given key.newBuildNumber
must be greater than the current one.- Specified by:
setBuildNumber
in interfaceBuildNumberGeneratorService
- Parameters:
planIdentifier
- Identifier of a plannewBuildNumber
- must be greater than actual build number- Returns:
- true if newBuildNumber is greater than the old one. Otherwise, false.
-
getNextBuildNumber
Description copied from interface:BuildNumberGeneratorService
Returns next build number for a plan with the given key without bumping it.- Specified by:
getNextBuildNumber
in interfaceBuildNumberGeneratorService
- Parameters:
planIdentifier
- Identifier of a plan- Returns:
- next build number
-