Interface Repository
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
Enumerates the possible states for a givenrepository
. -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves the repository's description.Retrieves the unique identifier for the hierarchy of forks to which this repository belongs.int
getId()
Retrieves the repository's ID, which represents its primary key.getName()
Retrieves the repository's name, which is guaranteed to be unique within itsproject
but not within the system at large.Retrieves the repository from which this repository was forked, if any.int
Retrieves the partition for the repository.Retrieves theproject
to which this repository belongs.getScmId()
Retrieves the unique identifier for the SCM used by this repository.getSlug()
Retrieves the "slug" for this repository, which is a URL-friendly variant of itsname
.getState()
Retrieves the repository's currentstate
.Retrieves thestatus message
for the repository's currentstate
.boolean
Retrieves a flag indicating whether this repository is archived.boolean
isFork()
Retrieves a flag indicating whether this repository is a fork of another repository.boolean
Retrieves a flag indicating whether this repository may be forked.boolean
isLocal()
boolean
Returns whether the repository is offline.boolean
isPublic()
Retrieves a flag indicating whether this repository is public.boolean
Retrieves the read-only mode status for this repository.boolean
isRemote()
-
Field Details
-
MAX_DESCRIPTION_LENGTH
static final int MAX_DESCRIPTION_LENGTHThe maximum number of characters of a repository's description- See Also:
-
MAX_NAME_LENGTH
static final int MAX_NAME_LENGTHThe maximum number of characters of a repository's name- Since:
- 4.11
- See Also:
-
NAME_REGEXP
- See Also:
-
SLUG_MAX_SIZE
static final int SLUG_MAX_SIZE- Since:
- 4.10
- See Also:
-
SLUG_REGEXP
- See Also:
-
-
Method Details
-
getDescription
@Nullable @OptionalString(size=255, message="{com.atlassian.bitbucket.validation.repository.description.message}") String getDescription()Retrieves the repository's description.- Returns:
- the repository's description
- Since:
- 6.2
-
getHierarchyId
Retrieves the unique identifier for the hierarchy of forks to which this repository belongs. Every repository will be a member of a hierarchy, even if the hierarchy only contains that one repository. This allows logical grouping of repositories and their forks, regardless of how many layers of forks there may be.- Returns:
- this repository's hierarchy identifier
-
getId
int getId()Retrieves the repository's ID, which represents its primary key.- Returns:
- the repository's ID
-
getName
@Nonnull @RequiredString(size=128, regexp="[\\p{Alnum}][\\w\\-\\. ]*", message="{com.atlassian.bitbucket.validation.repository.name.pattern.message}") String getName()Retrieves the repository's name, which is guaranteed to be unique within itsproject
but not within the system at large.- Returns:
- the repository's name
-
getOrigin
Retrieves the repository from which this repository was forked, if any. For top-level repositories, this value will benull
.Note: Even when a repository's origin is
null
, it will still have ahierarchy ID
. If the repository is ever forked, its forks will inherit the same hierarchy ID.- Returns:
- the repository's origin, if it is a fork
-
getPartition
int getPartition()Retrieves the partition for the repository.- Returns:
- the partition under which the repository is stored.
-1
for repositories that are notremotely
managed. - Since:
- 9.0
-
getProject
Retrieves theproject
to which this repository belongs.Note: If this repository is a fork, it's
origin
repository may belong to a different project.- Returns:
- the project to which this repository belongs
-
getScmId
Retrieves the unique identifier for the SCM used by this repository.- Returns:
- the unique identifier of the repository's SCM
- See Also:
-
getSlug
Retrieves the "slug" for this repository, which is a URL-friendly variant of itsname
. Each repository's slug is guaranteed to be unique within itsproject
, but not within the system at large.- Returns:
- the repository's slug
-
getState
Retrieves the repository's currentstate
.- Returns:
- the repository's state
-
getStatusMessage
Retrieves thestatus message
for the repository's currentstate
.- Returns:
- the repository's status message
-
isFork
boolean isFork()Retrieves a flag indicating whether this repository is a fork of another repository. Whentrue
, the repository will always have anorigin
.Note: Even repositories that are not forks, and have not been used as the origin of a fork, still exist in a
hierarchy
; the hierarchy just consists of a single repository.- Returns:
true
if this repository is a fork; otherwise,false
-
isArchived
boolean isArchived()Retrieves a flag indicating whether this repository is archived. Whentrue
, the repository can be considered as inactive.Note: An archived/inactive repository is used to restrict access and remove clutter. It is a less destructive and less permanent alternative to deletion.
- Returns:
true
if this repository is archived; otherwise,false
- Since:
- 8.0
-
isForkable
boolean isForkable()Retrieves a flag indicating whether this repository may be forked. This flag is orthogonal toisFork()
. It is possible to create a fork from a fork, if the repository is configured so, just as it may not be possible to create forks from some top-level repositories.If
forking is disabled
at the system level, even repositories which are configured to allow forking (where this flag istrue
) may not be forked.- Returns:
true
if the repository may be forked- See Also:
-
isLocal
boolean isLocal()- Returns:
false
if the repository is managed by a remote Mesh node, otherwisetrue
.- Since:
- 8.0
-
isOffline
boolean isOffline()Returns whether the repository is offline. Onlyremote
repositories can be offline.- Returns:
true
if the repository is currently offline.- Since:
- 8.0
-
isPublic
boolean isPublic()Retrieves a flag indicating whether this repository is public.Note, this flag is taken into account when calculating whether this repository is accessible to unauthenticated users but is not the definitive answer. For a definitive answer, use
isPubliclyAccessible
.- Returns:
true
if the repository has been marked as public,false
otherwise
-
isReadOnly
boolean isReadOnly()Retrieves the read-only mode status for this repository.- Returns:
true
if the repository is in read-only mode, otherwisefalse
- Since:
- 8.0
-
isRemote
boolean isRemote()- Returns:
true
if the repository is managed by a remote Mesh node, otherwisefalse
.- Since:
- 8.0
-