Interface HttpTreeApi

All Superinterfaces:
TreeApi

@Consumes("application/json") @Consumes("application/json") @Path("v1/trees") @Path("v1/trees") public interface HttpTreeApi extends TreeApi
  • Method Details

    • getAllReferences

      @GET @GET @Produces("application/json") @Produces("application/json") ReferencesResponse getAllReferences(@BeanParam @BeanParam ReferencesParams params)
      Description copied from interface: TreeApi
      Get all references.
      Specified by:
      getAllReferences in interface TreeApi
      Returns:
      A ReferencesResponse instance containing all references.
    • getDefaultBranch

      @GET @GET @Produces("application/json") @Produces("application/json") @Path("tree") @Path("tree") Branch getDefaultBranch() throws NessieNotFoundException
      Description copied from interface: TreeApi
      Get details for the default reference.
      Specified by:
      getDefaultBranch in interface TreeApi
      Throws:
      NessieNotFoundException
    • createReference

      @POST @POST @Produces("application/json") @Produces("application/json") @Path("tree") @Path("tree") Reference createReference(@QueryParam("sourceRefName") @QueryParam("sourceRefName") String sourceRefName, Reference reference) throws NessieNotFoundException, NessieConflictException
      Description copied from interface: TreeApi
      Create a new reference.

      The type of reference, which can be either a Branch or Tag, determines the type of the reference to be created.

      Reference.getName() defines the the name of the reference to be created, Reference.getHash() is the hash of the created reference, the HEAD of the created reference. sourceRefName is the name of the reference which contains Reference.getHash(), and must be present if Reference.getHash() is present.

      Specifying no Reference.getHash() means that the new reference will be created "at the beginning of time".

      Specified by:
      createReference in interface TreeApi
      Throws:
      NessieNotFoundException
      NessieConflictException
    • getReferenceByName

      @GET @GET @Produces("application/json") @Produces("application/json") @Path("tree/{ref}") @Path("tree/{ref}") Reference getReferenceByName(@BeanParam @BeanParam GetReferenceParams params) throws NessieNotFoundException
      Description copied from interface: TreeApi
      Get details of a particular ref, if it exists.
      Specified by:
      getReferenceByName in interface TreeApi
      Throws:
      NessieNotFoundException
    • getEntries

      @GET @GET @Produces("application/json") @Produces("application/json") @Path("tree/{ref}/entries") @Path("tree/{ref}/entries") EntriesResponse getEntries(@PathParam("ref") @PathParam("ref") String refName, @BeanParam @BeanParam EntriesParams params) throws NessieNotFoundException
      Description copied from interface: TreeApi
      Retrieve objects for a ref, potentially truncated by the backend.

      Retrieves up to maxRecords objects for the given named reference (tag or branch). The backend may respect the given max records hint, but return less or more entries. Backends may also cap the returned entries at a hard-coded limit, the default REST server implementation has such a hard-coded limit.

      Invoking getEntries() does not guarantee to return all commit log entries of a given reference, because the result can be truncated by the backend.

      To implement paging, check EntriesResponse.isHasMore() and, if true, pass the value of EntriesResponse.getToken() in the next invocation of getEntries() as the pageToken parameter.

      See org.projectnessie.client.StreamingUtil in nessie-client.

      Specified by:
      getEntries in interface TreeApi
      Throws:
      NessieNotFoundException
    • getCommitLog

      @GET @GET @Produces("application/json") @Produces("application/json") @Path("tree/{ref}/log") @Path("tree/{ref}/log") LogResponse getCommitLog(@PathParam("ref") @PathParam("ref") String ref, @BeanParam @BeanParam CommitLogParams params) throws NessieNotFoundException
      Description copied from interface: TreeApi
      Retrieve the commit log for a ref, potentially truncated by the backend.

      Retrieves up to maxRecords commit-log-entries starting at the HEAD of the given named reference (tag or branch). The backend may respect the given max records hint, but return less or more entries. Backends may also cap the returned entries at a hard-coded limit, the default REST server implementation has such a hard-coded limit.

      Invoking getCommitLog() does not guarantee to return all commit log entries of a given reference, because the result can be truncated by the backend.

      To implement paging, check LogResponse.isHasMore() and, if true, pass the value of LogResponse.getToken() in the next invocation of getCommitLog() as the pageToken parameter.

      See org.projectnessie.client.StreamingUtil in nessie-client.

      Specified by:
      getCommitLog in interface TreeApi
      Throws:
      NessieNotFoundException
    • assignReference

      @PUT @PUT @Path("{referenceType}/{referenceName}") @Path("{referenceType}/{referenceName}") void assignReference(@PathParam("referenceType") @PathParam("referenceType") Reference.ReferenceType referenceType, @PathParam("referenceName") @PathParam("referenceName") String referenceName, @QueryParam("expectedHash") @QueryParam("expectedHash") String expectedHash, Reference assignTo) throws NessieNotFoundException, NessieConflictException
      Description copied from interface: TreeApi
      Update a reference's HEAD to point to a different commit.
      Specified by:
      assignReference in interface TreeApi
      Throws:
      NessieNotFoundException
      NessieConflictException
    • deleteReference

      @DELETE @DELETE @Path("{referenceType}/{referenceName}") @Path("{referenceType}/{referenceName}") void deleteReference(@PathParam("referenceType") @PathParam("referenceType") Reference.ReferenceType referenceType, @PathParam("referenceName") @PathParam("referenceName") String referenceName, @QueryParam("expectedHash") @QueryParam("expectedHash") String expectedHash) throws NessieConflictException, NessieNotFoundException
      Description copied from interface: TreeApi
      Delete a named reference.
      Specified by:
      deleteReference in interface TreeApi
      Throws:
      NessieConflictException
      NessieNotFoundException
    • transplantCommitsIntoBranch

      @POST @POST @Produces("application/json") @Produces("application/json") @Path("branch/{branchName}/transplant") @Path("branch/{branchName}/transplant") MergeResponse transplantCommitsIntoBranch(@PathParam("branchName") @PathParam("branchName") String branchName, @QueryParam("expectedHash") @QueryParam("expectedHash") String expectedHash, @QueryParam("message") @QueryParam("message") String message, Transplant transplant) throws NessieNotFoundException, NessieConflictException
      Description copied from interface: TreeApi
      cherry pick a set of commits into a branch.
      Specified by:
      transplantCommitsIntoBranch in interface TreeApi
      Throws:
      NessieNotFoundException
      NessieConflictException
    • mergeRefIntoBranch

      @POST @POST @Produces("application/json") @Produces("application/json") @Path("branch/{branchName}/merge") @Path("branch/{branchName}/merge") MergeResponse mergeRefIntoBranch(@PathParam("branchName") @PathParam("branchName") String branchName, @QueryParam("expectedHash") @QueryParam("expectedHash") String expectedHash, Merge merge) throws NessieNotFoundException, NessieConflictException
      Description copied from interface: TreeApi
      merge mergeRef onto ref.
      Specified by:
      mergeRefIntoBranch in interface TreeApi
      Throws:
      NessieNotFoundException
      NessieConflictException
    • commitMultipleOperations

      @POST @POST @Path("branch/{branchName}/commit") @Path("branch/{branchName}/commit") @Produces("application/json") @Produces("application/json") @Consumes("application/json") @Consumes("application/json") Branch commitMultipleOperations(@PathParam("branchName") @PathParam("branchName") String branchName, @QueryParam("expectedHash") @QueryParam("expectedHash") String expectedHash, Operations operations) throws NessieNotFoundException, NessieConflictException
      Description copied from interface: TreeApi
      Commit multiple operations against the given branch expecting that branch to have the given hash as its latest commit. The hash in the successful response contains the hash of the commit that contains the operations of the invocation.
      Specified by:
      commitMultipleOperations in interface TreeApi
      Parameters:
      branchName - Branch to change, defaults to default branch.
      expectedHash - Expected hash of branch.
      operations - Operations to apply
      Returns:
      updated Branch objects with the hash of the new HEAD
      Throws:
      NessieNotFoundException - if branchName could not be found
      NessieConflictException - if the operations could not be applied to some conflict, which is either caused by a conflicting commit or concurrent commits.