Package com.atlassian.bamboo.ww2.beans
Class DecoratedPlan
- java.lang.Object
-
- com.atlassian.bamboo.ww2.beans.DecoratedPlan
-
- All Implemented Interfaces:
BambooIdProvider
,PlanIdentifier
,PlanKeyProvider
,DescriptionProvider
,NameProvider
,DecoratedNavObject
- Direct Known Subclasses:
DecoratedPlan.DecoratedBranch
@Immutable public abstract class DecoratedPlan extends Object implements DecoratedNavObject, PlanIdentifier
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DecoratedPlan.DecoratedBranch
Branches are top level branch plans.static class
DecoratedPlan.DecoratedPlanBranchGist
-
Field Summary
-
Fields inherited from interface com.atlassian.bamboo.plan.PlanIdentifier
NAME_DELIMITER
-
Fields inherited from interface com.atlassian.bamboo.plan.PlanKeyProvider
getPlanKey
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description com.google.common.collect.ImmutableList<DecoratedPlan.DecoratedPlanBranchGist>
getBranches()
abstract @Nullable String
getBranchName()
@Nullable String
getBranchPlanKey()
Return the the branch plan key.@NotNull String
getBuildKey()
This objects specific portion of the key.@NotNull String
getBuildName()
@NotNull Optional<Long>
getDatabaseId()
String
getDescription()
@NotNull String
getDisplayName()
long
getId()
Returns database id of the plan.@NotNull String
getKey()
com.google.common.collect.ImmutableList<String>
getLabelNames()
@Nullable String
getLinkedJiraIssue()
abstract @Nullable DecoratedPlan
getMaster()
The master plan iff the plan is a branched plan and it has a master.@NotNull String
getMasterChainKey()
Return the main chain key for this plan.long
getMasterId()
@NotNull Optional<Long>
getMasterIdIfExists()
@Nullable String
getMasterJobKey()
Return the job key of this plan.@NotNull String
getName()
Returns the full name for the build in the form of "project name - build name" e.g.@NotNull com.google.common.collect.ImmutableList<? extends DecoratedNavGroupObject>
getNavGroups()
abstract @Nullable DecoratedPlan
getParent()
abstract @Nullable PlanBranchWorkflow
getPlanBranchWorkflow()
@NotNull PlanKey
getPlanKey()
@NotNull PlanType
getPlanType()
@NotNull ProjectIdentifier
getProject()
Returns the parentProject
abstract List<DeploymentProject>
getRelatedDeploymentProjects()
com.google.common.collect.ImmutableList<DecoratedStage>
getStages()
abstract @Nullable DecoratedStage
getStageWithName(@NotNull String stageName)
Retrieve the named stage.@Nullable DecoratedNavObjectStatus
getStatus()
@NotNull String
getType()
boolean
isRemoteJiraLinkRequired()
boolean
isResult()
boolean
isSuspendedFromBuilding()
Checks if the build has been enabled / disabled.@Nullable String
replaceKey(String url, DecoratedNavObject originalObject)
Given an existing url (may be directly from the originalObject or may be with a static ${planKey} reference) generate the new url for this objectvoid
setLabels(com.google.common.collect.ImmutableList<String> labels)
-
-
-
Method Detail
-
getKey
@NotNull public @NotNull String getKey()
- Specified by:
getKey
in interfaceDecoratedNavObject
- Returns:
- full key of the object
-
getBuildKey
@NotNull public @NotNull String getBuildKey()
Description copied from interface:PlanIdentifier
This objects specific portion of the key. You probably want to usePlanIdentifier.getPlanKey()
.- Specified by:
getBuildKey
in interfacePlanIdentifier
- Returns:
- This objects specific portion of the key
-
getDisplayName
@NotNull public @NotNull String getDisplayName()
- Specified by:
getDisplayName
in interfaceDecoratedNavObject
- Returns:
- display name of this object
-
getNavGroups
@NotNull public @NotNull com.google.common.collect.ImmutableList<? extends DecoratedNavGroupObject> getNavGroups()
- Specified by:
getNavGroups
in interfaceDecoratedNavObject
- Returns:
- any children groups of this object
-
getParent
@Nullable public abstract @Nullable DecoratedPlan getParent()
- Specified by:
getParent
in interfaceDecoratedNavObject
- Returns:
- the parent of this object (does not take into account groups)
-
getPlanType
@NotNull public @NotNull PlanType getPlanType()
- Specified by:
getPlanType
in interfaceDecoratedNavObject
- Specified by:
getPlanType
in interfacePlanIdentifier
- Returns:
- plantype associated with this object.
-
getStatus
@Nullable public @Nullable DecoratedNavObjectStatus getStatus()
- Specified by:
getStatus
in interfaceDecoratedNavObject
- Returns:
- provide the status of this object if applicable
-
replaceKey
@Nullable public @Nullable String replaceKey(String url, DecoratedNavObject originalObject)
Description copied from interface:DecoratedNavObject
Given an existing url (may be directly from the originalObject or may be with a static ${planKey} reference) generate the new url for this object- Specified by:
replaceKey
in interfaceDecoratedNavObject
- Parameters:
url
- - to manipulateoriginalObject
- - the object the original url may have belonged to- Returns:
- the new url referencing this object
-
getMaster
@Nullable public abstract @Nullable DecoratedPlan getMaster()
Description copied from interface:DecoratedNavObject
The master plan iff the plan is a branched plan and it has a master.- Specified by:
getMaster
in interfaceDecoratedNavObject
- Returns:
-
getId
public long getId()
Description copied from interface:PlanIdentifier
Returns database id of the plan. Use ofPlanIdentifier.getDatabaseId()
should be preferred.- Specified by:
getId
in interfaceBambooIdProvider
- Specified by:
getId
in interfacePlanIdentifier
-
getDatabaseId
@NotNull public @NotNull Optional<Long> getDatabaseId()
- Specified by:
getDatabaseId
in interfacePlanIdentifier
- Returns:
- database id of the plan or empty if this plan is not a DB object.
-
getPlanKey
@NotNull public @NotNull PlanKey getPlanKey()
Description copied from interface:PlanIdentifier
- Specified by:
getPlanKey
in interfacePlanIdentifier
- Specified by:
getPlanKey
in interfacePlanKeyProvider
- Returns:
- planKey
-
getName
@NotNull public @NotNull String getName()
Description copied from interface:PlanIdentifier
Returns the full name for the build in the form of "project name - build name" e.g. "Confluence - HEAD"- Specified by:
getName
in interfaceDescriptionProvider
- Specified by:
getName
in interfaceNameProvider
- Specified by:
getName
in interfacePlanIdentifier
- Returns:
- String
-
getProject
@NotNull public @NotNull ProjectIdentifier getProject()
Description copied from interface:PlanIdentifier
Returns the parentProject
- Specified by:
getProject
in interfacePlanIdentifier
- Returns:
Project
. Never null
-
getBuildName
@NotNull public @NotNull String getBuildName()
- Specified by:
getBuildName
in interfacePlanIdentifier
- Returns:
- The plan specific portion of the name (without the project and/or parent's names). You probably want to use
PlanIdentifier.getName()
-
getDescription
public String getDescription()
- Specified by:
getDescription
in interfaceDescriptionProvider
-
getMasterId
public long getMasterId()
- Specified by:
getMasterId
in interfacePlanIdentifier
- Returns:
- database id of master of this Plan or -1 if none.
-
getMasterIdIfExists
@NotNull public @NotNull Optional<Long> getMasterIdIfExists()
- Specified by:
getMasterIdIfExists
in interfacePlanIdentifier
- Returns:
- database id of master of this Plan or empty if none.
-
getLabelNames
public com.google.common.collect.ImmutableList<String> getLabelNames()
-
getType
@NotNull public @NotNull String getType()
- Specified by:
getType
in interfaceDecoratedNavObject
- Returns:
- plantype associated with this object.
-
isResult
public boolean isResult()
- Specified by:
isResult
in interfaceDecoratedNavObject
- Returns:
- true if the nav object represents a result otherwise false
-
isSuspendedFromBuilding
public boolean isSuspendedFromBuilding()
Description copied from interface:PlanIdentifier
Checks if the build has been enabled / disabled.- Specified by:
isSuspendedFromBuilding
in interfacePlanIdentifier
- Returns:
- true if plan is disabled
-
getStages
public com.google.common.collect.ImmutableList<DecoratedStage> getStages()
-
getBranches
public com.google.common.collect.ImmutableList<DecoratedPlan.DecoratedPlanBranchGist> getBranches()
-
setLabels
public void setLabels(com.google.common.collect.ImmutableList<String> labels)
-
getBranchName
@Nullable public abstract @Nullable String getBranchName()
-
getPlanBranchWorkflow
@Nullable public abstract @Nullable PlanBranchWorkflow getPlanBranchWorkflow()
-
getLinkedJiraIssue
@Nullable public @Nullable String getLinkedJiraIssue()
-
isRemoteJiraLinkRequired
public boolean isRemoteJiraLinkRequired()
-
getMasterChainKey
@NotNull public @NotNull String getMasterChainKey()
Return the main chain key for this plan. In case of a Chain Key (PROJ-PLAN) this key will be returned. In case of a Job Key (PROJ-PLAN-JOB), this will return a main chain key (PROJ-PLAN). In case of a Branch Key (PROJ-PLAN10), this will return the key of the main chain (PROJ-PLAN).- Returns:
- chainKey
-
getMasterJobKey
@Nullable public @Nullable String getMasterJobKey()
Return the job key of this plan. In case this class represents a chain key or a branch key, this will return null.- Returns:
- the job key or null
-
getBranchPlanKey
@Nullable public @Nullable String getBranchPlanKey()
Return the the branch plan key. If this does not represent a branch plan, we return null.- Returns:
- the branch plan key or null
-
getRelatedDeploymentProjects
public abstract List<DeploymentProject> getRelatedDeploymentProjects()
-
getStageWithName
@Nullable public abstract @Nullable DecoratedStage getStageWithName(@NotNull @NotNull String stageName)
Retrieve the named stage. If the stage is not found it indicates that the stage has been deleted or renamed but the result remains.
-
-