Class MultiBranchProject<P extends Job<P,​R> & TopLevelItem,​R extends Run<P,​R>>

    • Constructor Detail

      • MultiBranchProject

        protected MultiBranchProject​(ItemGroup parent,
                                     String name)
        Constructor, mandated by TopLevelItem.
        Parameters:
        parent - the parent of this multibranch job.
        name - the name of the multibranch job.
    • Method Detail

      • newFolderViewHolder

        protected com.cloudbees.hudson.plugins.folder.views.AbstractFolderViewHolder newFolderViewHolder()
        Overrides:
        newFolderViewHolder in class com.cloudbees.hudson.plugins.folder.AbstractFolder<P extends Job<P,​R> & TopLevelItem>
      • newDefaultFolderIcon

        protected com.cloudbees.hudson.plugins.folder.FolderIcon newDefaultFolderIcon()
        Overrides:
        newDefaultFolderIcon in class com.cloudbees.hudson.plugins.folder.AbstractFolder<P extends Job<P,​R> & TopLevelItem>
      • getSourcePronoun

        public String getSourcePronoun()
        Get the term used in the UI to represent the source for this kind of Item. Must start with a capital letter.
        Returns:
        term used in the UI to represent the source
      • getProjectClass

        public final Class<P> getProjectClass()
        Returns the base class of the projects that are managed by this MultiBranchProject.
        Returns:
        the base class of the projects that are managed by this MultiBranchProject.
        Since:
        2.0
      • newProjectFactory

        @NonNull
        protected abstract BranchProjectFactory<P,​R> newProjectFactory()
        Creates a new instance of the default project factory to be used for a new instance of the project type.
        Returns:
        a new default BranchProjectFactory.
      • getSources

        @Exported
        @NonNull
        public List<BranchSource> getSources()
        The sources of branches.
        Returns:
        the sources of branches.
      • getSourcesList

        @NonNull
        public PersistedList<BranchSource> getSourcesList()
        Offers direct access to the configurable list of branch sources. Intended for use from scripting and testing.
        Returns:
        the sources list.
      • setSourcesList

        public void setSourcesList​(List<BranchSource> sources)
                            throws IOException
        Offers direct access to set the configurable list of branch sources while preserving branch source id associations for sources that are otherwise unmodified
        Parameters:
        sources - the new sources.
        Throws:
        IOException - if the sources could not be persisted to disk.
      • getSCMSources

        @NonNull
        public List<jenkins.scm.api.SCMSource> getSCMSources()
        Specified by:
        getSCMSources in interface jenkins.scm.api.SCMSourceOwner
      • getSCMSource

        @CheckForNull
        public jenkins.scm.api.SCMSource getSCMSource​(@CheckForNull
                                                      String sourceId)
        Specified by:
        getSCMSource in interface jenkins.scm.api.SCMSourceOwner
      • getSCMSourceCriteria

        @CheckForNull
        public jenkins.scm.api.SCMSourceCriteria getSCMSourceCriteria​(@NonNull
                                                                      jenkins.scm.api.SCMSource source)
        Specified by:
        getSCMSourceCriteria in interface jenkins.scm.api.SCMSourceOwner
      • onSCMSourceUpdated

        public void onSCMSourceUpdated​(@NonNull
                                       jenkins.scm.api.SCMSource source)
        Specified by:
        onSCMSourceUpdated in interface jenkins.scm.api.SCMSourceOwner
      • isHasEvents

        public boolean isHasEvents()
        Overrides:
        isHasEvents in class com.cloudbees.hudson.plugins.folder.computed.ComputedFolder<P extends Job<P,​R> & TopLevelItem>
      • getItem

        @CheckForNull
        public P getItem​(String name)
        Returns the named child job or null if no such job exists.
        Specified by:
        getItem in interface ItemGroup<P extends Job<P,​R> & TopLevelItem>
        Overrides:
        getItem in class com.cloudbees.hudson.plugins.folder.AbstractFolder<P extends Job<P,​R> & TopLevelItem>
        Parameters:
        name - the name of the child job.
        Returns:
        the named child job or null if no such job exists.
      • getItemByBranchName

        @CheckForNull
        public P getItemByBranchName​(@NonNull
                                     String branchName)
        Returns the child job with the specified branch name or null if no such child job exists.
        Parameters:
        branchName - the name of the branch.
        Returns:
        the child job or null if no such job exists or if the requesting user does ave permission to view it.
        Since:
        2.0.0
      • getBranch

        @Deprecated
        @CheckForNull
        public P getBranch​(String name)
        Deprecated.
        use getItem(String) or AbstractFolder.getJob(String) directly
        Returns the named branch job or null if no such branch exists.
        Parameters:
        name - the name of the branch
        Returns:
        the named branch job or null if no such branch exists.
      • getJobsDir

        @NonNull
        public File getJobsDir()
        Returns the directory that all branches are stored in.
        Overrides:
        getJobsDir in class com.cloudbees.hudson.plugins.folder.AbstractFolder<P extends Job<P,​R> & TopLevelItem>
        Returns:
        the directory that all branches are stored in.
      • getComputationDir

        @NonNull
        public File getComputationDir()
        Returns the directory that branch indexing is stored in.
        Overrides:
        getComputationDir in class com.cloudbees.hudson.plugins.folder.computed.ComputedFolder<P extends Job<P,​R> & TopLevelItem>
        Returns:
        the directory that branch indexing is stored in.
      • getIndexing

        public MultiBranchProject.BranchIndexing<P,​R> getIndexing()
        Returns the current/most recent indexing details.
        Returns:
        the current/most recent indexing details.
      • fireSCMSourceAfterSave

        protected void fireSCMSourceAfterSave​(List<jenkins.scm.api.SCMSource> sources)
        Fires the SCMSource.afterSave() method for the supplied sources.
        Parameters:
        sources - the sources.
      • getWelcomeView

        protected View getWelcomeView()
        Creates a place-holder view when there's no active branch indexed.
        Returns:
        the place-holder view when there's no active branch indexed.
      • isBuildable

        public boolean isBuildable()
        Overrides:
        isBuildable in class com.cloudbees.hudson.plugins.folder.computed.ComputedFolder<P extends Job<P,​R> & TopLevelItem>
      • createComputation

        @NonNull
        protected com.cloudbees.hudson.plugins.folder.computed.FolderComputation<P> createComputation​(com.cloudbees.hudson.plugins.folder.computed.FolderComputation<P> previous)
        Overrides:
        createComputation in class com.cloudbees.hudson.plugins.folder.computed.ComputedFolder<P extends Job<P,​R> & TopLevelItem>
      • rawDecode

        @NonNull
        public static String rawDecode​(@NonNull
                                       String s)
        Inverse function of Util.rawEncode(String)
        Parameters:
        s - the encoded string.
        Returns:
        the decoded string.