Alon Bar-Lev has posted comments on this change. Change subject: aaa: Introducing format to id of User and Group API entities ......................................................................
Patch Set 4: (2 comments) where do we expose the provider and the provider id as field of user/group in api? http://gerrit.ovirt.org/#/c/26191/4/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/GroupMapper.java File backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/GroupMapper.java: Line 47: if (model.isSetId()) { Line 48: String id = model.getId(); Line 49: try { Line 50: String internalId = DirectoryEntryIdUtils.getInternalId(id); Line 51: String providerId = DirectoryEntryIdUtils.getProviderId(id); there is no point in getting these both. get the internal id, if not exists get he provider id in case of internal id the "external id" should be fetched from database. Line 52: if (StringUtils.isNotEmpty(internalId)) { Line 53: entity.setId(GuidUtils.asGuid(internalId)); Line 54: } else { Line 55: entity.setId(Guid.newGuid()); http://gerrit.ovirt.org/#/c/26191/4/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/UserMapper.java File backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/UserMapper.java: Line 74: if (model.isSetId()) { Line 75: String id = model.getId(); Line 76: try { Line 77: String internalId = DirectoryEntryIdUtils.getInternalId(id); Line 78: String providerId = DirectoryEntryIdUtils.getProviderId(id); same here, fetch either, not both, as they cannot be both. Line 79: if (StringUtils.isNotEmpty(internalId)) { Line 80: entity.setId(GuidUtils.asGuid(internalId)); Line 81: } else { Line 82: entity.setId(Guid.newGuid()); -- To view, visit http://gerrit.ovirt.org/26191 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iaecb5d43945769db82475edde1c7075c1a343c07 Gerrit-PatchSet: 4 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Yair Zaslavsky <yzasl...@redhat.com> Gerrit-Reviewer: Alon Bar-Lev <alo...@redhat.com> Gerrit-Reviewer: Barak Azulay <bazu...@redhat.com> Gerrit-Reviewer: Juan Hernandez <juan.hernan...@redhat.com> Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches