Class ProjectCreationEngine
- java.lang.Object
-
- hudson.model.ManagementLink
-
- hudson.plugins.project_inheritance.projects.creation.ProjectCreationEngine
-
- All Implemented Interfaces:
ExtensionPoint,Action,Describable<ProjectCreationEngine>,ModelObject,Saveable
public class ProjectCreationEngine extends ManagementLink implements Saveable, Describable<ProjectCreationEngine>
This class encapsulates the properties and actions of the project creation mechanism.Since it is a global mechanism, this is a singleton that can be configured from a central configuration page and accessed from all objects.
- Author:
- Martin Schroeder
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classProjectCreationEngine.CreationClassThis class describes the fundamental properties of a creation class type.static classProjectCreationEngine.CreationMatingThis class references two creation class names and marks them as to be mated by this creation engine.static classProjectCreationEngine.ProjectCreationEngineDescriptorstatic classProjectCreationEngine.RenameRestrictionstatic classProjectCreationEngine.RenameWatcher-
Nested classes/interfaces inherited from class hudson.model.ManagementLink
ManagementLink.Category
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
-
Fields inherited from class hudson.model.ManagementLink
LIST
-
-
Method Summary
-
Methods inherited from class hudson.model.ManagementLink
all, getCategory, getCategoryName, getRequiredPermission, getRequiresConfirmation, getRequiresPOST
-
-
-
-
Field Detail
-
instance
@Extension(ordinal=100.0) public static final ProjectCreationEngine instance
The singleton instance used throughout a Jenkins-run. As such, this field is created by Jenkins through the Extension annotation during startup. Do note that as this is a Singleton accessible through a static field, theExtensionannotation must be on THIS field.
-
creationClassesDescriptors
protected static LinkedList<Descriptor<ProjectCreationEngine.CreationClass>> creationClassesDescriptors
-
matingDescriptors
protected static LinkedList<Descriptor<ProjectCreationEngine.CreationMating>> matingDescriptors
-
creationClasses
protected LinkedList<ProjectCreationEngine.CreationClass> creationClasses
-
matings
protected LinkedList<ProjectCreationEngine.CreationMating> matings
-
disallowVanillaArchiver
protected boolean disallowVanillaArchiver
-
enableCreation
protected boolean enableCreation
-
triggerOnChange
protected boolean triggerOnChange
-
triggerOnStartup
protected boolean triggerOnStartup
-
copyOnRename
protected boolean copyOnRename
-
enableApplyButton
protected boolean enableApplyButton
-
enableLeakedLogCleaner
protected final transient Boolean enableLeakedLogCleaner
Deprecated.since 19.05.01TODO: Remove after rollout of 19.05.01
-
renameRestriction
protected ProjectCreationEngine.RenameRestriction renameRestriction
-
creationExecutor
protected final transient Executor creationExecutor
-
templates
protected List<ProjectTemplate> templates
The list of jobs to be used as templates for theProjectWizard.
-
-
Method Detail
-
readResolve
public Object readResolve()
-
save
public void save() throws IOException- Specified by:
savein interfaceSaveable- Throws:
IOException
-
doConfigSubmit
public void doConfigSubmit(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException, javax.servlet.ServletException, Descriptor.FormException- Throws:
IOExceptionjavax.servlet.ServletExceptionDescriptor.FormException
-
triggerCreateProjects
public Map<String,String> triggerCreateProjects()
Triggers creation of automatically generated projects; if enabled.Note: This does not check if the user has enough permissions to create jobs. It is up to the caller to ensure that.
- Returns:
- a map containing the results of the generation with entries: (project-name, human-readable-result)
-
doCreateProjects
public void doCreateProjects(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)This starts the job creation and redirects the user to the result page.Do NOT call this directly, if not triggered by the user. Instead call
triggerCreateProjects().
-
notifyJenkinsStartupComplete
public void notifyJenkinsStartupComplete()
-
notifyProjectChange
public void notifyProjectChange(InheritanceProject project)
-
notifyProjectNew
public void notifyProjectNew(InheritanceProject project)
-
notifyProjectDelete
public void notifyProjectDelete(InheritanceProject project)
-
getDisplayName
public String getDisplayName()
- Specified by:
getDisplayNamein interfaceAction- Specified by:
getDisplayNamein interfaceModelObject
-
getIconFileName
public String getIconFileName()
- Specified by:
getIconFileNamein interfaceAction- Specified by:
getIconFileNamein classManagementLink
-
getUrlName
public String getUrlName()
- Specified by:
getUrlNamein interfaceAction- Specified by:
getUrlNamein classManagementLink
-
getDescription
public String getDescription()
- Overrides:
getDescriptionin classManagementLink
-
getEnableReflectionCaching
public boolean getEnableReflectionCaching()
- Returns:
- whether or not the results of some expensive reflection calls
(
Class.isAssignableFrom(Class)) should be cached.
-
getEnableCreation
public boolean getEnableCreation()
-
getTriggerOnChange
public boolean getTriggerOnChange()
-
getTriggerOnStartup
public boolean getTriggerOnStartup()
-
getCopyOnRename
public boolean getCopyOnRename()
-
getEnableApplyButton
public boolean getEnableApplyButton()
-
getRenameRestrictionValue
public ProjectCreationEngine.RenameRestriction getRenameRestrictionValue()
-
getRenameRestriction
public String getRenameRestriction()
-
currentUserMayRename
public boolean currentUserMayRename()
-
getDisallowVanillaArchiver
public boolean getDisallowVanillaArchiver()
-
getAcceptableErrorUrls
public String getAcceptableErrorUrls()
Returns the list of error URLs that are safe to ignore when checking the validation fields of the job configuration files. See: resources/hudson/plugins/project_inheritance/projects/InheritanceProject/adjunct/detectValidationErrors.js- Returns:
- the value of
getAcceptableErrorUrlsList()joined with '\n' as the separator.
-
getAcceptableErrorUrlsList
public List<String> getAcceptableErrorUrlsList()
Returns the list of error URLs that are safe to ignore when checking the validation fields of the job configuration files.- Returns:
- the list of acceptable URLs. May be empty but never null. Returns a default list when the backing field is null.
-
getCreationClasses
public List<ProjectCreationEngine.CreationClass> getCreationClasses()
-
getCreationClassesDescriptors
public static List<Descriptor<ProjectCreationEngine.CreationClass>> getCreationClassesDescriptors()
-
getMatings
public List<ProjectCreationEngine.CreationMating> getMatings()
-
isFirstInCreationMating
public boolean isFirstInCreationMating(String creationClass)
-
getMatingDescriptors
public static List<Descriptor<ProjectCreationEngine.CreationMating>> getMatingDescriptors()
-
getTemplates
public List<ProjectTemplate> getTemplates()
- Returns:
- the list of templates. May be empty, but never null
-
getConfigFile
protected File getConfigFile()
-
setEnableCreation
public void setEnableCreation(boolean enabled)
-
getDescriptor
public Descriptor<ProjectCreationEngine> getDescriptor()
- Specified by:
getDescriptorin interfaceDescribable<ProjectCreationEngine>
-
-