Interface HttpTreeApi
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidassignReference(Reference.ReferenceType referenceType, String referenceName, String oldHash, Reference assignTo)Update a reference's HEAD to point to a different commit.BranchcommitMultipleOperations(String branchName, String hash, Operations operations)Commit multiple operations against the given branch expecting that branch to have the given hash as its latest commit.ReferencecreateReference(String sourceRefName, Reference reference)Create a new reference.voiddeleteReference(Reference.ReferenceType referenceType, String referenceName, String hash)Delete a named reference.ReferencesResponsegetAllReferences(ReferencesParams params)Get all references.LogResponsegetCommitLog(String ref, CommitLogParams params)Retrieve the commit log for a ref, potentially truncated by the backend.BranchgetDefaultBranch()Get details for the default reference.EntriesResponsegetEntries(String refName, EntriesParams params)Retrieve objects for a ref, potentially truncated by the backend.ReferencegetReferenceByName(GetReferenceParams params)Get details of a particular ref, if it exists.voidmergeRefIntoBranch(String branchName, String hash, Merge merge)merge mergeRef onto ref.voidtransplantCommitsIntoBranch(String branchName, String hash, String message, Transplant transplant)cherry pick a set of commits into a branch.
-
-
-
Method Detail
-
getAllReferences
@GET @Produces("application/json") ReferencesResponse getAllReferences(@BeanParam ReferencesParams params)Description copied from interface:TreeApiGet all references.- Specified by:
getAllReferencesin interfaceTreeApi- Returns:
- A
ReferencesResponseinstance containing all references.
-
getDefaultBranch
@GET @Produces("application/json") @Path("tree") Branch getDefaultBranch() throws NessieNotFoundExceptionDescription copied from interface:TreeApiGet details for the default reference.- Specified by:
getDefaultBranchin interfaceTreeApi- Throws:
NessieNotFoundException
-
createReference
@POST @Produces("application/json") @Path("tree") Reference createReference(@QueryParam("sourceRefName") String sourceRefName, Reference reference) throws NessieNotFoundException, NessieConflictExceptionDescription 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 @Produces("application/json") @Path("tree/{ref}") Reference getReferenceByName(@BeanParam GetReferenceParams params) throws NessieNotFoundExceptionDescription copied from interface:TreeApiGet details of a particular ref, if it exists.- Specified by:
getReferenceByNamein interfaceTreeApi- Throws:
NessieNotFoundException
-
getEntries
@GET @Produces("application/json") @Path("tree/{ref}/entries") EntriesResponse getEntries(@PathParam("ref") String refName, @BeanParam EntriesParams params) throws NessieNotFoundExceptionDescription 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 @Produces("application/json") @Path("tree/{ref}/log") LogResponse getCommitLog(@PathParam("ref") String ref, @BeanParam CommitLogParams params) throws NessieNotFoundExceptionDescription 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 @Path("{referenceType}/{referenceName}") void assignReference(@PathParam("referenceType") Reference.ReferenceType referenceType, @PathParam("referenceName") String referenceName, @QueryParam("expectedHash") String oldHash, Reference assignTo) throws NessieNotFoundException, NessieConflictExceptionDescription copied from interface:TreeApiUpdate a reference's HEAD to point to a different commit.- Specified by:
assignReferencein interfaceTreeApi- Throws:
NessieNotFoundExceptionNessieConflictException
-
deleteReference
@DELETE @Path("{referenceType}/{referenceName}") void deleteReference(@PathParam("referenceType") Reference.ReferenceType referenceType, @PathParam("referenceName") String referenceName, @QueryParam("expectedHash") String hash) throws NessieConflictException, NessieNotFoundExceptionDescription copied from interface:TreeApiDelete a named reference.- Specified by:
deleteReferencein interfaceTreeApi- Throws:
NessieConflictExceptionNessieNotFoundException
-
transplantCommitsIntoBranch
@POST @Path("branch/{branchName}/transplant") void transplantCommitsIntoBranch(@PathParam("branchName") String branchName, @QueryParam("expectedHash") String hash, @QueryParam("message") String message, Transplant transplant) throws NessieNotFoundException, NessieConflictExceptionDescription copied from interface:TreeApicherry pick a set of commits into a branch.- Specified by:
transplantCommitsIntoBranchin interfaceTreeApi- Throws:
NessieNotFoundExceptionNessieConflictException
-
mergeRefIntoBranch
@POST @Path("branch/{branchName}/merge") void mergeRefIntoBranch(@PathParam("branchName") String branchName, @QueryParam("expectedHash") String hash, Merge merge) throws NessieNotFoundException, NessieConflictExceptionDescription copied from interface:TreeApimerge mergeRef onto ref.- Specified by:
mergeRefIntoBranchin interfaceTreeApi- Throws:
NessieNotFoundExceptionNessieConflictException
-
commitMultipleOperations
@POST @Path("branch/{branchName}/commit") @Produces("application/json") @Consumes("application/json") Branch commitMultipleOperations(@PathParam("branchName") String branchName, @QueryParam("expectedHash") String hash, Operations operations) throws NessieNotFoundException, NessieConflictExceptionDescription 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.hash- 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.
-
-