Package hudson.plugins.promoted_builds
Class JobPropertyImpl
- java.lang.Object
-
- hudson.model.JobProperty<AbstractProject<?,?>>
-
- hudson.plugins.promoted_builds.JobPropertyImpl
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<JobProperty<?>>
,ItemGroup<PromotionProcess>
,ModelObject
,PersistenceRoot
,ReconfigurableDescribable<JobProperty<?>>
,Saveable
,BuildStep
public final class JobPropertyImpl extends JobProperty<AbstractProject<?,?>> implements ItemGroup<PromotionProcess>
Promotion processes defined for a project.TODO: a possible performance problem as every time the owner job is reconfigured, all the promotion processes get reloaded from the disk.
- Author:
- Kohsuke Kawaguchi
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JobPropertyImpl.DescriptorImpl
-
Nested classes/interfaces inherited from interface hudson.tasks.BuildStep
BuildStep.PublisherList
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
-
Fields inherited from class hudson.model.JobProperty
owner
-
Fields inherited from interface hudson.tasks.BuildStep
BUILDERS, PUBLISHERS
-
-
Constructor Summary
Constructors Constructor Description JobPropertyImpl(AbstractProject<?,?> owner)
Programmatic construction.JobPropertyImpl(JobPropertyImpl other, AbstractProject<?,?> owner)
Programmatic construction.JobPropertyImpl(Set<String> activeProcessNames)
Programmatic construction.
-
Method Summary
-
Methods inherited from class hudson.model.JobProperty
getDescriptor, getJobActions, getJobOverrides, getProjectAction, getProjectActions, getRequiredMonitorService, getSubTasks, perform, reconfigure
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface hudson.model.ItemGroup
allItems, allItems, allItems, getAllItems, getAllItems, getAllItems, getItems, getItemsStream, getItemsStream
-
-
-
-
Constructor Detail
-
JobPropertyImpl
public JobPropertyImpl(AbstractProject<?,?> owner) throws Descriptor.FormException, IOException
Programmatic construction.- Parameters:
owner
- owner job- Throws:
Descriptor.FormException
IOException
-
JobPropertyImpl
public JobPropertyImpl(JobPropertyImpl other, AbstractProject<?,?> owner) throws Descriptor.FormException, IOException
Programmatic construction.- Parameters:
other
- Property to be copiedowner
- owner job- Throws:
Descriptor.FormException
IOException
-
-
Method Detail
-
addProcess
public PromotionProcess addProcess(String name) throws IOException
Adds a new promotion process of the given name.- Parameters:
name
- Name of the process to be created- Returns:
- Created process
- Throws:
IOException
- Execution error
-
setOwner
protected void setOwner(AbstractProject<?,?> owner)
- Overrides:
setOwner
in classJobProperty<AbstractProject<?,?>>
-
getItems
public List<PromotionProcess> getItems()
Gets the list of promotion processes defined for this project, including ones that are no longer actively used and only for archival purpose.- Specified by:
getItems
in interfaceItemGroup<PromotionProcess>
- Returns:
- non-null and non-empty. Read-only.
-
getActiveItems
public List<PromotionProcess> getActiveItems()
Gets the list of active promotion processes.
-
createProcessFromXml
public PromotionProcess createProcessFromXml(String name, InputStream xml) throws IOException
-
getOwner
public AbstractProject<?,?> getOwner()
GetsAbstractProject
that contains us.- Returns:
- Owner project
-
getItem
@CheckForNull public PromotionProcess getItem(String name)
Finds aPromotionProcess
by name.- Specified by:
getItem
in interfaceItemGroup<PromotionProcess>
- Parameters:
name
- Name of the process- Returns:
PromotionProcess
if it can be found.
-
getRootDir
public File getRootDir()
- Specified by:
getRootDir
in interfacePersistenceRoot
-
save
public void save() throws IOException
- Specified by:
save
in interfaceSaveable
- Throws:
IOException
-
onDeleted
public void onDeleted(PromotionProcess process)
- Specified by:
onDeleted
in interfaceItemGroup<PromotionProcess>
-
onRenamed
public void onRenamed(PromotionProcess item, String oldName, String newName) throws IOException
- Specified by:
onRenamed
in interfaceItemGroup<PromotionProcess>
- Throws:
IOException
-
getUrl
public String getUrl()
- Specified by:
getUrl
in interfaceItemGroup<PromotionProcess>
-
getFullName
public String getFullName()
- Specified by:
getFullName
in interfaceItemGroup<PromotionProcess>
-
getFullDisplayName
public String getFullDisplayName()
- Specified by:
getFullDisplayName
in interfaceItemGroup<PromotionProcess>
-
getUrlChildPrefix
public String getUrlChildPrefix()
- Specified by:
getUrlChildPrefix
in interfaceItemGroup<PromotionProcess>
-
getRootDirFor
public File getRootDirFor(PromotionProcess child)
- Specified by:
getRootDirFor
in interfaceItemGroup<PromotionProcess>
-
getDisplayName
public String getDisplayName()
- Specified by:
getDisplayName
in interfaceModelObject
-
prebuild
public boolean prebuild(AbstractBuild<?,?> build, BuildListener listener)
- Specified by:
prebuild
in interfaceBuildStep
- Overrides:
prebuild
in classJobProperty<AbstractProject<?,?>>
-
getJobAction
@Deprecated public Action getJobAction(AbstractProject<?,?> job)
Deprecated.- Overrides:
getJobAction
in classJobProperty<AbstractProject<?,?>>
-
-