com.atlassian.bamboo.plan
Class PlanPermissionSkeleton

java.lang.Object
  extended by com.atlassian.bamboo.plan.PlanPermissionSkeleton
All Implemented Interfaces:
BambooIdProvider, BambooObject, Deletable, Describable, ImmutableDeletable, ImmutablePlan, Plan, PlanIdentifier, DescriptionProvider, NameProvider

public class PlanPermissionSkeleton
extends java.lang.Object
implements Plan


Field Summary
 
Fields inherited from interface com.atlassian.bamboo.plan.cache.ImmutablePlan
MAX_NUMBER_LOG_ENTRIES, MAX_PREVIOUS_BUILD_FOR_AVE, STATUS_CURRENTLY_BUILDING, STATUS_FAIL, STATUS_NO_BUILDS, STATUS_NOT_RUN, STATUS_SUCCESS
 
Constructor Summary
PlanPermissionSkeleton(long id, java.lang.String planKey, java.lang.Class<? extends Plan> planClass, PlanType planType)
           
 
Method Summary
 long getAverageBuildDuration()
          Returns an average duration of the recent builds
 BuildDefinition getBuildDefinition()
          Returns the BuildDefinition that backs this Plan
 BuildDefinitionForBuild getBuildDefinitionXml()
           
 java.lang.String getBuildKey()
          This objects specific portion of the key.
 BuildLogger getBuildLogger()
          Returns the helper object to deal with logging
 java.lang.String getBuildName()
           
 java.lang.String getCurrentStatus()
          Retuns a string key as to what the status is.
 java.lang.String getDescription()
           
 java.util.List<VariableDefinition> getEffectiveVariables()
          Return effective list of VariableDefinitions bind to this Plan.
 int getFirstBuildNumber()
          What the number of the first build we have? It may not be 1 as some may have been removed!
 long getId()
           
 java.lang.String getKey()
          Obtain the plan's unique key (uppercase alphanumeric).
 java.util.List<Labelling> getLabellings()
          Used only for Hibernate mapping purposes.
 java.util.List<java.lang.String> getLabelNames()
          Returns all the names of related labels with a namesapce of :label
 int getLastBuildNumber()
          What was the number of the latest build (may be being built)
 ResultsSummary getLatestResultsSummary()
          Get the latest finished result
 Plan getMaster()
          Return the master plan if one exists.
 java.lang.String getName()
          Returns the full name for the build in the form of "project name - build name" e.g.
 int getNextBuildNumber()
          The next build number represents the number of the next build result that's to be executed
 java.lang.Class<? extends Plan> getPlanClass()
           
 PlanKey getPlanKey()
          Get the PlanKey identifier for this Plan
 PlanType getPlanType()
           
 Project getProject()
          Returns the parent Project
 java.util.List<Labelling> getRelatedLabellings()
          Returns labellings that's application for the plan level
 java.lang.String getType()
          Returns the string representation of the type.
 java.util.List<VariableDefinition> getVariables()
          Return list of VariableDefinitions bind to this Plan
 boolean hasMaster()
           
 boolean hasTests()
          Do any of TaskDefinition being used in the plan implement TaskTestResultsSupport
 boolean isActive()
          Is the plan queued or building?
 boolean isBusy()
          Is the Plan "busy".
 boolean isExecuting()
          Is the build currently being executed?
 boolean isMarkedForDeletion()
          Is the plan set to be deleted in the future
 boolean isSuspendedFromBuilding()
          Checks if the build has been enabled / disabled.
 void setBuildDefinitionXml(BuildDefinitionForBuild buildDefinitionXml)
           
 void setBuildKey(java.lang.String buildKey)
          Define the build's unique key (uppercase alphanumeric)
 void setBuildName(java.lang.String buildName)
           
 void setDescription(java.lang.String description)
           
 void setFirstBuildNumber(int firstBuildNumber)
           
 void setId(long id)
           
 void setKey(java.lang.String fullKey)
           
 void setLabellings(java.util.List<Labelling> labellings)
           
 void setLastBuildNumber(int lastBuildNumber)
           
 void setMarkedForDeletion(boolean markedForDeletion)
           
 void setMaster(Plan master)
          Set which plan is the master of this plan.
 void setName(java.lang.String name)
           
 void setNextBuildNumber(int nextBuildNumber)
           
 void setPlanKey(PlanKey fullKey)
           
 void setProject(Project project)
           
 void setSuspendedFromBuilding(boolean suspendFromBuilding)
          Sets the build to suspend temporarily
 ErrorCollection validateBuild()
          Validates the build's builder and source code locations
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlanPermissionSkeleton

public PlanPermissionSkeleton(long id,
                              java.lang.String planKey,
                              java.lang.Class<? extends Plan> planClass,
                              PlanType planType)
Method Detail

getId

public long getId()
Specified by:
getId in interface BambooIdProvider
Specified by:
getId in interface PlanIdentifier
Returns:
Database id of the plan

setId

public void setId(long id)
Specified by:
setId in interface BambooObject

getPlanKey

@NotNull
public PlanKey getPlanKey()
Description copied from interface: PlanIdentifier
Get the PlanKey identifier for this Plan

