Interface HttpTreeApi
- All Superinterfaces:
TreeApi
-
Method Summary
Modifier and TypeMethodDescriptionvoidassignReference(Reference.ReferenceType referenceType, String referenceName, String expectedHash, Reference assignTo) Update a reference's HEAD to point to a different commit.commitMultipleOperations(String branchName, String expectedHash, Operations operations) Commit multiple operations against the given branch expecting that branch to have the given hash as its latest commit.createReference(String sourceRefName, Reference reference) Create a new reference.voiddeleteReference(Reference.ReferenceType referenceType, String referenceName, String expectedHash) Delete a named reference.getAllReferences(ReferencesParams params) Get all references.getCommitLog(String ref, CommitLogParams params) Retrieve the commit log for a ref, potentially truncated by the backend.Get details for the default reference.getEntries(String refName, EntriesParams params) Retrieve objects for a ref, potentially truncated by the backend.getReferenceByName(GetReferenceParams params) Get details of a particular ref, if it exists.mergeRefIntoBranch(String branchName, String expectedHash, Merge merge) merge mergeRef onto ref.transplantCommitsIntoBranch(String branchName, String expectedHash, String message, Transplant transplant) cherry pick a set of commits into a branch.
-
Method Details
-
getAllReferences
@GET @GET @Produces("application/json") @Produces("application/json") ReferencesResponse getAllReferences(@BeanParam @BeanParam ReferencesParams params) Description copied from interface:TreeApiGet all references.- Specified by:
getAllReferencesin interfaceTreeApi- Returns:
- A
ReferencesResponseinstance containing all references.
-
getDefaultBranch
@GET @GET @Produces("application/json") @Produces("application/json") @Path("tree") @Path("tree") Branch getDefaultBranch() throws NessieNotFoundExceptionDescription copied from interface:TreeApiGet details for the default reference.- Specified by:
getDefaultBranchin interfaceTreeApi- 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:TreeApiCreate a new reference.The type of
reference, which can be either aBranchorTag, 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.sourceRefNameis the name of the reference which containsReference.getHash(), and must be present ifReference.getHash()is present.Specifying no
Reference.getHash()means that the new reference will be created "at the beginning of time".- Specified by:
createReferencein interfaceTreeApi- Throws:
NessieNotFoundExceptionNessieConflictException
-
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:TreeApiGet details of a particular ref, if it exists.- Specified by:
getReferenceByNamein interfaceTreeApi- 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:TreeApiRetrieve objects for a ref, potentially truncated by the backend.Retrieves up to
maxRecordsobjects for the given named reference (tag or branch). The backend may respect the givenmaxrecords 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, iftrue, pass the value ofEntriesResponse.getToken()in the next invocation ofgetEntries()as thepageTokenparameter.See
org.projectnessie.client.StreamingUtilinnessie-client.- Specified by:
getEntriesin interfaceTreeApi- 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:TreeApiRetrieve the commit log for a ref, potentially truncated by the backend.Retrieves up to
maxRecordscommit-log-entries starting at the HEAD of the given named reference (tag or branch). The backend may respect the givenmaxrecords 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, iftrue, pass the value ofLogResponse.getToken()in the next invocation ofgetCommitLog()as thepageTokenparameter.See
org.projectnessie.client.StreamingUtilinnessie-client.- Specified by:
getCommitLogin interfaceTreeApi- 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:TreeApiUpdate a reference's HEAD to point to a different commit.- Specified by:
assignReferencein interfaceTreeApi- Throws:
NessieNotFoundExceptionNessieConflictException
-
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:TreeApiDelete a named reference.- Specified by:
deleteReferencein interfaceTreeApi- Throws:
NessieConflictExceptionNessieNotFoundException
-
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:TreeApicherry pick a set of commits into a branch.- Specified by:
transplantCommitsIntoBranchin interfaceTreeApi- Throws:
NessieNotFoundExceptionNessieConflictException
-
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:TreeApimerge mergeRef onto ref.- Specified by:
mergeRefIntoBranchin interfaceTreeApi- Throws:
NessieNotFoundExceptionNessieConflictException
-
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:TreeApiCommit 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:
commitMultipleOperationsin interfaceTreeApi- Parameters:
branchName- Branch to change, defaults to default branch.expectedHash- Expected hash of branch.operations-Operationsto apply- Returns:
- updated
Branchobjects with the hash of the new HEAD - Throws:
NessieNotFoundException- ifbranchNamecould not be foundNessieConflictException- if the operations could not be applied to some conflict, which is either caused by a conflicting commit or concurrent commits.
-