public class ChangeEditUtil
extends java.lang.Object
This class contains methods to retrieve, publish and delete edits. For changing edits see
ChangeEditModifier
.
Modifier and Type | Method and Description |
---|---|
java.util.Optional<ChangeEdit> |
byChange(ChangeNotes notes)
Retrieve edit for a given change.
|
java.util.Optional<ChangeEdit> |
byChange(ChangeNotes notes,
CurrentUser user)
Retrieve edit for a change and the given user.
|
void |
delete(ChangeEdit edit)
Delete change edit.
|
void |
publish(BatchUpdate.Factory updateFactory,
ChangeNotes notes,
CurrentUser user,
ChangeEdit edit,
NotifyHandling notify,
com.google.common.collect.ListMultimap<RecipientType,Account.Id> accountsToNotify)
Promote change edit to patch set, by squashing the edit into its parent.
|
public java.util.Optional<ChangeEdit> byChange(ChangeNotes notes) throws AuthException, java.io.IOException
At most one change edit can exist per user and change.
notes
- change notes of change to retrieve change edits for.AuthException
- if this is not a logged-in user.java.io.IOException
- if an error occurs.public java.util.Optional<ChangeEdit> byChange(ChangeNotes notes, CurrentUser user) throws AuthException, java.io.IOException
At most one change edit can exist per user and change.
notes
- change notes of change to retrieve change edits for.user
- user to retrieve edits as.AuthException
- if this is not a logged-in user.java.io.IOException
- if an error occurs.public void publish(BatchUpdate.Factory updateFactory, ChangeNotes notes, CurrentUser user, ChangeEdit edit, NotifyHandling notify, com.google.common.collect.ListMultimap<RecipientType,Account.Id> accountsToNotify) throws java.io.IOException, com.google.gwtorm.server.OrmException, RestApiException, UpdateException
updateFactory
- factory for creating updates.notes
- the ChangeNotes
of the change to which the change edit belongsuser
- the current useredit
- change edit to publishnotify
- Notify handling that defines to whom email notifications should be sent after the
change edit is published.accountsToNotify
- Accounts that should be notified after the change edit is published.java.io.IOException
com.google.gwtorm.server.OrmException
UpdateException
RestApiException
public void delete(ChangeEdit edit) throws java.io.IOException, com.google.gwtorm.server.OrmException
edit
- change edit to deletejava.io.IOException
com.google.gwtorm.server.OrmException