Yair Zaslavsky has posted comments on this change.

Change subject: aaa: using the new extensions API in InternalDirectory
......................................................................


Patch Set 3:

(6 comments)

http://gerrit.ovirt.org/#/c/26477/3/backend/manager/modules/aaa/src/main/java/org/ovirt/engine/core/aaa/DirectoryProxy.java
File 
backend/manager/modules/aaa/src/main/java/org/ovirt/engine/core/aaa/DirectoryProxy.java:

Line 29:         ExtMap authRecord = new ExtMap().mput(
Line 30:                 Authn.AuthRecord.PRINCIPAL, name);
Line 31:         ExtMap inputMap = new ExtMap().mput(
Line 32:                 Base.InvokeKeys.COMMAND, 
Authz.InvokeCommands.FETCH_PRINCIPAL_RECORD
Line 33:         ).mput(Authn.InvokeKeys.AUTH_RECORD,  authRecord);
> you do not need authRecord temp variable.
Done
Line 34:         ExtMap outputMap = extension.invoke(inputMap);
Line 35:         ExtMap principalRecord = 
outputMap.<ExtMap>get(Authz.InvokeKeys.PRINCIPAL_RECORD);
Line 36:         if (principalRecord == null) {
Line 37:             return null;


Line 36:         if (principalRecord == null) {
Line 37:             return null;
Line 38:         }
Line 39: 
Line 40:         return mapPrincipalRecord(principalRecord);
> mapPrincipalRecord can return the null if principalRecord is null, no?
Done
Line 41:     }
Line 42: 
Line 43:     @Deprecated
Line 44:     @Override


Line 56:         ExtMap inputMap = new ExtMap().mput(
Line 57:                 Base.InvokeKeys.COMMAND, 
Authz.InvokeCommands.QUERY_PRINCIPALS_BY_IDS_OPEN
Line 58:                 ).mput(Authz.InvokeKeys.PRINCIPAL_IDS, ids);
Line 59:         ExtMap outputMap = extension.invoke(inputMap);
Line 60:         return populateUsers(outputMap);
> why don't you perform the invoke within the populate?
Done
Line 61:     }
Line 62: 
Line 63:     @Deprecated
Line 64:     @Override


Line 88:         while (true) {
Line 89:             ExtMap inputMap = new ExtMap().mput(
Line 90:                     Base.InvokeKeys.COMMAND, 
Authz.InvokeCommands.QUERY_EXECUTE
Line 91:                     ).mput(Authz.InvokeKeys.QUERY_OPAQUE, queryOpaque);
Line 92:             outputMap = extension.invoke(inputMap);
> you do not need inputMap temp variable.
Done
Line 93:             ExtMap result = 
outputMap.get(Authz.InvokeKeys.QUERY_RESULT);
Line 94:             queryOpaque = outputMap.get(Authz.InvokeKeys.QUERY_OPAQUE);
Line 95:             if (result == null) {
Line 96:                 break;


Line 90:                     Base.InvokeKeys.COMMAND, 
Authz.InvokeCommands.QUERY_EXECUTE
Line 91:                     ).mput(Authz.InvokeKeys.QUERY_OPAQUE, queryOpaque);
Line 92:             outputMap = extension.invoke(inputMap);
Line 93:             ExtMap result = 
outputMap.get(Authz.InvokeKeys.QUERY_RESULT);
Line 94:             queryOpaque = outputMap.get(Authz.InvokeKeys.QUERY_OPAQUE);
> you do not need to get the opaque again, you already have it.
Don't I need to get it in each iteration?
Line 95:             if (result == null) {
Line 96:                 break;
Line 97:             }
Line 98:             directoryUsers.add(mapPrincipalRecord(result));


Line 98:             directoryUsers.add(mapPrincipalRecord(result));
Line 99:         }
Line 100:         ExtMap inputMap = new ExtMap().mput(
Line 101:                 Base.InvokeKeys.COMMAND, 
Authz.InvokeCommands.QUERY_CLOSE
Line 102:                 ).mput(Authz.InvokeKeys.QUERY_OPAQUE, queryOpaque);
> this should be in finally, and I think it belongs to where you open to be s
Done
Line 103:         outputMap = extension.invoke(inputMap);
Line 104:         return directoryUsers;
Line 105:     }
Line 106: 


-- 
To view, visit http://gerrit.ovirt.org/26477
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I958443292da0455e0a12039fac98eebb9b17dee2
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Yair Zaslavsky <[email protected]>
Gerrit-Reviewer: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
Gerrit-Reviewer: [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

Reply via email to