Class CheckoutTask

java.lang.Object
org.jenkinsci.plugins.p4.tasks.AbstractTask
org.jenkinsci.plugins.p4.tasks.CheckoutTask
All Implemented Interfaces:
FilePath.FileCallable<Boolean>, Serializable, org.jenkinsci.remoting.RoleSensitive

public class CheckoutTask extends AbstractTask implements FilePath.FileCallable<Boolean>, Serializable
See Also:
  • Constructor Details

    • CheckoutTask

      public CheckoutTask(String credential, Run<?,?> run, TaskListener listener, Populate populate)
      Constructor
      Parameters:
      credential - Credential ID
      run - Jenkins Run
      listener - TaskListener
      populate - Populate options
  • Method Details

    • initialise

      public void initialise() throws AbortException
      Throws:
      AbortException
    • invoke

      public Boolean invoke(File workspace, hudson.remoting.VirtualChannel channel) throws IOException
      Invoke sync on build node (controller or remote node).
      Specified by:
      invoke in interface FilePath.FileCallable<Boolean>
      Returns:
      true if updated, false if no change.
      Throws:
      IOException
    • task

      public Object task(ClientHelper p4) throws Exception
      Description copied from class: AbstractTask
      Implements the P4 task to retry if necessary
      Specified by:
      task in class AbstractTask
      Parameters:
      p4 - P4 connection helper
      Returns:
      Task object
      Throws:
      Exception - push up stack
    • getChangesFull

      public List<P4ChangeEntry> getChangesFull(List<P4Ref> lastRefs)
    • getCurrentChange

      public P4ChangeEntry getCurrentChange()
    • getStatus

      public CheckoutStatus getStatus()
    • getSyncChange

      public List<P4Ref> getSyncChange()
    • getBuildChange

      public P4Ref getBuildChange()
    • setBuildChange

      public void setBuildChange(P4Ref parentChange)
    • setIncrementalChanges

      public void setIncrementalChanges(List<P4Ref> changes)
    • getReview

      public long getReview()
    • checkRoles

      public void checkRoles(org.jenkinsci.remoting.RoleChecker checker) throws SecurityException
      Specified by:
      checkRoles in interface org.jenkinsci.remoting.RoleSensitive
      Throws:
      SecurityException
    • resolvePollPathsToLatestChanges

      public List<P4PollRef> resolvePollPathsToLatestChanges()
      Resolve workspace-defined poll paths to their latest P4 changes.

      This method: - Only runs when the configured workspace is a ManualWorkspaceImpl. - Reads the comma-separated poll paths from the workspace spec, trims entries and ignores empty values. - For up to MAX_PATHS_TO_CHECK poll paths, queries P4 for the latest changelist for each poll path using ConnectionHelper.getLatestChangeForPollPath(P4PollRef). - Returns a list of non-null P4Ref objects (one per path with a found change) in the same order the paths were specified.

      Returns:
      list of latest per-path P4PollRef results (empty if none)
      Throws:
      RuntimeException - if an error occurs while querying P4 (current behavior)