Package hudson.plugins.promoted_builds
Class 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/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
ConstructorDescriptionJobPropertyImpl
(AbstractProject<?, ?> owner) Programmatic construction.JobPropertyImpl
(JobPropertyImpl other, AbstractProject<?, ?> owner) Programmatic construction.JobPropertyImpl
(Set<String> activeProcessNames) Programmatic construction. -
Method Summary
Modifier and TypeMethodDescriptionaddProcess
(String name) Adds a new promotion process of the given name.createProcessFromXml
(String name, InputStream xml) Gets the list of active promotion processes.Finds aPromotionProcess
by name.getItems()
Gets the list of promotion processes defined for this project, including ones that are no longer actively used and only for archival purpose.getJobAction
(AbstractProject<?, ?> job) Deprecated.AbstractProject<?,
?> getOwner()
GetsAbstractProject
that contains us.getRootDirFor
(PromotionProcess child) getUrl()
void
onDeleted
(PromotionProcess process) void
onRenamed
(PromotionProcess item, String oldName, String newName) boolean
prebuild
(AbstractBuild<?, ?> build, BuildListener listener) void
save()
protected void
setOwner
(AbstractProject<?, ?> owner) 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 Details
-
JobPropertyImpl
Programmatic construction.- Parameters:
owner
- owner job- Throws:
Descriptor.FormException
IOException
-
JobPropertyImpl
public JobPropertyImpl(JobPropertyImpl other, AbstractProject<?, ?> owner) throws Descriptor.FormException, IOExceptionProgrammatic construction.- Parameters:
other
- Property to be copiedowner
- owner job- Throws:
Descriptor.FormException
IOException
-
JobPropertyImpl
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public JobPropertyImpl(Set<String> activeProcessNames) Programmatic construction.
-
-
Method Details
-
addProcess
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
- Overrides:
setOwner
in classJobProperty<AbstractProject<?,
?>>
-
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
Gets the list of active promotion processes. -
createProcessFromXml
-
getOwner
GetsAbstractProject
that contains us.- Returns:
- Owner project
-
getItem
Finds aPromotionProcess
by name.- Specified by:
getItem
in interfaceItemGroup<PromotionProcess>
- Parameters:
name
- Name of the process- Returns:
PromotionProcess
if it can be found.
-
getRootDir
- Specified by:
getRootDir
in interfacePersistenceRoot
-
save
- Specified by:
save
in interfaceSaveable
- Throws:
IOException
-
onDeleted
- Specified by:
onDeleted
in interfaceItemGroup<PromotionProcess>
-
onRenamed
- Specified by:
onRenamed
in interfaceItemGroup<PromotionProcess>
- Throws:
IOException
-
getUrl
- Specified by:
getUrl
in interfaceItemGroup<PromotionProcess>
-
getFullName
- Specified by:
getFullName
in interfaceItemGroup<PromotionProcess>
-
getFullDisplayName
- Specified by:
getFullDisplayName
in interfaceItemGroup<PromotionProcess>
-
getUrlChildPrefix
- Specified by:
getUrlChildPrefix
in interfaceItemGroup<PromotionProcess>
-
getRootDirFor
- Specified by:
getRootDirFor
in interfaceItemGroup<PromotionProcess>
-
getDisplayName
- Specified by:
getDisplayName
in interfaceModelObject
-
prebuild
- Specified by:
prebuild
in interfaceBuildStep
- Overrides:
prebuild
in classJobProperty<AbstractProject<?,
?>>
-
getJobAction
Deprecated.- Overrides:
getJobAction
in classJobProperty<AbstractProject<?,
?>>
-