public class GroupsUpdate
extends java.lang.Object
All calls which write group related details to the database are gathered here. Other classes
should always use this class instead of accessing the database directly. There are a few
exceptions though: schema classes, wrapper classes, and classes executed during init. The latter
ones should use GroupsOnInit
instead.
If not explicitly stated, all methods of this class refer to internal groups.
Modifier and Type | Class and Description |
---|---|
static interface |
GroupsUpdate.Factory |
Modifier and Type | Method and Description |
---|---|
InternalGroup |
createGroup(InternalGroupCreation groupCreation,
InternalGroupUpdate groupUpdate)
Creates the specified group for the specified members (accounts).
|
InternalGroup |
createGroupInNoteDb(InternalGroupCreation groupCreation,
InternalGroupUpdate groupUpdate) |
void |
updateGroup(AccountGroup.UUID groupUuid,
InternalGroupUpdate groupUpdate)
Updates the specified group.
|
com.google.gerrit.server.group.db.GroupsUpdate.UpdateResult |
updateGroupInNoteDb(AccountGroup.UUID groupUuid,
InternalGroupUpdate groupUpdate) |
public InternalGroup createGroup(InternalGroupCreation groupCreation, InternalGroupUpdate groupUpdate) throws com.google.gerrit.exceptions.DuplicateKeyException, java.io.IOException, org.eclipse.jgit.errors.ConfigInvalidException
groupCreation
- an InternalGroupCreation
which specifies all mandatory properties
of the groupgroupUpdate
- an InternalGroupUpdate
which specifies optional properties of the
group. If this InternalGroupUpdate
updates a property which was already specified
by the InternalGroupCreation
, the value of this InternalGroupUpdate
wins.InternalGroup
com.google.gerrit.exceptions.DuplicateKeyException
- if a group with the chosen name already existsjava.io.IOException
- if indexing fails, or an error occurs while reading/writing from/to NoteDborg.eclipse.jgit.errors.ConfigInvalidException
public void updateGroup(AccountGroup.UUID groupUuid, InternalGroupUpdate groupUpdate) throws com.google.gerrit.exceptions.DuplicateKeyException, java.io.IOException, com.google.gerrit.exceptions.NoSuchGroupException, org.eclipse.jgit.errors.ConfigInvalidException
groupUuid
- the UUID of the group to updategroupUpdate
- an InternalGroupUpdate
which indicates the desired updates on the
groupcom.google.gerrit.exceptions.DuplicateKeyException
- if the new name of the group is used by another groupjava.io.IOException
- if indexing fails, or an error occurs while reading/writing from/to NoteDbcom.google.gerrit.exceptions.NoSuchGroupException
- if the specified group doesn't existorg.eclipse.jgit.errors.ConfigInvalidException
public InternalGroup createGroupInNoteDb(InternalGroupCreation groupCreation, InternalGroupUpdate groupUpdate) throws java.io.IOException, org.eclipse.jgit.errors.ConfigInvalidException, com.google.gerrit.exceptions.DuplicateKeyException
java.io.IOException
org.eclipse.jgit.errors.ConfigInvalidException
com.google.gerrit.exceptions.DuplicateKeyException
public com.google.gerrit.server.group.db.GroupsUpdate.UpdateResult updateGroupInNoteDb(AccountGroup.UUID groupUuid, InternalGroupUpdate groupUpdate) throws java.io.IOException, org.eclipse.jgit.errors.ConfigInvalidException, com.google.gerrit.exceptions.DuplicateKeyException, com.google.gerrit.exceptions.NoSuchGroupException
java.io.IOException
org.eclipse.jgit.errors.ConfigInvalidException
com.google.gerrit.exceptions.DuplicateKeyException
com.google.gerrit.exceptions.NoSuchGroupException