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
public ChangeInserter setTopic(String topic)
-
setCherryPickOf
public ChangeInserter setCherryPickOf(PatchSet.Id cherryPickOf)
-
setMessage
public ChangeInserter setMessage(String message)
-
setPatchSetDescription
public ChangeInserter setPatchSetDescription(String patchSetDescription)
-
setValidate
public ChangeInserter setValidate(boolean validate)
-
setReviewersAndCcs
public ChangeInserter setReviewersAndCcs(Iterable<Account.Id> reviewers, Iterable<Account.Id> ccs)
-
setReviewersAndCcsAsStrings
public ChangeInserter setReviewersAndCcsAsStrings(Iterable<String> reviewers, Iterable<String> ccs)
-
setPrivate
public ChangeInserter setPrivate(boolean isPrivate)
-
setWorkInProgress
public ChangeInserter setWorkInProgress(boolean workInProgress)
-
setStatus
public ChangeInserter setStatus(Change.Status status)
-
setGroups
public ChangeInserter setGroups(List<String> groups)
-
setValidationOptions
public ChangeInserter setValidationOptions(com.google.common.collect.ImmutableListMultimap<String,String> validationOptions)
-
setFireRevisionCreated
public ChangeInserter setFireRevisionCreated(boolean fireRevisionCreated)
-
setSendMail
public ChangeInserter setSendMail(boolean sendMail)
-
setRequestScopePropagator
public ChangeInserter setRequestScopePropagator(RequestScopePropagator r)
-
setRevertOf
public ChangeInserter setRevertOf(Change.Id revertOf)
-
setPushCertificate
public void setPushCertificate(String cert)
-
getPatchSet
public PatchSet getPatchSet()
-
setApprovals
public ChangeInserter setApprovals(Map<String,Short> approvals)
-
setUpdateRef
@Deprecated 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
-
-