Interface TreeApi
-
- All Known Subinterfaces:
HttpTreeApi
public interface TreeApi
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidassignBranch(@Valid @NotNull @Pattern(regexp="^[A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9._-])?$",message="Reference name must start with a letter, followed by letters, digits, a ./_- character, not end with a slash, not contain ..") String branchName, @Valid @NotNull @Pattern(regexp="^[0-9a-fA-F]{16,64}$",message="Hash must consist of the hex representation of 8-32 bytes") String oldHash, @Valid @NotNull Reference assignTo)Update a branch.voidassignTag(@Valid @NotNull @Pattern(regexp="^[A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9._-])?$",message="Reference name must start with a letter, followed by letters, digits, a ./_- character, not end with a slash, not contain ..") String tagName, @Valid @NotNull @Pattern(regexp="^[0-9a-fA-F]{16,64}$",message="Hash must consist of the hex representation of 8-32 bytes") String oldHash, @Valid @NotNull Reference assignTo)Update a tag.BranchcommitMultipleOperations(@Valid @NotNull @Pattern(regexp="^[A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9._-])?$",message="Reference name must start with a letter, followed by letters, digits, a ./_- character, not end with a slash, not contain ..") String branchName, @Valid @NotNull @Pattern(regexp="^[0-9a-fA-F]{16,64}$",message="Hash must consist of the hex representation of 8-32 bytes") String hash, @Valid @NotNull Operations operations)Commit multiple operations against the given branch expecting that branch to have the given hash as its latest commit.ReferencecreateReference(@Valid @Pattern(regexp="^[A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9._-])?$",message="Reference name must start with a letter, followed by letters, digits, a ./_- character, not end with a slash, not contain ..") String sourceRefName, @Valid @NotNull Reference reference)Create a new reference.voiddeleteBranch(@Valid @NotNull @Pattern(regexp="^[A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9._-])?$",message="Reference name must start with a letter, followed by letters, digits, a ./_- character, not end with a slash, not contain ..") String branchName, @Valid @NotNull @Pattern(regexp="^[0-9a-fA-F]{16,64}$",message="Hash must consist of the hex representation of 8-32 bytes") String hash)Delete a branch.voiddeleteTag(@Valid @NotNull @Pattern(regexp="^[A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9._-])?$",message="Reference name must start with a letter, followed by letters, digits, a ./_- character, not end with a slash, not contain ..") String tagName, @Valid @Pattern(regexp="^[0-9a-fA-F]{16,64}$",message="Hash must consist of the hex representation of 8-32 bytes") String hash)Delete a tag.List<Reference>getAllReferences()Get all references.LogResponsegetCommitLog(@Valid @NotNull @Pattern(regexp="^[A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9._-])?$",message="Reference name must start with a letter, followed by letters, digits, a ./_- character, not end with a slash, not contain ..") String ref, @Valid @NotNull CommitLogParams params)Retrieve the commit log for a ref, potentially truncated by the backend.BranchgetDefaultBranch()Get details for the default reference.EntriesResponsegetEntries(@Valid @NotNull @Pattern(regexp="^[A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9._-])?$",message="Reference name must start with a letter, followed by letters, digits, a ./_- character, not end with a slash, not contain ..") String refName, @Valid @NotNull EntriesParams params)Retrieve objects for a ref, potentially truncated by the backend.ReferencegetReferenceByName(@Valid @NotNull @Pattern(regexp="^(([0-9a-fA-F]{16,64})|([A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9._-])?))$",message="Reference must be either a reference name or hash, start with a letter, followed by letters, digits, a ./_- character, not end with a slash, not contain .. or consist of the hex representation of 8-32 bytes") String refName)Get details of a particular ref, if it exists.voidmergeRefIntoBranch(@Valid @NotNull @Pattern(regexp="^[A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9._-])?$",message="Reference name must start with a letter, followed by letters, digits, a ./_- character, not end with a slash, not contain ..") String branchName, @Valid @NotNull @Pattern(regexp="^[0-9a-fA-F]{16,64}$",message="Hash must consist of the hex representation of 8-32 bytes") String hash, @Valid @NotNull Merge merge)merge mergeRef onto ref.voidtransplantCommitsIntoBranch(@Valid @NotNull @Pattern(regexp="^[A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9._-])?$",message="Reference name must start with a letter, followed by letters, digits, a ./_- character, not end with a slash, not contain ..") String branchName, @Valid @NotNull @Pattern(regexp="^[0-9a-fA-F]{16,64}$",message="Hash must consist of the hex representation of 8-32 bytes") String hash, @Valid String message, @Valid Transplant transplant)cherry pick a set of commits into a branch.
-
-
-
Method Detail
-
getDefaultBranch
Branch getDefaultBranch() throws NessieNotFoundException
Get details for the default reference.- Throws:
NessieNotFoundException
-
createReference
Reference createReference(@Valid @Nullable @Pattern(regexp="^[A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9._-])?$",message="Reference name must start with a letter, followed by letters, digits, a ./_- character, not end with a slash, not contain ..") @Valid @Pattern(regexp="^[A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9._-])?$",message="Reference name must start with a letter, followed by letters, digits, a ./_- character, not end with a slash, not contain ..") String sourceRefName, @Valid @NotNull @Valid @NotNull Reference reference) throws NessieNotFoundException, NessieConflictException
Create 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".
-
getReferenceByName
Reference getReferenceByName(@Valid @NotNull @Pattern(regexp="^(([0-9a-fA-F]{16,64})|([A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9._-])?))$",message="Reference must be either a reference name or hash, start with a letter, followed by letters, digits, a ./_- character, not end with a slash, not contain .. or consist of the hex representation of 8-32 bytes") @Valid @NotNull @Pattern(regexp="^(([0-9a-fA-F]{16,64})|([A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9._-])?))$",message="Reference must be either a reference name or hash, start with a letter, followed by letters, digits, a ./_- character, not end with a slash, not contain .. or consist of the hex representation of 8-32 bytes") String refName) throws NessieNotFoundException
Get details of a particular ref, if it exists.- Throws:
NessieNotFoundException
-
getEntries
EntriesResponse getEntries(@Valid @NotNull @Pattern(regexp="^[A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9._-])?$",message="Reference name must start with a letter, followed by letters, digits, a ./_- character, not end with a slash, not contain ..") @Valid @NotNull @Pattern(regexp="^[A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9._-])?$",message="Reference name must start with a letter, followed by letters, digits, a ./_- character, not end with a slash, not contain ..") String refName, @Valid @NotNull @Valid @NotNull EntriesParams params) throws NessieNotFoundException
Retrieve 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.- Throws:
NessieNotFoundException
-
getCommitLog
LogResponse getCommitLog(@Valid @NotNull @Pattern(regexp="^[A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9._-])?$",message="Reference name must start with a letter, followed by letters, digits, a ./_- character, not end with a slash, not contain ..") @Valid @NotNull @Pattern(regexp="^[A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9._-])?$",message="Reference name must start with a letter, followed by letters, digits, a ./_- character, not end with a slash, not contain ..") String ref, @Valid @NotNull @Valid @NotNull CommitLogParams params) throws NessieNotFoundException
Retrieve 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.- Throws:
NessieNotFoundException
-
assignTag
void assignTag(@Valid @NotNull @Pattern(regexp="^[A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9._-])?$",message="Reference name must start with a letter, followed by letters, digits, a ./_- character, not end with a slash, not contain ..") @Valid @NotNull @Pattern(regexp="^[A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9._-])?$",message="Reference name must start with a letter, followed by letters, digits, a ./_- character, not end with a slash, not contain ..") String tagName, @Valid @NotNull @Pattern(regexp="^[0-9a-fA-F]{16,64}$",message="Hash must consist of the hex representation of 8-32 bytes") @Valid @NotNull @Pattern(regexp="^[0-9a-fA-F]{16,64}$",message="Hash must consist of the hex representation of 8-32 bytes") String oldHash, @Valid @NotNull @Valid @NotNull Reference assignTo) throws NessieNotFoundException, NessieConflictExceptionUpdate a tag.
-
deleteTag
void deleteTag(@Valid @NotNull @Pattern(regexp="^[A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9._-])?$",message="Reference name must start with a letter, followed by letters, digits, a ./_- character, not end with a slash, not contain ..") @Valid @NotNull @Pattern(regexp="^[A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9._-])?$",message="Reference name must start with a letter, followed by letters, digits, a ./_- character, not end with a slash, not contain ..") String tagName, @Valid @Pattern(regexp="^[0-9a-fA-F]{16,64}$",message="Hash must consist of the hex representation of 8-32 bytes") @Valid @Pattern(regexp="^[0-9a-fA-F]{16,64}$",message="Hash must consist of the hex representation of 8-32 bytes") String hash) throws NessieConflictException, NessieNotFoundExceptionDelete a tag.
-
assignBranch
void assignBranch(@Valid @NotNull @Pattern(regexp="^[A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9._-])?$",message="Reference name must start with a letter, followed by letters, digits, a ./_- character, not end with a slash, not contain ..") @Valid @NotNull @Pattern(regexp="^[A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9._-])?$",message="Reference name must start with a letter, followed by letters, digits, a ./_- character, not end with a slash, not contain ..") String branchName, @Valid @NotNull @Pattern(regexp="^[0-9a-fA-F]{16,64}$",message="Hash must consist of the hex representation of 8-32 bytes") @Valid @NotNull @Pattern(regexp="^[0-9a-fA-F]{16,64}$",message="Hash must consist of the hex representation of 8-32 bytes") String oldHash, @Valid @NotNull @Valid @NotNull Reference assignTo) throws NessieNotFoundException, NessieConflictExceptionUpdate a branch.
-
deleteBranch
void deleteBranch(@Valid @NotNull @Pattern(regexp="^[A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9._-])?$",message="Reference name must start with a letter, followed by letters, digits, a ./_- character, not end with a slash, not contain ..") @Valid @NotNull @Pattern(regexp="^[A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9._-])?$",message="Reference name must start with a letter, followed by letters, digits, a ./_- character, not end with a slash, not contain ..") String branchName, @Valid @NotNull @Pattern(regexp="^[0-9a-fA-F]{16,64}$",message="Hash must consist of the hex representation of 8-32 bytes") @Valid @NotNull @Pattern(regexp="^[0-9a-fA-F]{16,64}$",message="Hash must consist of the hex representation of 8-32 bytes") String hash) throws NessieConflictException, NessieNotFoundExceptionDelete a branch.
-
transplantCommitsIntoBranch
void transplantCommitsIntoBranch(@Valid @NotNull @Pattern(regexp="^[A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9._-])?$",message="Reference name must start with a letter, followed by letters, digits, a ./_- character, not end with a slash, not contain ..") @Valid @NotNull @Pattern(regexp="^[A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9._-])?$",message="Reference name must start with a letter, followed by letters, digits, a ./_- character, not end with a slash, not contain ..") String branchName, @Valid @NotNull @Pattern(regexp="^[0-9a-fA-F]{16,64}$",message="Hash must consist of the hex representation of 8-32 bytes") @Valid @NotNull @Pattern(regexp="^[0-9a-fA-F]{16,64}$",message="Hash must consist of the hex representation of 8-32 bytes") String hash, @Valid @Valid String message, @Valid @Valid Transplant transplant) throws NessieNotFoundException, NessieConflictExceptioncherry pick a set of commits into a branch.
-
mergeRefIntoBranch
void mergeRefIntoBranch(@Valid @NotNull @Pattern(regexp="^[A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9._-])?$",message="Reference name must start with a letter, followed by letters, digits, a ./_- character, not end with a slash, not contain ..") @Valid @NotNull @Pattern(regexp="^[A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9._-])?$",message="Reference name must start with a letter, followed by letters, digits, a ./_- character, not end with a slash, not contain ..") String branchName, @Valid @NotNull @Pattern(regexp="^[0-9a-fA-F]{16,64}$",message="Hash must consist of the hex representation of 8-32 bytes") @Valid @NotNull @Pattern(regexp="^[0-9a-fA-F]{16,64}$",message="Hash must consist of the hex representation of 8-32 bytes") String hash, @Valid @NotNull @Valid @NotNull Merge merge) throws NessieNotFoundException, NessieConflictExceptionmerge mergeRef onto ref.
-
commitMultipleOperations
Branch commitMultipleOperations(@Valid @NotNull @Pattern(regexp="^[A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9._-])?$",message="Reference name must start with a letter, followed by letters, digits, a ./_- character, not end with a slash, not contain ..") @Valid @NotNull @Pattern(regexp="^[A-Za-z](((?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9._-])?$",message="Reference name must start with a letter, followed by letters, digits, a ./_- character, not end with a slash, not contain ..") String branchName, @Valid @NotNull @Pattern(regexp="^[0-9a-fA-F]{16,64}$",message="Hash must consist of the hex representation of 8-32 bytes") @Valid @NotNull @Pattern(regexp="^[0-9a-fA-F]{16,64}$",message="Hash must consist of the hex representation of 8-32 bytes") String hash, @Valid @NotNull @Valid @NotNull Operations operations) throws NessieNotFoundException, NessieConflictException
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.- 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.
-
-