|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.bamboo.repository.AbstractRepository com.atlassian.bamboo.repository.perforce.PerforceRepository
public class PerforceRepository
This class provides a Perforce implemention of the Repository
interface.
Field Summary | |
---|---|
static java.lang.String |
BAD_FORMAT
|
static java.lang.String |
KEY
|
static java.lang.String |
NAME
|
static java.lang.String |
P4_CAPABILITY_KEY
|
static java.lang.String |
P4_CLIENT
|
static java.lang.String |
P4_DEPOT
|
static java.lang.String |
P4_MANAGE
|
static java.lang.String |
P4_PASSWD
|
static java.lang.String |
P4_PORT
|
static java.lang.String |
P4_USER
|
Fields inherited from class com.atlassian.bamboo.repository.AbstractRepository |
---|
BUILD_TRIGGER_IP, buildDirectoryManager, buildLoggerManager, CLEAN_CHECKOUT_PARAM, repositoryModuleDescriptor, templateRenderer, textProvider, variableSubstitutionBean, WEB_REPO_MODULE_NAME, WEB_REPO_URL |
Fields inherited from interface com.atlassian.bamboo.repository.Repository |
---|
SELECTED_REPOSITORY, UNKNOWN_HOST |
Fields inherited from interface com.atlassian.bamboo.repository.IncludeExcludeAwareRepository |
---|
FILTER_PATTERN_EXCLUDE, FILTER_PATTERN_INCLUDE, FILTER_PATTERN_OPTION, FILTER_PATTERN_REGEX |
Constructor Summary | |
---|---|
PerforceRepository()
|
Method Summary | |
---|---|
void |
addDefaultValues(BuildConfiguration buildConfiguration)
Extension point for adding default values to the form for #getEditHtml() |
BuildChanges |
collectChangesSinceLastBuild(java.lang.String planKey,
java.lang.String lastVcsRevisionKey)
Access the perforce repository to retrieve change logs since the lastVCSRevisionKey |
int |
compareTo(java.lang.Object obj)
|
boolean |
equals(java.lang.Object o)
|
void |
getAllSourceCode(Build build)
Deprecated. |
java.util.Collection<ChangeLogEntry> |
getChangesSinceLastBuild(Build build,
java.util.Date lastBuildStartTime)
Deprecated. |
java.lang.String |
getClient()
Obtain the perforce client we're using |
java.lang.String |
getDepot()
What's the build depot that we're checking for changes? |
java.lang.String |
getEncryptedPassword()
Whats the encryted password for the user |
java.lang.String |
getHost()
Retrieves the address of the Perforce Server |
int |
getMaxRetries()
Returns the maximum number of times to collect changes |
java.lang.String |
getName()
Return the name of the repository |
java.lang.String |
getP4Executable()
Which perforce p4 exe are we using? |
com.tek42.perforce.Depot |
getPerforceDepot()
Retrieves an instance of a Perforce Depot populated with the builds information |
java.lang.String |
getPort()
Which perforce server are we using? |
int |
getQuietPeriod()
Returns the number of seconds to wait between each retry |
java.io.File |
getSourceCodeDirectory(java.lang.String planKey)
Retrieves the location that the build will occur, If the workspace is managed this includes the source code directory specified by bamboo followed by the directory structure as indicated in the client view. |
java.lang.String |
getSubstitutedClient()
|
java.lang.String |
getSubstitutedDepot()
|
java.lang.String |
getSubstitutedPort()
|
java.lang.String |
getSubstitutedUser()
|
java.lang.String |
getSubstitutedWebRepositoryUrl()
Return web repository URL with extrapolated Bamboo variables |
java.lang.String |
getUrl()
|
java.lang.String |
getUser()
What's the optional perforce user name? Returns null if we are not using a user |
java.lang.String |
getWebRepositoryUrl()
What's the repository's web url |
java.lang.String |
getWebRepositoryUrlForDiff(CommitFile file)
|
java.lang.String |
getWebRepositoryUrlForFile(CommitFile file)
What's the URL to the repostory for the modified file? |
java.lang.String |
getWebRepositoryUrlForRevision(CommitFile file)
|
java.lang.String |
getWebRepositoryUrlRepoName()
What's the repository's web url repository |
int |
hashCode()
|
boolean |
hasWebBasedRepositoryAccess()
Does this recpository provdide a web url intereface? |
boolean |
isManageWorkspace()
|
boolean |
isPerforceExecutableSet()
For configuration screens |
boolean |
isQuietPeriodEnabled()
Returns true if we were to enable the quiet period |
boolean |
isRepositoryDifferent(Repository repository)
Checks if the current repo is the same or not and sets the referencesDifferentRepository flag accordingly |
void |
performPostConfiguration(BuildConfiguration buildConfiguration,
Build build)
Allows any other configuration to be performed after another repository has been created. |
void |
performPostConfigurationForSelectedRepository(BuildConfiguration buildConfiguration,
Build build)
Allows any other configuration to be performed after this repository has been created |
void |
populateFromConfig(org.apache.commons.configuration.HierarchicalConfiguration config)
Update the current object with data in the HierarchicalConfiguration |
void |
prepareConfigObject(BuildConfiguration buildConfiguration)
Do any preprocessing work before validation occurs |
java.lang.String |
retrieveSourceCode(java.lang.String planKey,
java.lang.String vcsRevisionKey)
Checkout the sourcecode as at the vcsRevisionKey, if revisionKey is null source will be checked out from head |
void |
setCapabilityContext(CapabilityContext capabilityContext)
|
void |
setClient(java.lang.String client)
Define the client we're using to connect to the perforce server |
void |
setDepot(java.lang.String depot)
Define the build depot |
void |
setEncryptedPassword(java.lang.String encryptedPassword)
Set the password for the user. |
void |
setManageWorkspace(boolean manageWorkspace)
|
void |
setMaxRetries(int maxRetries)
|
protected void |
setP4Executable(java.lang.String p4Exe)
Set the user specify which p4 executable we're using Should only be used for test purposes |
void |
setPerforceManager(PerforceManager perforceManager)
|
void |
setPort(java.lang.String port)
Define the perforce server and port we're going to connect to |
void |
setQuietPeriod(int quietPeriod)
|
void |
setQuietPeriodEnabled(boolean quietPeriodEnabled)
|
void |
setUser(java.lang.String user)
Override the default user, if you want to specify the perforce user |
void |
setWebRepositoryUrl(java.lang.String myWebUrl)
Where should we link to to show build file changes? |
void |
setWebRepositoryUrlRepoName(java.lang.String myWebModule)
This is used to identify the repository on multi-repository configurations. |
void |
setWorkingDir(java.io.File workingDir)
Ignore in as perforce will determine the working directory based on the client information |
org.apache.commons.configuration.HierarchicalConfiguration |
toConfiguration()
Generate a HierarchicalConfiguration from the current state of the object |
ErrorCollection |
validate(BuildConfiguration buildConfiguration)
Validates the properties in the BuildConfiguration object. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.atlassian.bamboo.repository.Repository |
---|
checkConnection, getKey, getTriggerIpAddress, setReferencesDifferentRepository |
Methods inherited from interface com.atlassian.bamboo.v2.build.repository.RepositoryV2 |
---|
referencesDifferentRepository |
Methods inherited from interface com.atlassian.bamboo.v2.build.ConfigurablePlugin |
---|
customizeBuildRequirements, getEditHtml, getViewHtml, init |
Methods inherited from interface com.atlassian.bamboo.repository.WebRepositoryEnabledRepository |
---|
getWebRepositoryUrlForCommit |
Field Detail |
---|
public static final java.lang.String NAME
public static final java.lang.String KEY
public static final java.lang.String P4_PORT
public static final java.lang.String P4_CLIENT
public static final java.lang.String P4_DEPOT
public static final java.lang.String P4_USER
public static final java.lang.String P4_PASSWD
public static final java.lang.String P4_MANAGE
public static final java.lang.String BAD_FORMAT
public static final java.lang.String P4_CAPABILITY_KEY
Constructor Detail |
---|
public PerforceRepository()
Method Detail |
---|
@NotNull public BuildChanges collectChangesSinceLastBuild(@NotNull java.lang.String planKey, @NotNull java.lang.String lastVcsRevisionKey) throws RepositoryException
collectChangesSinceLastBuild
in interface RepositoryV2
planKey
- lastVcsRevisionKey
- - the revision number for the last build
RepositoryException
- If perforce fails to collect the changes@NotNull public java.lang.String retrieveSourceCode(@NotNull java.lang.String planKey, @Nullable java.lang.String vcsRevisionKey) throws RepositoryException
retrieveSourceCode
in interface RepositoryV2
planKey
- - for the build being checked outvcsRevisionKey
- - the revision to checkout the source from
RepositoryException
- if Perforce fails to@NotNull public com.tek42.perforce.Depot getPerforceDepot()
@Nullable public java.lang.String getP4Executable()
@NotNull public ErrorCollection validate(@NotNull BuildConfiguration buildConfiguration)
ConfigurablePlugin
BuildConfiguration
object. The name of the properties match those passed
in through the form fragments in #getEditHtml()
template.
validate
in interface ConfigurablePlugin
validate
in class AbstractRepository
buildConfiguration
- - @NotNull
ErrorCollection
keyed by the field name. @NotNullpublic void performPostConfiguration(BuildConfiguration buildConfiguration, Build build)
PostConfigurableRepository
performPostConfiguration
in interface PostConfigurableRepository
public void performPostConfigurationForSelectedRepository(BuildConfiguration buildConfiguration, Build build)
PostConfigurableRepository
performPostConfigurationForSelectedRepository
in interface PostConfigurableRepository
protected void setP4Executable(java.lang.String p4Exe)
p4Exe
- The locataion of the perforce p4 app (eg /usr/local/bin)public java.lang.String getClient()
public java.lang.String getSubstitutedClient()
public void setClient(java.lang.String client)
client
- The clientpublic java.lang.String getPort()
public java.lang.String getSubstitutedPort()
public void setPort(java.lang.String port)
port
- The perforce server and portpublic java.lang.String getDepot()
public java.lang.String getSubstitutedDepot()
public void setDepot(java.lang.String depot)
depot
- The depotpublic void setUser(java.lang.String user)
user
- The perforce userpublic java.lang.String getUser()
public java.lang.String getSubstitutedUser()
public boolean isManageWorkspace()
public void setManageWorkspace(boolean manageWorkspace)
public void setEncryptedPassword(java.lang.String encryptedPassword)
encryptedPassword
- public java.lang.String getEncryptedPassword()
@NotNull public java.lang.String getName()
getName
in interface Repository
public java.lang.String getWebRepositoryUrlRepoName()
WebRepositoryEnabledRepository
getWebRepositoryUrlRepoName
in interface WebRepositoryEnabledRepository
public void setWebRepositoryUrlRepoName(java.lang.String myWebModule)
WebRepositoryEnabledRepository
setWebRepositoryUrlRepoName
in interface WebRepositoryEnabledRepository
myWebModule
- The name of the repository we are viewingpublic java.lang.String getWebRepositoryUrl()
WebRepositoryEnabledRepository
getWebRepositoryUrl
in interface WebRepositoryEnabledRepository
public java.lang.String getSubstitutedWebRepositoryUrl()
public boolean hasWebBasedRepositoryAccess()
WebRepositoryEnabledRepository
hasWebBasedRepositoryAccess
in interface WebRepositoryEnabledRepository
public void setWebRepositoryUrl(java.lang.String myWebUrl)
WebRepositoryEnabledRepository
setWebRepositoryUrl
in interface WebRepositoryEnabledRepository
myWebUrl
- The url of the repositories web interfacepublic java.lang.String getUrl()
public void setWorkingDir(java.io.File workingDir)
setWorkingDir
in class AbstractRepository
workingDir
- ignored@NotNull public java.io.File getSourceCodeDirectory(@NotNull java.lang.String planKey) throws RepositoryException
getSourceCodeDirectory
in interface RepositoryV2
getSourceCodeDirectory
in class AbstractRepository
planKey
-
RepositoryException
- if it can not connect to perforce, could not find appropriate directory or
the depot string is incorrect.public java.lang.String getWebRepositoryUrlForFile(CommitFile file)
WebRepositoryEnabledRepository
getWebRepositoryUrlForFile
in interface WebRepositoryEnabledRepository
file
- The file that has been modified
public java.lang.String getWebRepositoryUrlForDiff(CommitFile file)
public java.lang.String getWebRepositoryUrlForRevision(CommitFile file)
public java.lang.String getHost()
getHost
in interface Repository
public boolean isRepositoryDifferent(@NotNull Repository repository)
Repository
isRepositoryDifferent
in interface Repository
@Deprecated public void getAllSourceCode(Build build) throws RepositoryException
build
-
RepositoryException
- Something went wrong@Deprecated public java.util.Collection<ChangeLogEntry> getChangesSinceLastBuild(Build build, java.util.Date lastBuildStartTime) throws RepositoryException
build
- lastBuildStartTime
- the date we are checking from
ChangeLogEntry
objects.
RepositoryException
- A generic failurepublic void addDefaultValues(@NotNull BuildConfiguration buildConfiguration)
ConfigurablePlugin
#getEditHtml()
addDefaultValues
in interface ConfigurablePlugin
addDefaultValues
in class AbstractRepository
buildConfiguration
- - @NotNullpublic void populateFromConfig(@NotNull org.apache.commons.configuration.HierarchicalConfiguration config)
ConvertibleFromConfig
HierarchicalConfiguration
populateFromConfig
in interface ConvertibleFromConfig
populateFromConfig
in class AbstractRepository
@NotNull public org.apache.commons.configuration.HierarchicalConfiguration toConfiguration()
ConvertibleFromConfig
HierarchicalConfiguration
from the current state of the object
toConfiguration
in interface ConvertibleFromConfig
toConfiguration
in class AbstractRepository
HierarchicalConfiguration
. Never nullpublic int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int compareTo(java.lang.Object obj)
public void prepareConfigObject(@NotNull BuildConfiguration buildConfiguration)
ConfigurablePlugin
prepareConfigObject
in interface ConfigurablePlugin
buildConfiguration
- - @NotNullpublic boolean isPerforceExecutableSet()
public boolean isQuietPeriodEnabled()
QuietPeriodAwareRepository
isQuietPeriodEnabled
in interface QuietPeriodAwareRepository
public void setQuietPeriodEnabled(boolean quietPeriodEnabled)
setQuietPeriodEnabled
in interface MutableQuietPeriodAwareRepository
public int getQuietPeriod()
QuietPeriodAwareRepository
getQuietPeriod
in interface QuietPeriodAwareRepository
public void setQuietPeriod(int quietPeriod)
setQuietPeriod
in interface MutableQuietPeriodAwareRepository
public int getMaxRetries()
QuietPeriodAwareRepository
getMaxRetries
in interface QuietPeriodAwareRepository
public void setMaxRetries(int maxRetries)
setMaxRetries
in interface MutableQuietPeriodAwareRepository
public void setPerforceManager(PerforceManager perforceManager)
public void setCapabilityContext(CapabilityContext capabilityContext)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |