Package org.jenkinsci.plugins.p4.tasks
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 Summary
ConstructorsConstructorDescriptionCheckoutTask(String credential, Run<?, ?> run, TaskListener listener, Populate populate) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckRoles(org.jenkinsci.remoting.RoleChecker checker) getChangesFull(List<P4Ref> lastRefs) longvoidInvoke sync on build node (controller or remote node).Resolve workspace-defined poll paths to their latest P4 changes.voidsetBuildChange(P4Ref parentChange) voidsetIncrementalChanges(List<P4Ref> changes) task(ClientHelper p4) Implements the P4 task to retry if necessaryMethods inherited from class org.jenkinsci.plugins.p4.tasks.AbstractTask
checkConnection, getClientName, getCredential, getListener, getSyncID, getWorkspace, setEnvironment, setup, setWorkspace, tryTask
-
Constructor Details
-
CheckoutTask
Constructor- Parameters:
credential- Credential IDrun- Jenkins Runlistener- TaskListenerpopulate- Populate options
-
-
Method Details
-
initialise
- Throws:
AbortException
-
invoke
Invoke sync on build node (controller or remote node).- Specified by:
invokein interfaceFilePath.FileCallable<Boolean>- Returns:
- true if updated, false if no change.
- Throws:
IOException
-
task
Description copied from class:AbstractTaskImplements the P4 task to retry if necessary- Specified by:
taskin classAbstractTask- Parameters:
p4- P4 connection helper- Returns:
- Task object
- Throws:
Exception- push up stack
-
getChangesFull
-
getCurrentChange
-
getStatus
-
getSyncChange
-
getBuildChange
-
setBuildChange
-
setIncrementalChanges
-
getReview
public long getReview() -
checkRoles
- Specified by:
checkRolesin interfaceorg.jenkinsci.remoting.RoleSensitive- Throws:
SecurityException
-
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 toMAX_PATHS_TO_CHECKpoll paths, queries P4 for the latest changelist for each poll path usingConnectionHelper.getLatestChangeForPollPath(P4PollRef). - Returns a list of non-nullP4Refobjects (one per path with a found change) in the same order the paths were specified.- Returns:
- list of latest per-path
P4PollRefresults (empty if none) - Throws:
RuntimeException- if an error occurs while querying P4 (current behavior)
-