Martin Peřina has posted comments on this change.
Change subject: core, restapi: Add DbGroup
......................................................................
Patch Set 8:
(7 comments)
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddDirectoryGroupCommand.java
Line 30: protected boolean canDoAction() {
Line 31: Guid id = null;
Line 32: String domain = null;
Line 33: if (getParameters().getGroup() != null) {
Line 34: addCustomValue("NewUserName",
getParameters().getGroup().getname());
Please declare this as a constant and make JavaDoc for it
Line 35: id = getParameters().getGroup().getid();
Line 36: domain = getParameters().getGroup().getdomain();
Line 37: LdapGroup adGroup =
Line 38: (LdapGroup)
LdapFactory.getInstance(domain).RunAdAction(AdActionType.GetAdGroupByGroupId,
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AttachUserGroupToTagCommand.java
Line 22: TagsUserGroupMap map = new
TagsUserGroupMap(groupGuid, getTagId());
Line 23:
DbFacade.getInstance().getTagDao().attachUserGroupToTag(map);
Line 24: noActionDone = false;
Line 25: if (group != null) {
Line 26: appendCustomValue("AttachGroupsNames",
group.getName(), ", ");
Please declare this as a constant and make JavaDoc for it
Line 27: }
Line 28: } else {
Line 29: if (group != null) {
Line 30: appendCustomValue("AttachGroupsNamesExists",
group.getName(), ", ");
Line 26: appendCustomValue("AttachGroupsNames",
group.getName(), ", ");
Line 27: }
Line 28: } else {
Line 29: if (group != null) {
Line 30: appendCustomValue("AttachGroupsNamesExists",
group.getName(), ", ");
Please declare this as a constant and make JavaDoc for it
Line 31: }
Line 32: }
Line 33: }
Line 34: setSucceeded(true);
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/DbUserCacheManager.java
Line 280:
.RunAdAction(AdActionType.GetAdGroupByGroupId,
Line 281: new
LdapSearchByIdParameters(group.getDomain(), group.getId()))
Line 282: .getReturnValue();
Line 283:
Line 284: if (group.getStatus() == 1 // Active
I would also prefer enum here
Line 285: && (groupFromAD == null ||
groupFromAD.getstatus() == LdapRefStatus.Inactive)) {
Line 286: group.setStatus(0); // Inactive
Line 287: } else if (groupFromAD != null
Line 288: &&
(!StringUtils.equals(group.getName(), groupFromAD.getname())
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/DetachUserGroupFromTagCommand.java
Line 19: for (Guid groupGuid : getGroupList()) {
Line 20: DbGroup group =
DbFacade.getInstance().getDbGroupDao().get(groupGuid);
Line 21: if
(DbFacade.getInstance().getTagDao().getTagUserGroupByGroupIdAndByTagId(getTagId(),
groupGuid) != null) {
Line 22: if (group != null) {
Line 23: appendCustomValue("DetachGroupsNames",
group.getName(), ", ");
Please declare this as a constant and make JavaDoc for it
Line 24: }
Line 25:
DbFacade.getInstance().getTagDao().detachUserGroupFromTag(getTagId(),
groupGuid);
Line 26: noActionDone = false;
Line 27: setSucceeded(true);
....................................................
File
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/DbGroup.java
Line 22:
Line 23: private String domain;
Line 24: private String name;
Line 25: private String distinguishedName;
Line 26: private List<String> memberOf;
Wouldn't be a better to use Set instead of List?
Line 27:
Line 28: /**
Line 29: * The status of the user in the directory, 0 for inactive and any
other
Line 30: * value for active.
....................................................
File
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/DbGroupDAODbFacadeImpl.java
Line 69: .addValue("id", group.getId())
Line 70: .addValue("name", group.getName())
Line 71: .addValue("status", group.getStatus())
Line 72: .addValue("domain", group.getDomain())
Line 73: .addValue("distinguishedname",
group.getDistinguishedName())
When you use "external_id", shouldn't you use also "distinguished_name"?
Line 74: .addValue("external_id", group.getExternalId()));
Line 75: }
Line 76:
Line 77: @Override
--
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: 8
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: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches