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 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(String description)
Sets repository description.
|
VcsRepositoryIdentifier |
getIdentifier()
Returns identifier for this object.
|
String |
getName()
Returns repository name, which serves as identifier for this object.
|
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(String name)
Sets the name by which repository will be identified by Bamboo.
|
T |
oid(BambooOid oid)
Sets the repository's oid.
|
T |
oid(String oid)
Sets the repository's oid from string.
|
T |
parent(String parent)
Sets the parent of this repository should inherit data from.
|
T |
repositoryViewer(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 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.
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.
PropertiesValidationException
public T name(@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.
PropertiesValidationException
parent(String)
public T oid(@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.
PropertiesValidationException
public T oid(@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.
PropertiesValidationException
public T parent(@Nullable String parent) throws PropertiesValidationException
PropertiesValidationException
public T description(@Nullable String description) throws PropertiesValidationException
The description must not be set if repository inherits from another repository.
PropertiesValidationException
public T repositoryViewer(@Nullable VcsRepositoryViewer repositoryViewer) throws PropertiesValidationException
Web repository viewer allows Bamboo to render correct links to commits, files, etc. in the Bamboo UI.
PropertiesValidationException
VcsRepositoryViewer
@NotNull public String getName()
IllegalStateException
- if name is undefined@NotNull public BambooOid getOid()
IllegalStateException
- if oid is undefined@NotNull public VcsRepositoryIdentifier getIdentifier()
IllegalStateException
- if key is undefinedpublic String humanReadableType()
RootEntityPropertiesBuilder
humanReadableType
in class RootEntityPropertiesBuilder<E extends VcsRepositoryProperties>
public String humanReadableId()
RootEntityPropertiesBuilder
humanReadableId
in class RootEntityPropertiesBuilder<E extends VcsRepositoryProperties>
protected abstract E build() throws PropertiesValidationException
build
in class EntityPropertiesBuilder<E extends VcsRepositoryProperties>
PropertiesValidationException
Copyright © 2020 Atlassian Software Systems Pty Ltd. All rights reserved.