Class VcsRepository<T extends VcsRepository<T,​E>,​E extends VcsRepositoryProperties>

    • Constructor Detail

      • VcsRepository

        public VcsRepository()
                      throws PropertiesValidationException
        Specifies a new repository definition.

        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.

        Throws:
        PropertiesValidationException
    • Method Detail

      • name

        public T name​(@Nullable
                      @Nullable java.lang.String name)
               throws PropertiesValidationException
        Sets the name by which repository will be identified by Bamboo. In the absence of oid, the name is used to identify the repository. If the repository with given name does not exist, a new one is created, otherwise existing one is updated.

        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.

        Throws:
        PropertiesValidationException
        See Also:
        parent(String)
      • oid

        public T oid​(@Nullable
                     @Nullable java.lang.String oid)
              throws PropertiesValidationException
        Sets the repository's oid from string.

        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.

        Throws:
        PropertiesValidationException
      • oid

        public T oid​(@Nullable
                     @Nullable BambooOid oid)
              throws PropertiesValidationException
        Sets the repository's oid.

        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.

        Throws:
        PropertiesValidationException
      • parent

        public T parent​(@Nullable
                        @Nullable java.lang.String parent)
                 throws PropertiesValidationException
        Sets the parent of this repository should inherit data from. When defining repository for a plan user can decide to inherit its data from an existing global repository instead of creating it from scratch. In that case, any change to parent's repository configuration will automatically be applied to all its children, unless a respective data has been overridden.
        Throws:
        PropertiesValidationException
      • project

        public T project​(@Nullable
                         @Nullable Project project)
        Set the repository's project. Available for Bamboo DC only.

        If set, it is Project repository, otherwise it is Global or plan repository.

        Since:
        8.0
      • getName

        @NotNull
        public @NotNull java.lang.String getName()
        Returns repository name, which serves as identifier for this object.
        Throws:
        java.lang.IllegalStateException - if name is undefined
      • getOid

        @NotNull
        public @NotNull BambooOid getOid()
        Returns repository's oid.
        Throws:
        java.lang.IllegalStateException - if oid is undefined
      • getIdentifier

        @NotNull
        public @NotNull VcsRepositoryIdentifier getIdentifier()
        Returns identifier for this object.
        Throws:
        java.lang.IllegalStateException - if key is undefined