Package jenkins.model

Class ProjectNamingStrategy

    • 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.
    • Constructor Detail

      • ProjectNamingStrategy

        public ProjectNamingStrategy()
    • Method Detail

      • 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 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
      • 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. If false is returned, only new jobs have to follow the strategy.
        Returns:
        true if existing jobs should be enforced to confirm to the naming standard.