com.atlassian.bamboo.plan
Class PlanPermissionSkeleton

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

public class PlanPermissionSkeleton
extends java.lang.Object
implements Plan


Field Summary
 
Fields inherited from interface com.atlassian.bamboo.plan.Plan
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)
           
 
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()
          Thie returns the build portion of the build key
 BuildLogger getBuildLogger()
          Returns the helper object to deal with logging
 java.lang.String getBuildName()
          Returns the name for the build in the form of "build name" e.g.
 java.lang.String getCurrentStatus()
          Retuns a string key as to what the status is.
 java.lang.String getDescription()
           
 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 build's unique key (uppercase alphanumeric).
 java.util.List<Labelling> getLabellings()
           
 java.util.List<java.lang.String> getLabelNames()
          Any labels explicitly and specifically related to the plan (ie not result level labels) or meta labvels used for favourites)
 int getLastBuildNumber()
          What was the number of the latest build (may be being built)
 ResultsSummary getLatestResultsSummary()
          Get the summary from the latest completed plan
 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
 Project getProject()
          Returns the parent Project
 java.util.List<Labelling> getRelatedLabellings()
           
 java.lang.String getType()
           
 boolean hasTests()
          Helper method checking if plan has tests defined
 boolean isActive()
          Checks if the plan has an active build(s).
 boolean isBusy()
          Is the Plan busy
 boolean isExecuting()
          Is the build currently being executed?
 boolean isMarkedForDeletion()
           
 boolean isSuspendedFromBuilding()
          Checks if the build has been
 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 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)
Method Detail

getId

public long getId()
Specified by:
getId in interface BambooObject

setId

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

getPlanKey

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

Specified by:
getPlanKey in interface Plan
Returns:
planKey

getKey

public java.lang.String getKey()
Description copied from interface: Plan
Obtain the build's unique key (uppercase alphanumeric). This includes the project prefix e.g. BAM-MAIN

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

getPlanClass

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

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

public java.lang.String getBuildKey()
Description copied from interface: Plan
Thie returns the build portion of the build key

Specified by:
getBuildKey in interface Plan
Returns:
String

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: Plan
Returns the full name for the build in the form of "project name - build name" e.g. "Confluence - HEAD"

Specified by:
getName in interface Plan
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

public java.lang.String getBuildName()
Description copied from interface: Plan
Returns the name for the build in the form of "build name" e.g. if the full name was "Confluence - HEAD" the build name would be HEAD

Specified by:
getBuildName in interface Plan
Returns:
String

setBuildName

public void setBuildName(java.lang.String buildName)
Specified by:
setBuildName in interface 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

public java.lang.String getCurrentStatus()
Description copied from interface: Plan
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 Plan
Returns:

isExecuting

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

Specified by:
isExecuting in interface Plan
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: Plan
Checks if the build has been

Specified by:
isSuspendedFromBuilding in interface Plan
Returns:

getLastBuildNumber

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

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

getFirstBuildNumber

public int getFirstBuildNumber()
Description copied from interface: Plan
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 Plan
Returns:
The number of the first build

hasTests

public boolean hasTests()
Description copied from interface: Plan
Helper method checking if plan has tests defined

Specified by:
hasTests in interface Plan
Returns:
true iff plan produces test results

getBuildDefinition

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

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

getProject

public Project getProject()
Description copied from interface: Plan
Returns the parent Project

Specified by:
getProject in interface Plan
Returns:
Project. Never null

setProject

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

getNextBuildNumber

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

Specified by:
getNextBuildNumber in interface Plan
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 Plan

setBuildDefinitionXml

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

getLabellings

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

setLabellings

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

getRelatedLabellings

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

getBuildLogger

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

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

isActive

public boolean isActive()
Description copied from interface: Plan
Checks if the plan has an active build(s).

Specified by:
isActive in interface Plan
Returns:
true if at least one build request is currently in the queue or being processed

getAverageBuildDuration

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

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

getType

@NotNull
public java.lang.String getType()
Specified by:
getType in interface Plan
Returns:
a string representation of the implementation type. Used for freemarker.

getLatestResultsSummary

public ResultsSummary getLatestResultsSummary()
Description copied from interface: Plan
Get the summary from the latest completed plan

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

isBusy

public boolean isBusy()
Description copied from interface: Plan
Is the Plan busy

Specified by:
isBusy in interface Plan
Returns:
busy

getLabelNames

@NotNull
public java.util.List<java.lang.String> getLabelNames()
Description copied from interface: Plan
Any labels explicitly and specifically related to the plan (ie not result level labels) or meta labvels used for favourites)

Specified by:
getLabelNames in interface Plan
Returns:

isMarkedForDeletion

public boolean isMarkedForDeletion()
Specified by:
isMarkedForDeletion in interface Deletable
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


Copyright © 2011 Atlassian. All Rights Reserved.