X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=auth%2Fauth-cmd%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faaf%2Fauth%2Fcmd%2Fns%2FListUsersInRole.java;h=c0838cb707c9848b4e93391fd1583f29f834bfa3;hb=refs%2Fchanges%2F87%2F65287%2F1;hp=301e15088c7b50969b212a2fc7ca7f20447f5cfe;hpb=ead32f193586e39b59bb366bddf70e665173a52d;p=aaf%2Fauthz.git diff --git a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/ns/ListUsersInRole.java b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/ns/ListUsersInRole.java index 301e1508..c0838cb7 100644 --- a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/ns/ListUsersInRole.java +++ b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/ns/ListUsersInRole.java @@ -65,42 +65,42 @@ public class ListUsersInRole extends Cmd { public Integer code(Rcli client) throws CadiException, APIException { ((ListUsers)parent).report(HEADER,ns); Future fn = client.read("/authz/nss/"+ns,getDF(Nss.class)); - if(fn.get(AAFcli.timeout())) { - if(fn.value!=null) { + if (fn.get(AAFcli.timeout())) { + if (fn.value!=null) { Set uset = detail?null:new HashSet<>(); - for(Ns n : fn.value.getNs()) { + for (Ns n : fn.value.getNs()) { Future fr = client.read("/authz/roles/ns/"+n.getName(), getDF(Roles.class)); - if(fr.get(AAFcli.timeout())) { - for(Role r : fr.value.getRole()) { - if(detail) { + if (fr.get(AAFcli.timeout())) { + for (Role r : fr.value.getRole()) { + if (detail) { ((ListUsers)parent).report(r.getName()); } Future fus = client.read( "/authz/users/role/"+r.getName(), getDF(Users.class) ); - if(fus.get(AAFcli.timeout())) { - for(User u : fus.value.getUser()) { - if(detail) { + if (fus.get(AAFcli.timeout())) { + for (User u : fus.value.getUser()) { + if (detail) { ((ListUsers)parent).report(" ",u); } else { uset.add(u.getId()); } } - } else if(fn.code()==404) { + } else if (fn.code()==404) { return 200; } } } } - if(uset!=null) { - for(String u : uset) { + if (uset!=null) { + for (String u : uset) { pw().print(" "); pw().println(u); } } } - } else if(fn.code()==404) { + } else if (fn.code()==404) { return 200; } else { error(fn);