Package org.jenkinsci.plugins.p4.tasks
Class AbstractTask
- java.lang.Object
-
- org.jenkinsci.plugins.p4.tasks.AbstractTask
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
CheckoutTask,P4GroovyTask,PollTask,PublishTask,RemoveClientTask,TaggingTask,UnshelveTask,WhereTask
public abstract class AbstractTask extends Object implements Serializable
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractTask(String credential, Item project, TaskListener listener)AbstractTask(String credential, Run run, TaskListener listener)AbstractTask(String credential, TaskListener listener)Deprecated.AbstractTask(P4BaseCredentials credential, TaskListener listener)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected booleancheckConnection(ClientHelper p4)StringgetClientName()P4BaseCredentialsgetCredential()TaskListenergetListener()StringgetSyncID()protected WorkspacegetWorkspace()WorkspacesetEnvironment(Run<?,?> run, Workspace wsType, FilePath buildWorkspace)static Workspacesetup(Run<?,?> run, Workspace wsType, FilePath buildWorkspace, TaskListener listener)voidsetWorkspace(Workspace workspace)Set the workspace used for the task.abstract Objecttask(ClientHelper p4)Implements the Perforce task to retry if necessaryprotected ObjecttryTask()
-
-
-
Constructor Detail
-
AbstractTask
@Deprecated public AbstractTask(String credential, TaskListener listener)
Deprecated.
-
AbstractTask
public AbstractTask(P4BaseCredentials credential, TaskListener listener)
-
AbstractTask
public AbstractTask(String credential, Item project, TaskListener listener)
-
AbstractTask
public AbstractTask(String credential, Run run, TaskListener listener)
-
-
Method Detail
-
setWorkspace
public void setWorkspace(Workspace workspace)
Set the workspace used for the task. Often AbstractTask#setEnvironment() is used to expand the variables in the workspace before set- Parameters:
workspace- Perforce Workspace type
-
task
public abstract Object task(ClientHelper p4) throws Exception
Implements the Perforce task to retry if necessary- Parameters:
p4- Perforce connection helper- Returns:
- Task object
- Throws:
Exception- push up stack
-
getCredential
public P4BaseCredentials getCredential() throws P4InvalidCredentialException
- Throws:
P4InvalidCredentialException
-
getListener
public TaskListener getListener()
-
setEnvironment
public Workspace setEnvironment(Run<?,?> run, Workspace wsType, FilePath buildWorkspace) throws IOException, InterruptedException
- Throws:
IOExceptionInterruptedException
-
setup
public static Workspace setup(Run<?,?> run, Workspace wsType, FilePath buildWorkspace, TaskListener listener) throws IOException, InterruptedException
- Throws:
IOExceptionInterruptedException
-
getClientName
public String getClientName()
-
getSyncID
public String getSyncID()
-
getWorkspace
protected Workspace getWorkspace()
-
checkConnection
protected boolean checkConnection(ClientHelper p4)
-
tryTask
protected Object tryTask() throws AbortException
- Throws:
AbortException
-
-