Class RevisionsIndexApi

java.lang.Object
com.artipie.conan.RevisionsIndexApi

public final class RevisionsIndexApi extends Object
Conan V2 API - main revisions index APIs. Revisions index stored in revisions.txt file in json format. There are 2+ index files: recipe revisions and binary revisions (per package).
Since:
0.1
  • Constructor Details

    • RevisionsIndexApi

      public RevisionsIndexApi(Storage storage, Key pkgkey)
      Initializes new instance.
      Parameters:
      storage - Current Artipie storage instance.
      pkgkey - Package key for repository package data (full name).
  • Method Details

    • updateRecipeIndex

      public CompletionStage<List<Integer>> updateRecipeIndex()
      Updates recipe index file, non recursive, doesn't affect package binaries.
      Returns:
      CompletableFuture with recipe revisions list.
    • updateBinaryIndex

      public CompletionStage<List<Integer>> updateBinaryIndex(int reciperev, String hash)
      Updates binary index file.
      Parameters:
      reciperev - Recipe revision number.
      hash - Target package binary hash.
      Returns:
      CompletableFuture with recipe revisions list.
    • fullIndexUpdate

      public CompletionStage<Void> fullIndexUpdate()
      Updates binary index file. Fully recursive. Does updateRecipeIndex(), then for each revision invalid input: '&' for each pkg binary updateBinaryIndex().
      Returns:
      CompletionStage to handle operation completion.
    • addRecipeRevision

      public CompletionStage<Void> addRecipeRevision(int revision)
      Add new revision to the recipe index.
      Parameters:
      revision - Revision number.
      Returns:
      CompletionStage for this operation.
    • getRecipeRevisions

      public CompletionStage<List<Integer>> getRecipeRevisions()
      Returns list of revisions for the recipe.
      Returns:
      CompletionStage with the list.
    • removeRecipeRevision

      public CompletionStage<Boolean> removeRecipeRevision(int revision)
      Removes specified revision from index file of package recipe.
      Parameters:
      revision - Revision number.
      Returns:
      CompletionStage with boolean == true if recipe invalid input: '&' revision were found.
    • getLastRecipeRevision

      public CompletableFuture<Integer> getLastRecipeRevision()
      Returns last (max) recipe revision value.
      Returns:
      CompletableFuture with recipe revision as Integer.
    • getBinaryRevisions

      public CompletionStage<List<Integer>> getBinaryRevisions(int reciperev, String hash)
      Returns list of revisions for the package binary.
      Parameters:
      reciperev - Recipe revision number.
      hash - Target package binary hash.
      Returns:
      CompletionStage with the list.
    • getLastBinaryRevision

      public CompletableFuture<Integer> getLastBinaryRevision(int reciperev, String hash)
      Returns last (max) revision number for binary revision index.
      Parameters:
      reciperev - Recipe revision number.
      hash - Target package binary hash.
      Returns:
      CompletableFuture with recipe revision as Integer.
    • removeBinaryRevision

      public CompletionStage<Boolean> removeBinaryRevision(int reciperev, String hash, int revision)
      Removes specified revision from index file of package binary.
      Parameters:
      reciperev - Recipe revision number.
      hash - Target package binary hash.
      revision - Revision number of the binary.
      Returns:
      CompletionStage with boolean == true if recipe invalid input: '&' revision were found.
    • addBinaryRevision

      public CompletionStage<Void> addBinaryRevision(int reciperev, String hash, int revision)
      Add binary revision to the index.
      Parameters:
      reciperev - Recipe revision number.
      hash - Package binary hash.
      revision - Package binary revision.
      Returns:
      CompletionStage to handle operation completion.
    • getPackageList

      public CompletionStage<List<String>> getPackageList(int reciperev)
      Returns binary packages list (of hashes) for given recipe revision.
      Parameters:
      reciperev - Revision number of the recipe.
      Returns:
      CompletionStage with the list of package binaries (hashes) as strings.