Package com.google.gerrit.server.change
Class PatchSetInserter
- java.lang.Object
-
- com.google.gerrit.server.change.PatchSetInserter
-
- All Implemented Interfaces:
BatchUpdateOp
,RepoOnlyOp
public class PatchSetInserter extends Object implements BatchUpdateOp
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
PatchSetInserter.Factory
-
Constructor Summary
Constructors Constructor Description PatchSetInserter(PermissionBackend permissionBackend, ApprovalsUtil approvalsUtil, ChangeMessagesUtil cmUtil, PatchSetInfoFactory patchSetInfoFactory, CommitValidators.Factory commitValidatorsFactory, ReplacePatchSetSender.Factory replacePatchSetFactory, PatchSetUtil psUtil, RevisionCreated revisionCreated, ProjectCache projectCache, ChangeNotes notes, PatchSet.Id psId, org.eclipse.jgit.lib.ObjectId commitId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Change
getChange()
PatchSet
getPatchSet()
PatchSet.Id
getPatchSetId()
void
postUpdate(Context ctx)
Override this method to do something after the update e.g.PatchSetInserter
setAllowClosed(boolean allowClosed)
PatchSetInserter
setCheckAddPatchSetPermission(boolean checkAddPatchSetPermission)
PatchSetInserter
setDescription(String description)
PatchSetInserter
setFireRevisionCreated(boolean fireRevisionCreated)
PatchSetInserter
setGroups(List<String> groups)
PatchSetInserter
setMessage(String message)
PatchSetInserter
setSendEmail(boolean sendEmail)
PatchSetInserter
setValidate(boolean validate)
boolean
updateChange(ChangeContext ctx)
Override this method to modify a change.void
updateRepo(RepoContext ctx)
Override this method to update the repo.
-
-
-
Constructor Detail
-
PatchSetInserter
@Inject public PatchSetInserter(PermissionBackend permissionBackend, ApprovalsUtil approvalsUtil, ChangeMessagesUtil cmUtil, PatchSetInfoFactory patchSetInfoFactory, CommitValidators.Factory commitValidatorsFactory, ReplacePatchSetSender.Factory replacePatchSetFactory, PatchSetUtil psUtil, RevisionCreated revisionCreated, ProjectCache projectCache, ChangeNotes notes, PatchSet.Id psId, org.eclipse.jgit.lib.ObjectId commitId)
-
-
Method Detail
-
getPatchSetId
public PatchSet.Id getPatchSetId()
-
setMessage
public PatchSetInserter setMessage(String message)
-
setDescription
public PatchSetInserter setDescription(String description)
-
setValidate
public PatchSetInserter setValidate(boolean validate)
-
setCheckAddPatchSetPermission
public PatchSetInserter setCheckAddPatchSetPermission(boolean checkAddPatchSetPermission)
-
setGroups
public PatchSetInserter setGroups(List<String> groups)
-
setFireRevisionCreated
public PatchSetInserter setFireRevisionCreated(boolean fireRevisionCreated)
-
setAllowClosed
public PatchSetInserter setAllowClosed(boolean allowClosed)
-
setSendEmail
public PatchSetInserter setSendEmail(boolean sendEmail)
-
getChange
public Change getChange()
-
getPatchSet
public PatchSet getPatchSet()
-
updateRepo
public void updateRepo(RepoContext ctx) throws AuthException, ResourceConflictException, IOException, PermissionBackendException
Description copied from interface:RepoOnlyOp
Override this method to update the repo.- Specified by:
updateRepo
in interfaceRepoOnlyOp
- Parameters:
ctx
- context- Throws:
AuthException
ResourceConflictException
IOException
PermissionBackendException
-
updateChange
public boolean updateChange(ChangeContext ctx) throws ResourceConflictException, IOException
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:
ResourceConflictException
IOException
-
postUpdate
public void postUpdate(Context ctx)
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
-
-