mooli tayer has posted comments on this change.
Change subject: core, restapi: Add DbGroup
......................................................................
Patch Set 9:
(8 comments)
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddDirectoryGroupCommand.java
Line 15: import org.ovirt.engine.core.compat.Guid;
Line 16:
Line 17: public class AddDirectoryGroupCommand<T extends
AddDirectoryGroupParameters>
Line 18: extends CommandBase<T> {
Line 19:
Where is this command used?
Line 20: public AddDirectoryGroupCommand(T params) {
Line 21: super(params);
Line 22: }
Line 23:
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/DbUserCacheManager.java
Line 164: List<String> domainsList =
LdapBrokerUtils.getDomainsList(true);
Line 165: List<DbUser> filteredUsers = LinqUtils.filter(allUsers,
new UsersPerDomainPredicate(domainsList));
Line 166: Map<String, Map<Guid, DbUser>> userByDomains = new
HashMap<String, Map<Guid, DbUser>>();
Line 167:
Line 168: // Filter all users by domains
// Map all users by domains
This class made me cry a little bit,
but I guess it is unrelated to the patch.
Line 169: for (DbUser user : filteredUsers) {
Line 170: Map<Guid, DbUser> domainUser;
Line 171: if (!userByDomains.containsKey(user.getDomain())) {
Line 172: domainUser = new HashMap<Guid, DbUser>();
Line 266: // We check if the domain is null or empty for internal
groups.
Line 267: // An internal group does not have a domain, and there is
no need to query
Line 268: // the ldap server for it. Note that if we will add
support in the future for
Line 269: // domain-less groups in the ldap server then this code
will have to change in order
Line 270: // to fetch for them
is the above comment still relevant with internal domains?
Line 271: if (group.getDomain() != null &&
!group.getDomain().isEmpty()) {
Line 272: if
(UsersDomainsCacheManagerService.getInstance().getDomain(group.getDomain()) ==
null) {
Line 273: log.errorFormat("Cannot query for group {0} from
domain {1} because the domain is not configured. Please use the manage domains
utility if you wish to add this domain.",
Line 274: group.getName(),
Line 282: .getReturnValue();
Line 283:
Line 284: if (group.getStatus() == 1 // Active
Line 285: && (groupFromAD == null ||
groupFromAD.getstatus() == LdapRefStatus.Inactive)) {
Line 286: group.setStatus(0); // Inactive
If a group has been removed from the ladp server, we want to keep it for good
as inactive?
Line 287: } else if (groupFromAD != null
Line 288: &&
(!StringUtils.equals(group.getName(), groupFromAD.getname())
Line 289: || group.getStatus() !=
groupFromAD.getstatus().getValue()
Line 290: ||
!StringUtils.equals(group.getDistinguishedName(),
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/adbroker/LdapBrokerCommandBase.java
Line 152: }
Line 153: for (String groupDN : groupDNList) {
Line 154: String groupName =
LdapBrokerUtils.generateGroupDisplayValue(groupDN);
Line 155: if (!groupsDict.containsKey(groupName)) {
Line 156: DbGroup dbGroup =
DbFacade.getInstance().getDbGroupDao().getByName(groupName);
DbGroup objects have a domain. What if there are groups with the same name
under different domains? is name a primary key?
Line 157: LdapGroup ldapGroup = null;
Line 158: if (dbGroup == null) {
Line 159: ldapGroup = new LdapGroup();
Line 160: ldapGroup.setname(groupName);
....................................................
File
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/DbGroup.java
Line 9: public class DbGroup extends IVdcQueryable {
Line 10: private static final long serialVersionUID = 6717840754119287059L;
Line 11:
Line 12: /**
Line 13: * This is the identifier assigned by the engine to this user for
internal
s/user/group/
Line 14: * use only.
Line 15: */
Line 16: private Guid id;
Line 17:
Line 15: */
Line 16: private Guid id;
Line 17:
Line 18: /**
Line 19: * This is the identifier assigned by the external directory to
this user.
s/user/group/
Line 20: */
Line 21: private ExternalId externalId;
Line 22:
Line 23: private String domain;
....................................................
File packaging/dbscripts/ad_groups_sp.sql
Line 6:
Line 7:
Line 8:
Line 9:
Line 10: Create or replace FUNCTION InsertGroup(v_id UUID,
Question about renaming functions:
When do these scripts run?
Can a system end up with both 'InsertGroup' and 'Insertad_groups'?
Line 11: v_name VARCHAR(255),
Line 12: v_status INTEGER,
Line 13: v_domain VARCHAR(100),
Line 14: v_distinguishedname VARCHAR(4000),
--
To view, visit http://gerrit.ovirt.org/17544
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Idb1a7146c29eb74f97e10043d65b5a67f1430021
Gerrit-PatchSet: 9
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Juan Hernandez <[email protected]>
Gerrit-Reviewer: Juan Hernandez <[email protected]>
Gerrit-Reviewer: Liran Zelkha <[email protected]>
Gerrit-Reviewer: Martin Peřina <[email protected]>
Gerrit-Reviewer: Oved Ourfali <[email protected]>
Gerrit-Reviewer: Ravi Nori <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
Gerrit-Reviewer: mooli tayer <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches