hudson.model
Class Project<P extends Project<P,B>,B extends Build<P,B>>

java.lang.Object
  extended by hudson.model.AbstractModelObject
      extended by hudson.model.Actionable
          extended by hudson.model.AbstractItem
              extended by hudson.model.Job<P,R>
                  extended by hudson.model.AbstractProject<P,B>
                      extended by hudson.model.Project<P,B>
All Implemented Interfaces:
ExtensionPoint, BuildableItem, BuildableItemWithBuildWrappers, DescriptorByNameOwner, Item, ModelObject, PersistenceRoot, SubTask, Queue.Task, ResourceActivity, Saveable, SCMedItem, SearchableModelObject, SearchItem, AccessControlled, Maven.ProjectWithMaven, ModelObjectWithContextMenu, OnMaster, org.kohsuke.stapler.HttpDeletable, org.kohsuke.stapler.StaplerOverridable
Direct Known Subclasses:
FreeStyleProject, MatrixConfiguration

public abstract class Project<P extends Project<P,B>,B extends Build<P,B>>
extends AbstractProject<P,B>
implements SCMedItem, Saveable, Maven.ProjectWithMaven, BuildableItemWithBuildWrappers

Buildable software project.

Author:
Kohsuke Kawaguchi

Nested Class Summary
 
Nested classes/interfaces inherited from class hudson.model.AbstractProject
AbstractProject.AbstractProjectDescriptor, AbstractProject.BecauseOfBuildInProgress, AbstractProject.BecauseOfDownstreamBuildInProgress, AbstractProject.BecauseOfUpstreamBuildInProgress
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Nested classes/interfaces inherited from interface jenkins.model.ModelObjectWithContextMenu
ModelObjectWithContextMenu.ContextMenu, ModelObjectWithContextMenu.MenuItem
 
Field Summary
 
Fields inherited from class hudson.model.AbstractProject
ABORT, blockBuildWhenDownstreamBuilding, blockBuildWhenUpstreamBuilding, BUILD_NOW_TEXT, builds, disabled, transientActions, triggers
 
Fields inherited from class hudson.model.Job
HISTORY_ADAPTER, nextBuildNumber, properties
 
Fields inherited from class hudson.model.AbstractItem
description, displayName, name, PRONOUN
 
Fields inherited from interface hudson.model.Item
BUILD, CANCEL, CONFIGURE, CREATE, DELETE, DISCOVER, EXTENDED_READ, PERMISSIONS, READ, WIPEOUT, WORKSPACE
 
Constructor Summary
Project(ItemGroup parent, String name)
          Creates a new project.
 
Method Summary
 void addPublisher(Publisher buildStep)
          Deprecated. as of 1.290 Use getPublishersList().add(x)
 AbstractProject<?,?> asProject()
          SCMedItem needs to be an instance of AbstractProject.
protected  void buildDependencyGraph(DependencyGraph graph)
          Builds the dependency graph.
protected  List<Action> createTransientActions()
           
 List<Builder> getBuilders()
           
 DescribableList<Builder,Descriptor<Builder>> getBuildersList()
           
 Map<Descriptor<BuildWrapper>,BuildWrapper> getBuildWrappers()
           
 DescribableList<BuildWrapper,Descriptor<BuildWrapper>> getBuildWrappersList()
          BuildWrappers associated with this AbstractProject.
 Publisher getPublisher(Descriptor<Publisher> descriptor)
           
 Map<Descriptor<Publisher>,Publisher> getPublishers()
          Deprecated. as of 1.463 We will be soon removing the restriction that only one instance of publisher is allowed per type. Use getPublishersList() instead.
 DescribableList<Publisher,Descriptor<Publisher>> getPublishersList()
          Returns the live list of all Publishers configured for this project.
protected  Set<ResourceActivity> getResourceActivities()
          Set of child resource activities of the build of this project (override in child projects).
 Maven.MavenInstallation inferMavenInstallation()
          Gets the Maven.MavenInstallation associated with the project.
 boolean isFingerprintConfigured()
          True if the builds of this project produces Fingerprint records.
 void onLoad(ItemGroup<? extends Item> parent, String name)
          Called right after when a Item is loaded from disk.
 void removePublisher(Descriptor<Publisher> descriptor)
          Deprecated. as of 1.290 Use getPublishersList().remove(x)
