Class PlanConfigImportServiceImpl
java.lang.Object
com.atlassian.bamboo.configuration.external.PlanConfigImportServiceImpl
- All Implemented Interfaces:
PlanConfigImportService
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.atlassian.bamboo.configuration.external.PlanConfigImportService
PlanConfigImportService.ImportResult -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull com.atlassian.bamboo.specs.api.model.plan.PlanPropertiesconvertYamlToPlan(@NotNull String yaml) Converts data from a YAML document to top level plan properties.@NotNull PlanConfigImportService.ImportResultimportPlan(@NotNull com.atlassian.bamboo.specs.api.model.plan.PlanProperties planProperties, @Nullable com.atlassian.user.User userForCreation, @NotNull RssPermissions rssPermissions) Validates exported top level plan properties within Bamboo context (e.g. verifying database integrity), then imports the data into the database.@NotNull PlanConfigImportService.ImportResultimportPlan(@NotNull com.atlassian.bamboo.specs.api.model.plan.PlanProperties planProperties, @Nullable com.atlassian.user.User userForCreation, @NotNull RssPermissions rssPermissions, boolean deferEvents, boolean noChangesInProperties) Validates exported top level plan properties within Bamboo context (e.g. verifying database integrity), then imports the data into the database.@NotNull PlanConfigImportService.ImportResultimportPlanBranch(@NotNull com.atlassian.bamboo.specs.api.model.plan.PlanProperties planProperties, @NotNull VcsBranch vcsBranch, @Nullable com.atlassian.user.User user, @NotNull RssPermissions rssPermissions) Import plan branch using specs.voidsendEventsAndScheduleTriggersForBranchIfRequired(@NotNull PlanConfigImportService.ImportResult importResult, @Nullable com.atlassian.user.User user) Sends events related to branch creation or update and initialises triggers.voidsendEventsAndScheduleTriggersIfRequired(@NotNull PlanConfigImportService.ImportResult importResult) Sends events related to plan creation or update and initialises triggers.@NotNull PlanConfigImportService.ImportResultswitchToLightweightBranch(@NotNull PlanKey planBranchKey) Convert a divergent branch to a lightweight branch.@NotNull PlanConfigImportService.ImportResultupdatePlanBranch(@NotNull com.atlassian.bamboo.specs.api.model.plan.PlanProperties planProperties, @NotNull VcsBranch vcsBranch, @Nullable com.atlassian.user.User user, @NotNull RssPermissions rssPermissions, @NotNull DivergentBranchDataBean branchCreationData, boolean deferEvents, boolean noChangesInProperties) Update plan branch using specs.voidvalidatePlanBranchProperties(@NotNull com.atlassian.bamboo.specs.api.model.plan.PlanProperties planProperties, @NotNull RssPermissions rssPermissions, @NotNull VcsBranch vcsBranch) This method performs validation of YAML types and of the properties without Bamboo context (e.g. no database integrity is verified).voidvalidatePlanProperties(@NotNull com.atlassian.bamboo.specs.api.model.plan.PlanProperties planProperties, @NotNull RssPermissions rssPermissions) This method performs validation of YAML types and of the properties without Bamboo context (e.g. no database integrity is verified).
-
Constructor Details
-
PlanConfigImportServiceImpl
public PlanConfigImportServiceImpl()
-
-
Method Details
-
convertYamlToPlan
@NotNull public @NotNull com.atlassian.bamboo.specs.api.model.plan.PlanProperties convertYamlToPlan(@NotNull @NotNull String yaml) throws com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException, YamlValidationException Description copied from interface:PlanConfigImportServiceConverts data from a YAML document to top level plan properties.- Specified by:
convertYamlToPlanin interfacePlanConfigImportService- Parameters:
yaml- YAML String containing definition of top level plan- Returns:
- top level plan properties
- Throws:
YamlValidationException- if the format of the YAML file is invalidcom.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException
-
validatePlanProperties
public void validatePlanProperties(@NotNull @NotNull com.atlassian.bamboo.specs.api.model.plan.PlanProperties planProperties, @NotNull @NotNull RssPermissions rssPermissions) throws com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException, RssPermissionException Description copied from interface:PlanConfigImportServiceThis method performs validation of YAML types and of the properties without Bamboo context (e.g. no database integrity is verified).- Specified by:
validatePlanPropertiesin interfacePlanConfigImportService- Parameters:
planProperties- top level plan propertiesrssPermissions- projects which can allowed for modification- Throws:
com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException- if the imported properties were not validRssPermissionException- if RSS is missing access to projects/repositories
-
validatePlanBranchProperties
public void validatePlanBranchProperties(@NotNull @NotNull com.atlassian.bamboo.specs.api.model.plan.PlanProperties planProperties, @NotNull @NotNull RssPermissions rssPermissions, @NotNull @NotNull VcsBranch vcsBranch) throws com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException, RssPermissionException Description copied from interface:PlanConfigImportServiceThis method performs validation of YAML types and of the properties without Bamboo context (e.g. no database integrity is verified).- Specified by:
validatePlanBranchPropertiesin interfacePlanConfigImportService- Parameters:
planProperties- plan branch propertiesrssPermissions- projects which can allowed for modificationvcsBranch- imported vcs branch- Throws:
com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException- if the imported properties were not validRssPermissionException- if RSS is missing access to projects/repositories
-
importPlan
@NotNull public @NotNull PlanConfigImportService.ImportResult importPlan(@NotNull @NotNull com.atlassian.bamboo.specs.api.model.plan.PlanProperties planProperties, @Nullable @Nullable com.atlassian.user.User userForCreation, @NotNull @NotNull RssPermissions rssPermissions) Description copied from interface:PlanConfigImportServiceValidates exported top level plan properties within Bamboo context (e.g. verifying database integrity), then imports the data into the database.- Specified by:
importPlanin interfacePlanConfigImportService- Parameters:
planProperties- top level plan properties to importuserForCreation- user invoking the importrssPermissions- projects which can allowed for modification; since 6.2- Returns:
- saved top level plan entity and flag indicating if the plan is new
-
importPlan
@NotNull public @NotNull PlanConfigImportService.ImportResult importPlan(@NotNull @NotNull com.atlassian.bamboo.specs.api.model.plan.PlanProperties planProperties, @Nullable @Nullable com.atlassian.user.User userForCreation, @NotNull @NotNull RssPermissions rssPermissions, boolean deferEvents, boolean noChangesInProperties) throws com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException, RssPermissionException Description copied from interface:PlanConfigImportServiceValidates exported top level plan properties within Bamboo context (e.g. verifying database integrity), then imports the data into the database.- Specified by:
importPlanin interfacePlanConfigImportService- Parameters:
planProperties- top level plan properties to importuserForCreation- user invoking the importrssPermissions- projects which can allowed for modification; since 6.2deferEvents- when set to true, the import routine will not send creation events nor initialise plan triggers- Returns:
- saved top level plan entity and flag indicating if the plan is new
- Throws:
com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException- if data validation failsRssPermissionException- if rss doesn't have access to dependant project
-
importPlanBranch
@NotNull public @NotNull PlanConfigImportService.ImportResult importPlanBranch(@NotNull @NotNull com.atlassian.bamboo.specs.api.model.plan.PlanProperties planProperties, @NotNull @NotNull VcsBranch vcsBranch, @Nullable @Nullable com.atlassian.user.User user, @NotNull @NotNull RssPermissions rssPermissions) Description copied from interface:PlanConfigImportServiceImport plan branch using specs.- Specified by:
importPlanBranchin interfacePlanConfigImportService
-
updatePlanBranch
@NotNull public @NotNull PlanConfigImportService.ImportResult updatePlanBranch(@NotNull @NotNull com.atlassian.bamboo.specs.api.model.plan.PlanProperties planProperties, @NotNull @NotNull VcsBranch vcsBranch, @Nullable @Nullable com.atlassian.user.User user, @NotNull @NotNull RssPermissions rssPermissions, @NotNull @NotNull DivergentBranchDataBean branchCreationData, boolean deferEvents, boolean noChangesInProperties) Description copied from interface:PlanConfigImportServiceUpdate plan branch using specs. It is expected that plan branch already exists. (fails if it doesn't)- Specified by:
updatePlanBranchin interfacePlanConfigImportService
-
sendEventsAndScheduleTriggersIfRequired
public void sendEventsAndScheduleTriggersIfRequired(@NotNull @NotNull PlanConfigImportService.ImportResult importResult) Description copied from interface:PlanConfigImportServiceSends events related to plan creation or update and initialises triggers.- Specified by:
sendEventsAndScheduleTriggersIfRequiredin interfacePlanConfigImportService- Parameters:
importResult-
-
sendEventsAndScheduleTriggersForBranchIfRequired
public void sendEventsAndScheduleTriggersForBranchIfRequired(@NotNull @NotNull PlanConfigImportService.ImportResult importResult, @Nullable @Nullable com.atlassian.user.User user) Description copied from interface:PlanConfigImportServiceSends events related to branch creation or update and initialises triggers.- Specified by:
sendEventsAndScheduleTriggersForBranchIfRequiredin interfacePlanConfigImportService
-
switchToLightweightBranch
@NotNull public @NotNull PlanConfigImportService.ImportResult switchToLightweightBranch(@NotNull @NotNull PlanKey planBranchKey) Description copied from interface:PlanConfigImportServiceConvert a divergent branch to a lightweight branch.- Specified by:
switchToLightweightBranchin interfacePlanConfigImportService- Parameters:
planBranchKey-
-