Specified by:
getPlanKey in interface PlanIdentifier
Returns:
planKey

getKey

@NotNull
public java.lang.String getKey()
Description copied from interface: ImmutablePlan
Obtain the plan's unique key (uppercase alphanumeric). This includes the project prefix e.g. BAM-MAIN. Prefer PlanIdentifier.getPlanKey()

Specified by:
getKey in interface ImmutablePlan
Returns:
The full key

getPlanClass

public java.lang.Class<? extends Plan> getPlanClass()

getPlanType

@NotNull
public PlanType getPlanType()
Specified by:
getPlanType in interface PlanIdentifier
Returns:
the type of this plan

setKey

public void setKey(java.lang.String fullKey)
Specified by:
setKey in interface Plan

setPlanKey

public void setPlanKey(@NotNull
                       PlanKey fullKey)
Specified by:
setPlanKey in interface Plan

getBuildKey

@NotNull
public java.lang.String getBuildKey()
Description copied from interface: PlanIdentifier
This objects specific portion of the key. You probably want to use PlanIdentifier.getPlanKey().

Specified by:
getBuildKey in interface PlanIdentifier
Returns:
This objects specific portion of the key

setBuildKey

public void setBuildKey(java.lang.String buildKey)
Description copied from interface: Plan
Define the build's unique key (uppercase alphanumeric)

Specified by:
setBuildKey in interface Plan
Parameters:
buildKey - The value of the key

getName

@NotNull
public java.lang.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 interface PlanIdentifier
Specified by:
getName in interface DescriptionProvider
Specified by:
getName in interface NameProvider
Returns:
String

getDescription

public java.lang.String getDescription()
Specified by:
getDescription in interface DescriptionProvider

getBuildName