protected  void submit(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
          Derived class can override this to perform additional config submission work.
 
Methods inherited from class hudson.model.AbstractProject
_getRuns, addProperty, addToList, addTrigger, blockBuildWhenDownstreamBuilding, blockBuildWhenUpstreamBuilding, buildDescribable, buildDescribable, checkAbortPermission, checkout, createExecutable, createHistoryWidget, disable, doBuild, doBuildWithParameters, doCancelQueue, doCheckRetryCount, doConfigSubmit, doDisable, doDoDelete, doDoWipeOutWorkspace, doEnable, doPolling, doRssChangelog, doWs, enable, findNearest, findNearest, getActions, getAssignedLabel, getAssignedLabelString, getAuthToken, getBuild, getBuildByNumber, getBuildClass, getBuildingDownstream, getBuildingUpstream, getBuildNowText, getBuildTriggerUpstreamProjects, getCauseOfBlockage, getCustomWorkspace, getDelay, getDownstreamProjects, getEnvironment, getFirstBuild, getHasCustomQuietPeriod, getIconColor, getJDK, getLastBuild, getLastBuiltOn, getModuleRoot, getModuleRoots, getNearestBuild, getNearestOldBuild, getOwnerTask, getProminentActions, getPronoun, getQueueItem, getQuietPeriod, getRelationship, getRelevantLabels, getResourceList, getRootProject, getSameNodeConstraint, getScm, getScmCheckoutRetryCount, getScmCheckoutStrategy, getSomeBuildWithWorkspace, getSomeWorkspace, getSubTasks, getTransitiveDownstreamProjects, getTransitiveUpstreamProjects, getTrigger, getTriggers, getUpstreamProjects, getWhyBlocked, getWorkspace, getWorkspaceResource, hasAbortPermission, hasCustomScmCheckoutRetryCount, hasParticipant, isBuildable, isBuildBlocked, isConcurrentBuild, isConfigurable, isDisabled, isInQueue, isParameterized, loadBuild, makeDisabled, makeSearchIndex, newBuild, onCreatedFromScratch, performDelete, poll, pollSCMChanges, removeFromList, removeRun, removeTrigger, resolveForCLI, save, scheduleBuild, scheduleBuild, scheduleBuild, scheduleBuild, scheduleBuild, scheduleBuild2, scheduleBuild2, scheduleBuild2, scheduleBuild2, schedulePolling, setAssignedLabel, setAssignedNode, setBlockBuildWhenDownstreamBuilding, setBlockBuildWhenUpstreamBuilding, setConcurrentBuild, setCustomWorkspace, setJDK, setQuietPeriod, setScm, setScmCheckoutStrategy, supportsMakeDisabled, updateTransientActions
 
Methods inherited from class hudson.model.Job
assignBuildNumber, delete, doBuildStatus, doDescription, doDoRename, doRssAll, doRssFailed, getACL, getAllJobs, getAllProperties, getBuildDir, getBuildDiscarder, getBuildForCLI, getBuildHealth, getBuildHealthReports, getBuilds, getBuilds, getBuildsAsMap, getBuildsByTimestamp, getBuildStatusUrl, getBuildTimeGraph, getCharacteristicEnvVars, getDynamic, getEstimatedDuration, getLastBuildsOverThreshold, getLastCompletedBuild, getLastFailedBuild, getLastStableBuild, getLastSuccessfulBuild, getLastUnstableBuild, getLastUnsuccessfulBuild, getLogRotator, getNewBuilds, getNextBuildNumber, getOverrides, getPermalinks, getProperties, getProperty, getProperty, getTimeline, getWidgets, isBuilding, isHoldOffBuildUntilSave, isKeepDependencies, isLogUpdated, isNameEditable, logRotate, onCopiedFrom, removeProperty, removeProperty, renameTo, saveNextBuildNumber, setBuildDiscarder, setLogRotator, supportsLogRotator, updateNextBuildNumber
 
Methods inherited from class hudson.model.AbstractItem
checkPermission, delete, doConfigDotXml, doSetName, doSubmitDescription, getAbsoluteUrl, getApi, getConfigFile, getDescription, getDescriptorByName, getDisplayName, getDisplayNameOrNull, getFullDisplayName, getFullName, getName, getParent, getRelativeNameFrom, getRelativeNameFrom, getRelativeNameFromGroup, getRootDir, getSearchName, getSearchUrl, getShortUrl, getUrl, hasPermission, setDescription, setDisplayName, setDisplayNameOrNull, toString, updateByXml, updateByXml
 
Methods inherited from class hudson.model.Actionable
addAction, doContextMenu, getAction, getAction, getActions
 
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface hudson.model.SCMedItem
getScm, poll, pollSCMChanges
 
Methods inherited from interface hudson.model.BuildableItem
scheduleBuild, scheduleBuild, scheduleBuild, scheduleBuild
 
Methods inherited from interface hudson.model.Item
delete, getAbsoluteUrl, getAllJobs, getDisplayName, getFullDisplayName, getFullName, getName, getParent, getRelativeNameFrom, getRelativeNameFrom, getShortUrl, getUrl, onCopiedFrom, onCreatedFromScratch
 
Methods inherited from interface hudson.model.PersistenceRoot
getRootDir
 
Methods inherited from interface hudson.search.SearchableModelObject
getSearch
 
Methods inherited from interface hudson.search.SearchItem
getSearchIndex, getSearchName, getSearchUrl
 
Methods inherited from interface hudson.security.AccessControlled
checkPermission, getACL, hasPermission
 
Methods inherited from interface hudson.model.Queue.Task
checkAbortPermission, getCauseOfBlockage, getFullDisplayName, getName, getSubTasks, getUrl, getWhyBlocked, hasAbortPermission, isBuildBlocked, isConcurrentBuild
 
Methods inherited from interface hudson.model.queue.SubTask
createExecutable, getAssignedLabel, getEstimatedDuration, getLastBuiltOn, getOwnerTask, getSameNodeConstraint
 
Methods inherited from interface hudson.model.ResourceActivity
getDisplayName, getResourceList
 

Constructor Detail

Project

public Project(ItemGroup parent,
               String name)
Creates a new project.

Method Detail

onLoad

public void onLoad(ItemGroup<? extends Item> parent,
                   String name)
            throws IOException
Description copied from class: AbstractItem
Called right after when a Item is loaded from disk. This is an opporunity to do a post load processing.

Specified by:
onLoad in interface Item
Overrides:
onLoad in class AbstractProject<P extends Project<P,B>,B extends Build<P,B>>
name - Name of the directory (not a path --- just the name portion) from which the configuration was loaded. This usually becomes the name of this item.
Throws:
IOException

asProject

public AbstractProject<?,?> asProject()
Description copied from interface: SCMedItem
SCMedItem needs to be an instance of AbstractProject.

This method must be always implemented as (AbstractProject)this, but defining this method emphasizes the fact that this cast must be doable.

Specified by:
asProject in interface BuildableItemWithBuildWrappers
Specified by:
asProject in interface SCMedItem

getBuilders

public List<Builder> getBuilders()

getPublishers

public Map<Descriptor<Publisher>,Publisher> getPublishers()
Deprecated. as of 1.463 We will be soon removing the restriction that only one instance of publisher is allowed per type. Use getPublishersList() instead.


getBuildersList

public DescribableList<Builder,Descriptor<Builder>> getBuildersList()

getPublishersList

public DescribableList<Publisher,Descriptor<Publisher>> getPublishersList()
Description copied from class: AbstractProject
Returns the live list of all Publishers configured for this project.

This method couldn't be called getPublishers() because existing methods in sub-classes return different inconsistent types.

Specified by:
getPublishersList in class AbstractProject<P extends Project<P,B>,B extends Build<P,B>>

getBuildWrappers

public Map<Descriptor<BuildWrapper>,BuildWrapper> getBuildWrappers()

getBuildWrappersList

public DescribableList<BuildWrapper,Descriptor<BuildWrapper>> getBuildWrappersList()
Description copied from interface: BuildableItemWithBuildWrappers
BuildWrappers associated with this AbstractProject.

Specified by:
getBuildWrappersList in interface BuildableItemWithBuildWrappers
Returns:
can be empty but never null. This list is live, and changes to it will be reflected to the project configuration.

getResourceActivities

protected Set<ResourceActivity> getResourceActivities()
Description copied from class: AbstractProject
Set of child resource activities of the build of this project (override in child projects).

Overrides:
getResourceActivities in class AbstractProject<P extends Project<P,B>,B extends Build<P,B>>
Returns:
The set of child resource activities of the build of this project.

addPublisher

public void addPublisher(Publisher buildStep)
                  throws IOException
Deprecated. as of 1.290 Use getPublishersList().add(x)

Adds a new BuildStep to this Project and saves the configuration.

Throws:
IOException

removePublisher

public void removePublisher(Descriptor<Publisher> descriptor)
                     throws IOException
Deprecated. as of 1.290 Use getPublishersList().remove(x)

Removes a publisher from this project, if it's active.

Throws:
IOException

getPublisher

public Publisher getPublisher(Descriptor<Publisher> descriptor)

buildDependencyGraph

protected void buildDependencyGraph(DependencyGraph graph)
Description copied from class: AbstractProject
Builds the dependency graph.

Specified by:
buildDependencyGraph in class AbstractProject<P extends Project<P,B>,B extends Build<P,B>>
See Also:
DependencyGraph

isFingerprintConfigured

public boolean isFingerprintConfigured()
Description copied from class: AbstractProject
True if the builds of this project produces Fingerprint records.

Specified by:
isFingerprintConfigured in class AbstractProject<P extends Project<P,B>,B extends Build<P,B>>

inferMavenInstallation

public Maven.MavenInstallation inferMavenInstallation()
Description copied from interface: Maven.ProjectWithMaven
Gets the Maven.MavenInstallation associated with the project. Can be null.

If the Maven installation can not be uniquely determined, it's often better to return just one of them, rather than returning null, since this method is currently ultimately only used to decide where to parse conf/settings.xml from.

Specified by:
inferMavenInstallation in interface Maven.ProjectWithMaven

submit

protected void submit(org.kohsuke.stapler.StaplerRequest req,
                      org.kohsuke.stapler.StaplerResponse rsp)
               throws IOException,
                      javax.servlet.ServletException,
                      Descriptor.FormException
Description copied from class: Job
Derived class can override this to perform additional config submission work.

Overrides:
submit in class AbstractProject<P extends Project<P,B>,B extends Build<P,B>>
Throws:
IOException
javax.servlet.ServletException
Descriptor.FormException

createTransientActions

protected List<Action> createTransientActions()
Overrides:
createTransientActions in class AbstractProject<P extends Project<P,B>,B extends Build<P,B>>


Copyright © 2004-2013. All Rights Reserved.