Class GroupsUpdate
java.lang.Object
com.google.gerrit.server.group.db.GroupsUpdate
A database accessor for write calls related to groups.
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
instead.
invalid reference
com.google.gerrit.pgm.init.GroupsOnInit
If not explicitly stated, all methods of this class refer to internal groups.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptioncreateGroup
(InternalGroupCreation groupCreation, GroupDelta groupDelta) Creates the specified group for the specified members (accounts).createGroupInNoteDb
(InternalGroupCreation groupCreation, GroupDelta groupDelta) void
deleteGroup
(AccountGroup.UUID groupUuid) Delete a specific groupvoid
updateGroup
(AccountGroup.UUID groupUuid, GroupDelta groupDelta) Updates the specified group.com.google.gerrit.server.group.db.GroupsUpdate.UpdateResult
updateGroupInNoteDb
(AccountGroup.UUID groupUuid, GroupDelta groupDelta)
-
Method Details
-
createGroup
@CanIgnoreReturnValue public InternalGroup createGroup(InternalGroupCreation groupCreation, GroupDelta groupDelta) throws com.google.gerrit.exceptions.DuplicateKeyException, IOException, org.eclipse.jgit.errors.ConfigInvalidException Creates the specified group for the specified members (accounts).- Parameters:
groupCreation
- anInternalGroupCreation
which specifies all mandatory properties of the groupgroupDelta
- aGroupDelta
which specifies optional properties of the group. If thisGroupDelta
updates a property which was already specified by theInternalGroupCreation
, the value of thisGroupDelta
wins.- Returns:
- the created
InternalGroup
- Throws:
com.google.gerrit.exceptions.DuplicateKeyException
- if a group with the chosen name already existsIOException
- if indexing fails, or an error occurs while reading/writing from/to NoteDborg.eclipse.jgit.errors.ConfigInvalidException
-
updateGroup
public void updateGroup(AccountGroup.UUID groupUuid, GroupDelta groupDelta) throws com.google.gerrit.exceptions.DuplicateKeyException, IOException, com.google.gerrit.exceptions.NoSuchGroupException, org.eclipse.jgit.errors.ConfigInvalidException Updates the specified group.- Parameters:
groupUuid
- the UUID of the group to updategroupDelta
- aGroupDelta
which indicates the desired updates on the group- Throws:
com.google.gerrit.exceptions.DuplicateKeyException
- if the new name of the group is used by another groupIOException
- 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
-
deleteGroup
public void deleteGroup(AccountGroup.UUID groupUuid) throws org.eclipse.jgit.errors.ConfigInvalidException, IOException Delete a specific group- Parameters:
groupUuid
- the UUID of the group to delete- Throws:
org.eclipse.jgit.errors.ConfigInvalidException
- if removing group note failedIOException
- if indexing fails, or an error occurs while reading/writing from/to NoteDb
-
createGroupInNoteDb
public InternalGroup createGroupInNoteDb(InternalGroupCreation groupCreation, GroupDelta groupDelta) throws IOException, org.eclipse.jgit.errors.ConfigInvalidException, com.google.gerrit.exceptions.DuplicateKeyException - Throws:
IOException
org.eclipse.jgit.errors.ConfigInvalidException
com.google.gerrit.exceptions.DuplicateKeyException
-
updateGroupInNoteDb
@CanIgnoreReturnValue public com.google.gerrit.server.group.db.GroupsUpdate.UpdateResult updateGroupInNoteDb(AccountGroup.UUID groupUuid, GroupDelta groupDelta) throws IOException, org.eclipse.jgit.errors.ConfigInvalidException, com.google.gerrit.exceptions.DuplicateKeyException, com.google.gerrit.exceptions.NoSuchGroupException - Throws:
IOException
org.eclipse.jgit.errors.ConfigInvalidException
com.google.gerrit.exceptions.DuplicateKeyException
com.google.gerrit.exceptions.NoSuchGroupException
-