Interface Repository

All Superinterfaces:
Labelable, Watchable

public interface Repository extends Labelable, Watchable
Describes a repository within the system.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static enum 
    Enumerates the possible states for a given repository.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The maximum number of characters of a repository's description
    static final int
    The maximum number of characters of a repository's name
    static final String
     
    static final int
     
    static final String
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Retrieves the repository's description.
    Retrieves the unique identifier for the hierarchy of forks to which this repository belongs.
    int
    Retrieves the repository's ID, which represents its primary key.
    Retrieves the repository's name, which is guaranteed to be unique within its project 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 the project to which this repository belongs.
    Retrieves the unique identifier for the SCM used by this repository.
    Retrieves the "slug" for this repository, which is a URL-friendly variant of its name.
    Retrieves the repository's current state.
    Retrieves the status message for the repository's current state.
    boolean
    Retrieves a flag indicating whether this repository is archived.
    boolean
    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
     
    boolean
    Returns whether the repository is offline.
    boolean
    Retrieves a flag indicating whether this repository is public.
    boolean
    Retrieves the read-only mode status for this repository.
    boolean
     

    Methods inherited from interface com.atlassian.bitbucket.label.Labelable

    accept

    Methods inherited from interface com.atlassian.bitbucket.watcher.Watchable

    accept
  • Field Details

  • 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

      @Nonnull String 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 its project but not within the system at large.
      Returns:
      the repository's name
    • getOrigin

      @Nullable Repository getOrigin()
      Retrieves the repository from which this repository was forked, if any. For top-level repositories, this value will be null.

      Note: Even when a repository's origin is null, it will still have a hierarchy 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 not remotely managed.
      Since:
      9.0
    • getProject

      @Nonnull Project getProject()
      Retrieves the project 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

      @Nonnull @RequiredString String getScmId()
      Retrieves the unique identifier for the SCM used by this repository.
      Returns:
      the unique identifier of the repository's SCM
      See Also:
    • getSlug

      @Nonnull @RequiredString(size=128, regexp="[\\p{Alnum}][\\w\\-\\.]*") String getSlug()
      Retrieves the "slug" for this repository, which is a URL-friendly variant of its name. Each repository's slug is guaranteed to be unique within its project, but not within the system at large.
      Returns:
      the repository's slug
    • getState

      @Nonnull Repository.State getState()
      Retrieves the repository's current state.
      Returns:
      the repository's state
    • getStatusMessage

      @Nonnull String getStatusMessage()
      Retrieves the status message for the repository's current state.
      Returns:
      the repository's status message
    • isFork

      boolean isFork()
      Retrieves a flag indicating whether this repository is a fork of another repository. When true, the repository will always have an origin.

      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. When true, 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 to isFork(). 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 is true) 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, otherwise true.
      Since:
      8.0
    • isOffline

      boolean isOffline()
      Returns whether the repository is offline. Only remote 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, otherwise false
      Since:
      8.0
    • isRemote

      boolean isRemote()
      Returns:
      true if the repository is managed by a remote Mesh node, otherwise false.
      Since:
      8.0