Package com.atlassian.bamboo.build
Class BuildNumberGeneratorServiceImpl
- java.lang.Object
-
- com.atlassian.bamboo.build.BuildNumberGeneratorServiceImpl
-
- All Implemented Interfaces:
BuildNumberGeneratorService
public class BuildNumberGeneratorServiceImpl extends Object implements BuildNumberGeneratorService
-
-
Constructor Summary
Constructors Constructor Description BuildNumberGeneratorServiceImpl(BuildNumberGeneratorDao buildNumberGeneratorDao, AuditLogService auditLogService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
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.boolean
setBuildNumber(@NotNull PlanIdentifier planIdentifier, int newBuildNumber)
Sets new build number for a plan with the given key.
-
-
-
Constructor Detail
-
BuildNumberGeneratorServiceImpl
public BuildNumberGeneratorServiceImpl(BuildNumberGeneratorDao buildNumberGeneratorDao, AuditLogService auditLogService)
-
-
Method Detail
-
generateBuildNumber
public int generateBuildNumber(@NotNull @NotNull PlanIdentifier planIdentifier)
Description copied from interface:BuildNumberGeneratorService
Returns a unique(consecutive) build number for a plan with the given key.- Specified by:
generateBuildNumber
in interfaceBuildNumberGeneratorService
- Returns:
-
initBuildNumbers
public void initBuildNumbers(@NotNull @NotNull PlanIdentifier planIdentifier)
Description copied from interface:BuildNumberGeneratorService
Initialise build numbers for a plan.- Specified by:
initBuildNumbers
in interfaceBuildNumberGeneratorService
-
setBuildNumber
public boolean setBuildNumber(@NotNull @NotNull PlanIdentifier planIdentifier, int newBuildNumber)
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
public int getNextBuildNumber(@NotNull @NotNull PlanIdentifier planIdentifier)
Description copied from interface:BuildNumberGeneratorService
Returns next build number for a plan with the given key without bumping it.- Specified by:
getNextBuildNumber
in interfaceBuildNumberGeneratorService
- Returns:
-
-