|
||||||||||
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 |
COMPLETE_PLUGIN_KEY
|
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_MAVEN_POM_CHECKOUT_POM_RELATIVE_PATH
|
static java.lang.String |
P4_PASSWD
|
static java.lang.String |
P4_PORT
|
static java.lang.String |
P4_USER
|
protected PerforceManager |
perforceManager
|
static java.lang.String |
TEMPORARY_P4_PASSWORD
|
Fields inherited from class com.atlassian.bamboo.repository.AbstractRepository |
---|
BUILD_TRIGGER_IP, buildDirectoryManager, buildLoggerManager, CLEAN_CHECKOUT_PARAM, CLEAN_WORKING_DIRECTORY_PARAM, repositoryModuleDescriptor, templateRenderer, textProvider, variableSubstitutionBean |
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 BuildConfigurationAwarePlugin.getEditHtml(com.atlassian.bamboo.ww2.actions.build.admin.create.BuildConfiguration, com.atlassian.bamboo.plan.Plan) |
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.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 |
MavenPomAccessor |
getMavenPomAccessor()
|
java.lang.String |
getMavenPomCheckoutPomRelativePath()
|
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 |
getUrl()
|
java.lang.String |
getUser()
What's the optional perforce user name? Returns null if we are not using a user |
int |
hashCode()
|
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 as the given repository |
void |
performPostConfiguration(BuildConfiguration buildConfiguration,
Plan plan)
Allows any other configuration to be performed after another repository has been created. |
void |
performPostConfigurationForSelectedRepository(BuildConfiguration buildConfiguration,
Plan plan)
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(BuildContext buildContext,
java.lang.String vcsRevisionKey)
Checkout the sourcecode as at the vcsRevisionKey, if revisionKey is null source will be checked out from head |
java.lang.String |
retrieveSourceCode(java.lang.String planKey,
java.lang.String vcsRevisionKey)
Checks out the latest source code to an appropriate repository |
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 |
setMavenPomCheckoutPomRelativePath(java.lang.String mavenPomCheckoutPomRelativePath)
|
void |
setMaxRetries(int maxRetries)
|
void |
setPerforceManager(PerforceManager perforceManager)
|
void |
setPlanManager(PlanManager planManager)
|
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 |
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, getLocationIdentifier, getMinimalEditHtml, getShortKey, 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, removeBuildRequirements |
Methods inherited from interface com.atlassian.bamboo.v2.build.BuildConfigurationAwarePlugin |
---|
getEditHtml, getViewHtml |
Methods inherited from interface com.atlassian.bamboo.utils.DescriptionProvider |
---|
getDescription |
Field Detail |
---|
public static final java.lang.String NAME
public static final java.lang.String KEY
public static final java.lang.String COMPLETE_PLUGIN_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 P4_MAVEN_POM_CHECKOUT_POM_RELATIVE_PATH
public static final java.lang.String TEMPORARY_P4_PASSWORD
public static final java.lang.String BAD_FORMAT
public static final java.lang.String P4_CAPABILITY_KEY
protected transient PerforceManager perforceManager
Constructor Detail |
---|
public PerforceRepository()
Method Detail |
---|
@NotNull public BuildChanges collectChangesSinceLastBuild(@NotNull java.lang.String planKey, @Nullable 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
RepositoryV2
retrieveSourceCode
in interface RepositoryV2
vcsRevisionKey
- - may be null if you want latest code
RepositoryException
@NotNull public java.lang.String retrieveSourceCode(@NotNull BuildContext buildContext, @Nullable java.lang.String vcsRevisionKey) throws RepositoryException
retrieveSourceCode
in interface RepositoryV2
buildContext
- - 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)
BuildConfigurationAwarePlugin
BuildConfiguration
object. The name of the properties match those passed
in through the form fragments in BuildConfigurationAwarePlugin.getEditHtml(com.atlassian.bamboo.ww2.actions.build.admin.create.BuildConfiguration, com.atlassian.bamboo.plan.Plan)
template.
validate
in interface BuildConfigurationAwarePlugin
validate
in class AbstractRepository
buildConfiguration
- - @NotNull
ErrorCollection
keyed by the field name. @NotNullpublic void performPostConfiguration(BuildConfiguration buildConfiguration, Plan plan)
PostConfigurableRepository
performPostConfiguration
in interface PostConfigurableRepository
public void performPostConfigurationForSelectedRepository(BuildConfiguration buildConfiguration, Plan plan)
PostConfigurableRepository
performPostConfigurationForSelectedRepository
in interface PostConfigurableRepository
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()
public java.lang.String getMavenPomCheckoutPomRelativePath()
public void setMavenPomCheckoutPomRelativePath(java.lang.String mavenPomCheckoutPomRelativePath)
@NotNull public java.lang.String getName()
getName
in interface Repository
getName
in interface DescriptionProvider
getName
in interface NameProvider
public 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 getHost()
getHost
in interface Repository
public boolean isRepositoryDifferent(@NotNull Repository repository)
RepositoryV2
isRepositoryDifferent
in interface RepositoryV2
repository
- to compare against
@NotNull public MavenPomAccessor getMavenPomAccessor()
getMavenPomAccessor
in interface MavenPomAccessorCapableRepository
@Deprecated public void getAllSourceCode(Build build) throws RepositoryException
build
-
RepositoryException
- Something went wrongpublic void addDefaultValues(@NotNull BuildConfiguration buildConfiguration)
BuildConfigurationAwarePlugin
BuildConfigurationAwarePlugin.getEditHtml(com.atlassian.bamboo.ww2.actions.build.admin.create.BuildConfiguration, com.atlassian.bamboo.plan.Plan)
addDefaultValues
in interface BuildConfigurationAwarePlugin
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)
BuildConfigurationAwarePlugin
prepareConfigObject
in interface BuildConfigurationAwarePlugin
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)
public void setPlanManager(PlanManager planManager)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |