Package jenkins.model
Class ProjectNamingStrategy
- java.lang.Object
-
- jenkins.model.ProjectNamingStrategy
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<ProjectNamingStrategy>
- Direct Known Subclasses:
ProjectNamingStrategy.DefaultProjectNamingStrategy
,ProjectNamingStrategy.PatternProjectNamingStrategy
public abstract class ProjectNamingStrategy extends Object implements Describable<ProjectNamingStrategy>, ExtensionPoint
This ExtensionPoint allows to enforce the name of projects/jobs.- Author:
- Dominik Bartholdi (imod)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ProjectNamingStrategy.DefaultProjectNamingStrategy
Default implementation which does not restrict the name to any form.static class
ProjectNamingStrategy.PatternProjectNamingStrategy
Naming strategy which allows the admin to define a pattern a job's name has to follow.static class
ProjectNamingStrategy.ProjectNamingStrategyDescriptor
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
Fields Modifier and Type Field Description static ProjectNamingStrategy
DEFAULT_NAMING_STRATEGY
The default naming strategy which does not restrict the name of a job.
-
Constructor Summary
Constructors Constructor Description ProjectNamingStrategy()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static DescriptorExtensionList<ProjectNamingStrategy,ProjectNamingStrategy.ProjectNamingStrategyDescriptor>
all()
void
checkName(String name)
Deprecated.void
checkName(String parentName, String name)
Called when creating a new job.ProjectNamingStrategy.ProjectNamingStrategyDescriptor
getDescriptor()
Gets the descriptor for this instance.boolean
isForceExistingJobs()
This flag can be used to force existing jobs to be migrated to a new naming strategy - if this method returns true, the naming will be enforced at every config change.
-
-
-
Field Detail
-
DEFAULT_NAMING_STRATEGY
public static final ProjectNamingStrategy DEFAULT_NAMING_STRATEGY
The default naming strategy which does not restrict the name of a job.
-
-
Method Detail
-
getDescriptor
public ProjectNamingStrategy.ProjectNamingStrategyDescriptor getDescriptor()
Description copied from interface:Describable
Gets the descriptor for this instance.Descriptor
is a singleton for every concreteDescribable
implementation, so ifa.getClass() == b.getClass()
then by defaulta.getDescriptor() == b.getDescriptor()
as well. (In rare cases a single implementation class may be used for instances with distinct descriptors.)- Specified by:
getDescriptor
in interfaceDescribable<ProjectNamingStrategy>
-
all
public static DescriptorExtensionList<ProjectNamingStrategy,ProjectNamingStrategy.ProjectNamingStrategyDescriptor> all()
-
checkName
@Deprecated public void checkName(String name) throws Failure
Deprecated.Called when creating a new job.- Parameters:
name
- the name given from the UI- Throws:
Failure
- if the user has to be informed about an illegal name, forces the user to change the name before submitting. The message of the failure will be presented to the user.
-
checkName
public void checkName(String parentName, String name) throws Failure
Called when creating a new job.- Parameters:
parentName
- the full name of the parent ItemGroupname
- the name given from the UI- Throws:
Failure
- if the user has to be informed about an illegal name, forces the user to change the name before submitting. The message of the failure will be presented to the user.- Since:
- 2.367
-
isForceExistingJobs
public boolean isForceExistingJobs()
This flag can be used to force existing jobs to be migrated to a new naming strategy - if this method returns true, the naming will be enforced at every config change. Iffalse
is returned, only new jobs have to follow the strategy.- Returns:
true
if existing jobs should be enforced to confirm to the naming standard.
-
-