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 SummaryNested ClassesModifier and TypeClassDescriptionstatic final classDefault implementation which does not restrict the name to any form.static final classNaming strategy which allows the admin to define a pattern a job's name has to follow.static classNested classes/interfaces inherited from interface hudson.ExtensionPointExtensionPoint.LegacyInstancesAreScopedToHudson
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final ProjectNamingStrategyThe default naming strategy which does not restrict the name of a job.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic DescriptorExtensionList<ProjectNamingStrategy, ProjectNamingStrategy.ProjectNamingStrategyDescriptor> all()voidDeprecated.voidCalled when creating a new job.Gets the descriptor for this instance.booleanThis 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 Details- 
DEFAULT_NAMING_STRATEGYThe default naming strategy which does not restrict the name of a job.
 
- 
- 
Constructor Details- 
ProjectNamingStrategypublic ProjectNamingStrategy()
 
- 
- 
Method Details- 
getDescriptorDescription copied from interface:DescribableGets the descriptor for this instance.Descriptoris a singleton for every concreteDescribableimplementation, 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.)By default looks for a nested class (conventionally named DescriptorImpl) implementingDescriptorand marked withExtension.- Specified by:
- getDescriptorin interface- Describable<ProjectNamingStrategy>
 
- 
all
- 
checkNameDeprecated.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.
 
- 
checkNameCalled when creating a new job.- Parameters:
- parentName- the full name of the parent ItemGroup
- 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.
- Since:
- 2.367
 
- 
isForceExistingJobspublic 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. Iffalseis returned, only new jobs have to follow the strategy.- Returns:
- trueif existing jobs should be enforced to confirm to the naming standard.
 
 
- 
checkName(String, String)