hudson.plugins.perforce
Class PerforceSCM

java.lang.Object
  extended by hudson.scm.SCM
      extended by hudson.plugins.perforce.PerforceSCM
All Implemented Interfaces:
hudson.ExtensionPoint, hudson.model.Describable<hudson.scm.SCM>

public class PerforceSCM
extends hudson.scm.SCM

Extends SCM to provide integration with Perforce SCM repositories.

Author:
Mike Wille, Brian Westrich

Nested Class Summary
static class PerforceSCM.PerforceSCMDescriptor
           
 
Field Summary
static PerforceSCM.PerforceSCMDescriptor DESCRIPTOR
           
 
Constructor Summary
PerforceSCM(java.lang.String p4User, java.lang.String p4Pass, java.lang.String p4Client, java.lang.String p4Port, java.lang.String projectPath, java.lang.String p4Exe, java.lang.String p4SysRoot, java.lang.String p4SysDrive, boolean forceSync, boolean updateView, int firstChange, PerforceRepositoryBrowser browser)
           
 
Method Summary
 boolean checkout(hudson.model.AbstractBuild build, hudson.Launcher launcher, hudson.FilePath workspace, hudson.model.BuildListener listener, java.io.File changelogFile)
           
 hudson.scm.ChangeLogParser createChangeLogParser()
           
 PerforceRepositoryBrowser getBrowser()
           
 hudson.scm.SCMDescriptor<?> getDescriptor()
           
 java.lang.String getFirstChange()
          This is only for the config screen.
 int getLastChange(hudson.model.Run build)
           
 java.lang.String getP4Client()
           
 java.lang.String getP4Exe()
           
 java.lang.String getP4Passwd()
           
 java.lang.String getP4Port()
           
 java.lang.String getP4SysDrive()
           
 java.lang.String getP4SysRoot()
           
 java.lang.String getP4User()
           
 java.lang.String getProjectPath()
           
 boolean isForceSync()
           
 boolean isUpdateView()
           
 boolean pollChanges(hudson.model.AbstractProject project, hudson.Launcher launcher, hudson.FilePath workspace, hudson.model.TaskListener listener)
           
 void setForceSync(boolean force)
           
 void setP4Client(java.lang.String client)
           
 void setP4Exe(java.lang.String exe)
           
 void setP4Passwd(java.lang.String passwd)
           
 void setP4Port(java.lang.String port)
           
 void setP4SysDrive(java.lang.String sysDrive)
           
 void setP4SysRoot(java.lang.String sysRoot)
           
 void setP4User(java.lang.String user)
           
 void setProjectPath(java.lang.String projectPath)
           
 void setUpdateView(boolean update)
           
 
Methods inherited from class hudson.scm.SCM
buildEnvVars, createEmptyChangeLog, getEffectiveBrowser, getModuleRoot, getModuleRoots, nullify, supportsPolling
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DESCRIPTOR

public static final PerforceSCM.PerforceSCMDescriptor DESCRIPTOR
Constructor Detail

PerforceSCM

public PerforceSCM(java.lang.String p4User,
                   java.lang.String p4Pass,
                   java.lang.String p4Client,
                   java.lang.String p4Port,
                   java.lang.String projectPath,
                   java.lang.String p4Exe,
                   java.lang.String p4SysRoot,
                   java.lang.String p4SysDrive,
                   boolean forceSync,
                   boolean updateView,
                   int firstChange,
                   PerforceRepositoryBrowser browser)
Method Detail

checkout

public boolean checkout(hudson.model.AbstractBuild build,
                        hudson.Launcher launcher,
                        hudson.FilePath workspace,
                        hudson.model.BuildListener listener,
                        java.io.File changelogFile)
                 throws java.io.IOException,
                        java.lang.InterruptedException
Specified by:
checkout in class hudson.scm.SCM
Throws:
java.io.IOException
java.lang.InterruptedException

getBrowser

public PerforceRepositoryBrowser getBrowser()
Overrides:
getBrowser in class hudson.scm.SCM

createChangeLogParser

public hudson.scm.ChangeLogParser createChangeLogParser()
Specified by:
createChangeLogParser in class hudson.scm.SCM

getDescriptor

public hudson.scm.SCMDescriptor<?> getDescriptor()
Specified by:
getDescriptor in interface hudson.model.Describable<hudson.scm.SCM>
Overrides:
getDescriptor in class hudson.scm.SCM

pollChanges

public boolean pollChanges(hudson.model.AbstractProject project,
                           hudson.Launcher launcher,
                           hudson.FilePath workspace,
                           hudson.model.TaskListener listener)
                    throws java.io.IOException,
                           java.lang.InterruptedException
Specified by:
pollChanges in class hudson.scm.SCM
Throws:
java.io.IOException
java.lang.InterruptedException

getLastChange

public int getLastChange(hudson.model.Run build)

getProjectPath

public java.lang.String getProjectPath()
Returns:
the projectPath

setProjectPath

public void setProjectPath(java.lang.String projectPath)
Parameters:
projectPath - the projectPath to set

getP4User

public java.lang.String getP4User()
Returns:
the p4User

setP4User

public void setP4User(java.lang.String user)
Parameters:
user - the p4User to set

getP4Passwd

public java.lang.String getP4Passwd()
Returns:
the p4Passwd

setP4Passwd

public void setP4Passwd(java.lang.String passwd)
Parameters:
passwd - the p4Passwd to set

getP4Port

public java.lang.String getP4Port()
Returns:
the p4Port

setP4Port

public void setP4Port(java.lang.String port)
Parameters:
port - the p4Port to set

getP4Client

public java.lang.String getP4Client()
Returns:
the p4Client

setP4Client

public void setP4Client(java.lang.String client)
Parameters:
client - the p4Client to set

getP4SysDrive

public java.lang.String getP4SysDrive()
Returns:
the p4SysDrive

setP4SysDrive

public void setP4SysDrive(java.lang.String sysDrive)
Parameters:
sysDrive - the p4SysDrive to set

getP4SysRoot

public java.lang.String getP4SysRoot()
Returns:
the p4SysRoot

setP4SysRoot

public void setP4SysRoot(java.lang.String sysRoot)
Parameters:
sysRoot - the p4SysRoot to set

getP4Exe

public java.lang.String getP4Exe()
Returns:
the p4Exe

setP4Exe

public void setP4Exe(java.lang.String exe)
Parameters:
exe - the p4Exe to set

setUpdateView

public void setUpdateView(boolean update)
Parameters:
update - True to let the plugin manage the view, false to let the user manage it

isUpdateView

public boolean isUpdateView()
Returns:
True if the plugin manages the view, false if the user does.

isForceSync

public boolean isForceSync()
Returns:
True if we are performing a one-time force sync

setForceSync

public void setForceSync(boolean force)
Parameters:
force - True to perform a one time force sync, false to perform normal sync

getFirstChange

public java.lang.String getFirstChange()
This is only for the config screen. Also, it returns a string and not an int. This is because we want to show an empty value in the config option if it is not being used. The default value of -1 is not exactly empty. So if we are set to default of -1, we return an empty string. Anything else and we return the actual change number.

Returns:
The one time use variable, firstChange.


Copyright © 2007. All Rights Reserved.