Class GroupsUpdate
- java.lang.Object
-
- com.google.gerrit.server.group.db.GroupsUpdate
-
public class GroupsUpdate extends Object
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
GroupsOnInit
instead.If not explicitly stated, all methods of this class refer to internal groups.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
GroupsUpdate.Factory
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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)
-
-
-
Method Detail
-
createGroup
public InternalGroup createGroup(InternalGroupCreation groupCreation, InternalGroupUpdate groupUpdate) 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 groupgroupUpdate
- anInternalGroupUpdate
which specifies optional properties of the group. If thisInternalGroupUpdate
updates a property which was already specified by theInternalGroupCreation
, the value of thisInternalGroupUpdate
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, InternalGroupUpdate groupUpdate) 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 updategroupUpdate
- anInternalGroupUpdate
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
-
createGroupInNoteDb
public InternalGroup createGroupInNoteDb(InternalGroupCreation groupCreation, InternalGroupUpdate groupUpdate) 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
public com.google.gerrit.server.group.db.GroupsUpdate.UpdateResult updateGroupInNoteDb(AccountGroup.UUID groupUuid, InternalGroupUpdate groupUpdate) 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
-
-