public abstract class VcsRepository<T extends VcsRepository<T,E>,E extends VcsRepositoryProperties> extends RootEntityPropertiesBuilder<E>
This class contains common data only. In order to define a specific type of repository one should use the specialised
implementation or, if such is not available, AnyVcsRepository class.
| Modifier and Type | Field and Description |
|---|---|
protected String |
description |
protected String |
name |
protected BambooOidProperties |
oid |
protected String |
parent |
protected ProjectProperties |
project |
protected VcsRepositoryViewerProperties |
repositoryViewer |
static String |
TYPE |
| Constructor and Description |
|---|
VcsRepository()
Specifies a new repository definition.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract E |
build() |
T |
description(@Nullable String description)
Sets repository description.
|
@NotNull VcsRepositoryIdentifier |
getIdentifier()
Returns identifier for this object.
|
@NotNull String |
getName()
Returns repository name, which serves as identifier for this object.
|
@NotNull BambooOid |
getOid()
Returns repository's oid.
|
String |
humanReadableId()
Entity type and id representation that is shown to human.
|
String |
humanReadableType()
Entity type that is shown to human.
|
T |
name(@Nullable String name)
Sets the name by which repository will be identified by Bamboo.
|
T |
oid(@Nullable BambooOid oid)
Sets the repository's oid.
|
T |
oid(@Nullable String oid)
Sets the repository's oid from string.
|
T |
parent(@Nullable String parent)
Sets the parent of this repository should inherit data from.
|
T |
project(@Nullable Project project)
Set the repository's project.
|
T |
repositoryViewer(@Nullable VcsRepositoryViewer repositoryViewer)
Sets a web repository viewer to be used with this repository.
|
public static final String TYPE
protected String parent
protected String name
protected BambooOidProperties oid
protected String description
protected ProjectProperties project
protected VcsRepositoryViewerProperties repositoryViewer
public VcsRepository()
throws PropertiesValidationException
A repository can be global, in which case any changes made to a repository are automatically applied to all plans or jobs that use that repository.
Also repository can be project, in which case it can be used only in plans from corresponding project.
Repository can also be defined in scope of a Plan, in which case it is only accessible in context of plan it is defined for.
PropertiesValidationExceptionpublic T name(@Nullable @Nullable String name) throws PropertiesValidationException
The name should be unique in scope a repository is defined in.
The name must not be set if repository inherits data from another repository.
PropertiesValidationExceptionparent(String)public T oid(@Nullable @Nullable String oid) throws PropertiesValidationException
If set, it is used to identify the repository. If the repository with given oid does not exist, a new one is created, otherwise existing one is updated. Setting both oid and name may result in existing repository being renamed.
PropertiesValidationExceptionpublic T oid(@Nullable @Nullable BambooOid oid) throws PropertiesValidationException
If set, it is used to identify the repository. If the repository with given oid does not exist, a new one is created, otherwise existing one is updated. Setting both oid and name may result in existing repository being renamed.
PropertiesValidationExceptionpublic T parent(@Nullable @Nullable String parent) throws PropertiesValidationException
PropertiesValidationExceptionpublic T description(@Nullable @Nullable String description) throws PropertiesValidationException
The description must not be set if repository inherits from another repository.
PropertiesValidationExceptionpublic T repositoryViewer(@Nullable @Nullable VcsRepositoryViewer repositoryViewer) throws PropertiesValidationException
Web repository viewer allows Bamboo to render correct links to commits, files, etc. in the Bamboo UI.
PropertiesValidationExceptionVcsRepositoryViewerpublic T project(@Nullable @Nullable Project project)
If set, it is Project repository, otherwise it is Global or plan repository.
@NotNull public @NotNull String getName()
IllegalStateException - if name is undefined@NotNull public @NotNull BambooOid getOid()
IllegalStateException - if oid is undefined@NotNull public @NotNull VcsRepositoryIdentifier getIdentifier()
IllegalStateException - if key is undefinedpublic String humanReadableType()
RootEntityPropertiesBuilderhumanReadableType in class RootEntityPropertiesBuilder<E extends VcsRepositoryProperties>public String humanReadableId()
RootEntityPropertiesBuilderhumanReadableId in class RootEntityPropertiesBuilder<E extends VcsRepositoryProperties>protected abstract E build() throws PropertiesValidationException
build in class EntityPropertiesBuilder<E extends VcsRepositoryProperties>PropertiesValidationExceptionCopyright © 2023 Atlassian Software Systems Pty Ltd. All rights reserved.