@NotNull
public java.lang.String getBuildName()
Specified by:
getBuildName in interface PlanIdentifier
Returns:
The plan specific portion of the name (without the project and/or parent's names). You probably want to use PlanIdentifier.getName()

setBuildName

public void setBuildName(java.lang.String buildName)
Specified by:
setBuildName in interface Plan

setMaster

public void setMaster(Plan master)
Description copied from interface: Plan
Set which plan is the master of this plan. The master is the plan which this one is derived from. Configuration is pulled from the master if one exists.

Specified by:
setMaster in interface Plan

getMaster

public Plan getMaster()
Description copied from interface: ImmutablePlan
Return the master plan if one exists. The master is the plan which this one is derived from. Configuration is pulled from the master if one exists.

Specified by:
getMaster in interface ImmutablePlan
Returns:
the master Plan if one exists.

hasMaster

public boolean hasMaster()
Specified by:
hasMaster in interface ImmutablePlan
Returns:
true if plan has a master plan

validateBuild

public ErrorCollection validateBuild()
Description copied from interface: Plan
Validates the build's builder and source code locations

Specified by:
validateBuild in interface Plan
Returns:
and ErrorCollection with relevent error messages

getCurrentStatus

@NotNull
public java.lang.String getCurrentStatus()
Description copied from interface: ImmutablePlan
Retuns a string key as to what the status is. Can be "success", "failure", "current", "none" or "notRun". Mainly used for UI purposes.

Specified by:
getCurrentStatus in interface ImmutablePlan
Returns:

isExecuting

public boolean isExecuting()
Description copied from interface: ImmutablePlan
Is the build currently being executed?

Specified by:
isExecuting in interface ImmutablePlan
Returns:
true if build is being executed

setSuspendedFromBuilding

public void setSuspendedFromBuilding(boolean suspendFromBuilding)
Description copied from interface: Plan
Sets the build to suspend temporarily

Specified by:
setSuspendedFromBuilding in interface Plan

isSuspendedFromBuilding

public boolean isSuspendedFromBuilding()
Description copied from interface: PlanIdentifier
Checks if the build has been enabled / disabled.

Specified by:
isSuspendedFromBuilding in interface PlanIdentifier
Returns:
true if plan is disabled

getLastBuildNumber

public int getLastBuildNumber()
Description copied from interface: ImmutablePlan
What was the number of the latest build (may be being built)

Specified by:
getLastBuildNumber in interface ImmutablePlan
Returns:
the build number, zero if the build has not been built

getFirstBuildNumber

public int getFirstBuildNumber()
Description copied from interface: ImmutablePlan
What the number of the first build we have? It may not be 1 as some may have been removed!

Specified by:
getFirstBuildNumber in interface ImmutablePlan
Returns:
The number of the first build

hasTests

public boolean hasTests()
Description copied from interface: ImmutablePlan
Do any of TaskDefinition being used in the plan implement TaskTestResultsSupport

Specified by:
hasTests in interface ImmutablePlan

getBuildDefinition

@NotNull
public BuildDefinition getBuildDefinition()
Description copied from interface: ImmutablePlan
Returns the BuildDefinition that backs this Plan

Specified by:
getBuildDefinition in interface ImmutablePlan
Returns:
BuildDefinition object.

getProject

@NotNull
public Project getProject()
Description copied from interface: ImmutablePlan
Returns the parent Project

Specified by:
getProject in interface ImmutablePlan
Specified by:
getProject in interface PlanIdentifier
Returns:
Project. Never null

setProject

public void setProject(Project project)
Specified by:
setProject in interface Plan

getNextBuildNumber

public int getNextBuildNumber()
Description copied from interface: ImmutablePlan
The next build number represents the number of the next build result that's to be executed

Specified by:
getNextBuildNumber in interface ImmutablePlan
Returns:
a build number, starting with 1

setNextBuildNumber

public void setNextBuildNumber(int nextBuildNumber)
Specified by:
setNextBuildNumber in interface Plan

setLastBuildNumber

public void setLastBuildNumber(int lastBuildNumber)
Specified by:
setLastBuildNumber in interface Plan

setFirstBuildNumber

public void setFirstBuildNumber(int firstBuildNumber)
Specified by:
setFirstBuildNumber in interface Plan

getBuildDefinitionXml

public BuildDefinitionForBuild getBuildDefinitionXml()
Specified by:
getBuildDefinitionXml in interface ImmutablePlan

setBuildDefinitionXml

public void setBuildDefinitionXml(BuildDefinitionForBuild buildDefinitionXml)
Specified by:
setBuildDefinitionXml in interface Plan

getLabellings

@NotNull
public java.util.List<Labelling> getLabellings()
Description copied from interface: Plan
Used only for Hibernate mapping purposes. Deprecated for removal from the interface

Specified by:
getLabellings in interface Plan
Returns:

setLabellings

public void setLabellings(java.util.List<Labelling> labellings)
Specified by:
setLabellings in interface Plan

getRelatedLabellings

@NotNull
public java.util.List<Labelling> getRelatedLabellings()
Description copied from interface: Plan
Returns labellings that's application for the plan level

Specified by:
getRelatedLabellings in interface Plan
Returns:
Empty list if no labels

getBuildLogger

@NotNull
public BuildLogger getBuildLogger()
Description copied from interface: ImmutablePlan
Returns the helper object to deal with logging

Specified by:
getBuildLogger in interface ImmutablePlan
Returns:
A BuildLogger. @NotNull

isActive

public boolean isActive()
Description copied from interface: ImmutablePlan
Is the plan queued or building?

Specified by:
isActive in interface ImmutablePlan
Returns:

getAverageBuildDuration

public long getAverageBuildDuration()
Description copied from interface: ImmutablePlan
Returns an average duration of the recent builds

Specified by:
getAverageBuildDuration in interface ImmutablePlan
Returns:
The duration in milliseconds

getType

@NotNull
public java.lang.String getType()
Description copied from interface: ImmutablePlan
Returns the string representation of the type. See PlanType and used in Freemarker.

Specified by:
getType in interface ImmutablePlan
Returns:
the string representation of the type

getLatestResultsSummary

public ResultsSummary getLatestResultsSummary()
Description copied from interface: ImmutablePlan
Get the latest finished result

Specified by:
getLatestResultsSummary in interface ImmutablePlan
Returns:
The summary info for the last completed build. Returns null if there are no build results for this plan

isBusy

public boolean isBusy()
Description copied from interface: ImmutablePlan
Is the Plan "busy". Busy is defined by the plan having a lock held on it. This is done during change detection, dependency listner and the like

Specified by:
isBusy in interface ImmutablePlan
Returns:
busy

getLabelNames

@NotNull
public java.util.List<java.lang.String> getLabelNames()
Description copied from interface: ImmutablePlan
Returns all the names of related labels with a namesapce of :label

Specified by:
getLabelNames in interface ImmutablePlan
Returns:

isMarkedForDeletion

public boolean isMarkedForDeletion()
Description copied from interface: ImmutablePlan
Is the plan set to be deleted in the future

Specified by:
isMarkedForDeletion in interface ImmutableDeletable
Specified by:
isMarkedForDeletion in interface ImmutablePlan
Returns:
Whether or not the Object has been marked for deletion

setMarkedForDeletion

public void setMarkedForDeletion(boolean markedForDeletion)
Specified by:
setMarkedForDeletion in interface Deletable

setName

public void setName(@NotNull
                    java.lang.String name)
Specified by:
setName in interface Describable

setDescription

public void setDescription(@Nullable
                           java.lang.String description)
Specified by:
setDescription in interface Describable

getVariables

@NotNull
public java.util.List<VariableDefinition> getVariables()
Description copied from interface: ImmutablePlan
Return list of VariableDefinitions bind to this Plan

Specified by:
getVariables in interface ImmutablePlan
Returns:
non-null list of VariableDefinition

getEffectiveVariables

@NotNull
public java.util.List<VariableDefinition> getEffectiveVariables()
Description copied from interface: ImmutablePlan
Return effective list of VariableDefinitions bind to this Plan. For master Plans this will return the same result as ImmutablePlan.getVariables(). Non-master plans will produce the sum of: - all master's variables which keys do not appear in result of ImmutablePlan.getVariables() - result of ImmutablePlan.getVariables()

Specified by:
getEffectiveVariables in interface ImmutablePlan
Returns:
non-null list of VariableDefinition


Copyright © 2012 Atlassian. All Rights Reserved.