@@ -893,13 +893,26 @@ public Repository createRepository(RepositoryMetadata repositoryMetadata) {
893893 * <li>The repository metadata should be associated to an already registered non-internal repository type and factory pair.</li>
894894 * </ul>
895895 *
896- * @param projectId the project that the repository is associated with. May be null if the repository is at cluster level
896+ * @param projectId the project that the repository is associated with
897897 * @param repositoryMetadata the repository metadata
898898 * @return the started repository
899899 * @throws RepositoryException if repository type is not registered
900900 */
901- public Repository createRepository (@ Nullable ProjectId projectId , RepositoryMetadata repositoryMetadata ) {
902- return createRepository (projectId , repositoryMetadata , typesRegistry , RepositoriesService ::throwRepositoryTypeDoesNotExists );
901+ public Repository createRepository (ProjectId projectId , RepositoryMetadata repositoryMetadata ) {
902+ return createRepository (
903+ Objects .requireNonNull (projectId ),
904+ repositoryMetadata ,
905+ typesRegistry ,
906+ RepositoriesService ::throwRepositoryTypeDoesNotExists
907+ );
908+ }
909+
910+ /**
911+ * Similar to {@link #createRepository(ProjectId, RepositoryMetadata)}, but repository is not associated with a project, i.e. the
912+ * repository is at the cluster level.
913+ */
914+ public Repository createNonProjectRepository (RepositoryMetadata repositoryMetadata ) {
915+ return createRepository (null , repositoryMetadata , typesRegistry , RepositoriesService ::throwRepositoryTypeDoesNotExists );
903916 }
904917
905918 private static Repository throwRepositoryTypeDoesNotExists (ProjectId projectId , RepositoryMetadata repositoryMetadata ) {
0 commit comments