Class AbstractP4ScmSource

    • Constructor Detail

      • AbstractP4ScmSource

        public AbstractP4ScmSource​(String credential)
    • Method Detail

      • setFormat

        @DataBoundSetter
        public void setFormat​(String format)
      • setPopulate

        @DataBoundSetter
        public void setPopulate​(Populate populate)
      • setIncludes

        @DataBoundSetter
        public void setIncludes​(String includes)
      • setExcludes

        @DataBoundSetter
        public void setExcludes​(String excludes)
      • setCharset

        @DataBoundSetter
        public void setCharset​(String charset)
      • setTraits

        @DataBoundSetter
        public void setTraits​(@CheckForNull
                              List<jenkins.scm.api.trait.SCMSourceTrait> traits)
        Overrides:
        setTraits in class jenkins.scm.api.SCMSource
      • setFilter

        @DataBoundSetter
        public void setFilter​(List<Filter> filter)
      • getCredential

        public String getCredential()
      • getTraits

        public List<jenkins.scm.api.trait.SCMSourceTrait> getTraits()
        Overrides:
        getTraits in class jenkins.scm.api.SCMSource
      • getIncludes

        public String getIncludes()
      • getExcludes

        public String getExcludes()
      • getCharset

        public String getCharset()
      • getFormat

        public String getFormat()
      • getPopulate

        public Populate getPopulate()
      • getBrowser

        public abstract P4Browser getBrowser()
      • getScriptPathOrDefault

        public String getScriptPathOrDefault()
      • retrieve

        protected void retrieve​(@CheckForNull
                                jenkins.scm.api.SCMSourceCriteria criteria,
                                @NonNull
                                jenkins.scm.api.SCMHeadObserver observer,
                                @CheckForNull
                                jenkins.scm.api.SCMHeadEvent<?> event,
                                @NonNull
                                TaskListener listener)
                         throws IOException,
                                InterruptedException
        Specified by:
        retrieve in class jenkins.scm.api.SCMSource
        Throws:
        IOException
        InterruptedException
      • createProbe

        protected jenkins.scm.api.SCMProbe createProbe​(@NonNull
                                                       jenkins.scm.api.SCMHead head,
                                                       @CheckForNull
                                                       jenkins.scm.api.SCMRevision revision)
                                                throws IOException
        Overrides:
        createProbe in class jenkins.scm.api.SCMSource
        Throws:
        IOException
      • build

        public PerforceScm build​(@NonNull
                                 jenkins.scm.api.SCMHead head,
                                 @CheckForNull
                                 jenkins.scm.api.SCMRevision revision)
        Specified by:
        build in class jenkins.scm.api.SCMSource
      • retrieveActions

        protected List<Action> retrieveActions​(@CheckForNull
                                               jenkins.scm.api.SCMSourceEvent event,
                                               @NonNull
                                               TaskListener listener)
                                        throws IOException,
                                               InterruptedException
        SCMSource level action. `jenkins.branch.MetadataAction`
        Overrides:
        retrieveActions in class jenkins.scm.api.SCMSource
        Parameters:
        event - Optional event (might be null) use payload to help filter calls.
        listener - the listener to report progress on.
        Returns:
        the list of Action instances to persist.
        Throws:
        IOException - if an error occurs while performing the operation.
        InterruptedException - if any thread has interrupted the current thread.
      • retrieveActions

        protected List<Action> retrieveActions​(@NonNull
                                               jenkins.scm.api.SCMHead head,
                                               @CheckForNull
                                               jenkins.scm.api.SCMHeadEvent event,
                                               @NonNull
                                               TaskListener listener)
                                        throws IOException,
                                               InterruptedException
        SCMHead level action.
        Overrides:
        retrieveActions in class jenkins.scm.api.SCMSource
        Parameters:
        head - Changes on a branch
        event - Optional event (might be null) use payload to help filter calls.
        listener - the listener to report progress on.
        Returns:
        the list of Action instances to persist.
        Throws:
        IOException - if an error occurs while performing the operation.
        InterruptedException - if any thread has interrupted the current thread.
      • retrieveActions

        protected List<Action> retrieveActions​(@NonNull
                                               jenkins.scm.api.SCMRevision revision,
                                               @CheckForNull
                                               jenkins.scm.api.SCMHeadEvent event,
                                               @NonNull
                                               TaskListener listener)
                                        throws IOException,
                                               InterruptedException
        SCMRevision level action.
        Overrides:
        retrieveActions in class jenkins.scm.api.SCMSource
        Parameters:
        revision - the SCMRevision
        event - Optional event (might be null) use payload to help filter calls.
        listener - the listener to report progress on.
        Returns:
        the list of Action instances to persist.
        Throws:
        IOException - if an error occurs while performing the operation.
        InterruptedException - if any thread has interrupted the current thread.
      • isCategoryEnabled

        protected boolean isCategoryEnabled​(@NonNull
                                            jenkins.scm.api.SCMHeadCategory category)
        Enable specific SCMHeadCategory categories.

        TagSCMHeadCategory: Branches, Streams, Swarm and Graph ChangeRequestSCMHeadCategory: Swarm and Graph

        Overrides:
        isCategoryEnabled in class jenkins.scm.api.SCMSource
        Parameters:
        category - the Category
        Returns:
        true if the supplied category is enabled for this SCMSource instance.
      • getIncludePaths

        public List<String> getIncludePaths()
      • getRevision

        public P4SCMRevision getRevision​(TempClientHelper p4,
                                         P4SCMHead head)
                                  throws Exception
        Get the Latest change for the path specified in P4SCMHead.
        Parameters:
        p4 - TempClient instance
        head - SCMHead
        Returns:
        The latest change as a P4SCMRevision object
        Throws:
        Exception - pushed up stack
      • getRevision

        public P4SCMRevision getRevision​(net.sf.json.JSONObject payload)
        A specific revision based on the Event Payload.
        Parameters:
        payload - JSON payload from an external Event
        Returns:
        the change as a P4SCMRevision object or null if no match.
      • getScanner

        protected P4BranchScanner getScanner​(P4Ref ref)
        Scans for a Jenkinsfile given a submitted change.

        Looks a the first submitted file and walks up the path looking for a Jenkinsfile.

        Parameters:
        ref - A Perforce Change or Label
        Returns:
        Scanning results.
      • findInclude

        protected boolean findInclude​(String path)
      • getProperty

        protected String getProperty​(net.sf.json.JSONObject payload,
                                     ReviewProp property)