Package com.google.gerrit.server.change
Class ChangeInserter
- java.lang.Object
-
- com.google.gerrit.server.change.ChangeInserter
-
- All Implemented Interfaces:
BatchUpdateOp
,InsertChangeOp
,RepoOnlyOp
public class ChangeInserter extends Object implements InsertChangeOp
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
ChangeInserter.Factory
-
Method Summary
-
-
-
Method Detail
-
createChange
public Change createChange(Context ctx) throws IOException
- Specified by:
createChange
in interfaceInsertChangeOp
- Throws:
IOException
-
getPatchSetId
public PatchSet.Id getPatchSetId()
-
getCommitId
public org.eclipse.jgit.lib.ObjectId getCommitId()
-
getChange
public Change getChange()
-
setTopic
@CanIgnoreReturnValue public ChangeInserter setTopic(String topic)
-
setCherryPickOf
@CanIgnoreReturnValue public ChangeInserter setCherryPickOf(PatchSet.Id cherryPickOf)
-
setMessage
@CanIgnoreReturnValue public ChangeInserter setMessage(String message)
-
setPatchSetDescription
@CanIgnoreReturnValue public ChangeInserter setPatchSetDescription(String patchSetDescription)
-
setValidate
@CanIgnoreReturnValue public ChangeInserter setValidate(boolean validate)
-
setReviewersAndCcs
@CanIgnoreReturnValue public ChangeInserter setReviewersAndCcs(Iterable<Account.Id> reviewers, Iterable<Account.Id> ccs)
-
setReviewersAndCcsIgnoreVisibility
@CanIgnoreReturnValue public ChangeInserter setReviewersAndCcsIgnoreVisibility(Iterable<Account.Id> reviewers, Iterable<Account.Id> ccs)
-
setReviewersAndCcsAsStrings
@CanIgnoreReturnValue public ChangeInserter setReviewersAndCcsAsStrings(Iterable<String> reviewers, Iterable<String> ccs)
-
setPrivate
@CanIgnoreReturnValue public ChangeInserter setPrivate(boolean isPrivate)
-
setWorkInProgress
@CanIgnoreReturnValue public ChangeInserter setWorkInProgress(boolean workInProgress)
-
setStatus
@CanIgnoreReturnValue public ChangeInserter setStatus(Change.Status status)
-
setGroups
@CanIgnoreReturnValue public ChangeInserter setGroups(List<String> groups)
-
setValidationOptions
@CanIgnoreReturnValue public ChangeInserter setValidationOptions(com.google.common.collect.ImmutableListMultimap<String,String> validationOptions)
-
setFireRevisionCreated
@CanIgnoreReturnValue public ChangeInserter setFireRevisionCreated(boolean fireRevisionCreated)
-
setSendMail
@CanIgnoreReturnValue public ChangeInserter setSendMail(boolean sendMail)
-
setRequestScopePropagator
@CanIgnoreReturnValue public ChangeInserter setRequestScopePropagator(RequestScopePropagator r)
-
setRevertOf
@CanIgnoreReturnValue public ChangeInserter setRevertOf(Change.Id revertOf)
-
setPushCertificate
public void setPushCertificate(String cert)
-
getPatchSet
public PatchSet getPatchSet()
-
setApprovals
@CanIgnoreReturnValue public ChangeInserter setApprovals(Map<String,Short> approvals)
-
setUpdateRef
@Deprecated @CanIgnoreReturnValue public ChangeInserter setUpdateRef(boolean updateRef)
Deprecated.Set whether to include the new patch set ref update in this update.If false, the caller is responsible for creating the patch set ref before executing the containing
BatchUpdate
.Should not be used in new code, as it doesn't result in a single atomic batch ref update for code and NoteDb meta refs.
- Parameters:
updateRef
- whether to update the ref duringupdateRepo(RepoContext)
.
-
getChangeMessage
public String getChangeMessage()
-
getCommand
public org.eclipse.jgit.transport.ReceiveCommand getCommand()
-
updateRepo
public void updateRepo(RepoContext ctx) throws ResourceConflictException, IOException
Description copied from interface:RepoOnlyOp
Override this method to update the repo.- Specified by:
updateRepo
in interfaceRepoOnlyOp
- Parameters:
ctx
- context- Throws:
ResourceConflictException
IOException
-
updateChange
public boolean updateChange(ChangeContext ctx) throws RestApiException, IOException, PermissionBackendException, org.eclipse.jgit.errors.ConfigInvalidException
Description copied from interface:BatchUpdateOp
Override this method to modify a change.- Specified by:
updateChange
in interfaceBatchUpdateOp
- Parameters:
ctx
- context- Returns:
- whether anything was changed that might require a write to the metadata storage.
- Throws:
RestApiException
IOException
PermissionBackendException
org.eclipse.jgit.errors.ConfigInvalidException
-
postUpdate
public void postUpdate(PostUpdateContext ctx) throws Exception
Description copied from interface:RepoOnlyOp
Override this method to do something after the update e.g. send email or run hooks- Specified by:
postUpdate
in interfaceRepoOnlyOp
- Parameters:
ctx
- context- Throws:
Exception
-
-