X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=auth%2Fauth-cmd%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faaf%2Fauth%2Fcmd%2Fuser%2FList.java;h=b30113692844e8e5e5a4d93268da144eacbcbc3e;hb=1296352d8eafee57f982a4342ad79ada4aa56d28;hp=6d9932848258bf7a38be27d9a6776d675e84e4e7;hpb=ff1417ff60baee231a28272f9a16ef2c9c8ea0a2;p=aaf%2Fauthz.git diff --git a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/user/List.java b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/user/List.java index 6d993284..b3011369 100644 --- a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/user/List.java +++ b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/user/List.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -45,10 +45,9 @@ public class List extends BaseCmd { cmds.add(new ListActivity(this)); } - + void report(Users users, boolean count, String ... str) { reportHead(str); - int idx = 0; java.util.List sorted = users.getUser(); Collections.sort(sorted, (Comparator) (u1, u2) -> { if (u1==null || u2 == null) { @@ -56,23 +55,21 @@ public class List extends BaseCmd { } return u1.getId().compareTo(u2.getId()); }); - String format = reportColHead("%-48s %-5s %-11s %-16s\n","User","Type","Expires","Tag"); + String format = reportColHead("%-36s %-5s %-20s %-16s\n","User","Type","Expires","Tag"); String date = "XXXX-XX-XX"; for (aaf.v2_0.Users.User user : sorted) { if (!aafcli.isTest()) { - date = Chrono.dateOnlyStamp(user.getExpires()); - } - String tag=null; - if(user.getType()<200) { - tag = user.getTag(); - } else { - tag = "\n\tfingerprint: " + user.getTag(); + date = Chrono.niceUTCStamp(user.getExpires()); } + String tag=user.getTag(); + Integer type = user.getType(); if(tag==null) { - tag=""; + tag=""; + } else if(type!=null && type>=200) { + tag = "\n\tfingerprint: " + tag; } - pw().format(format, - count? (Integer.valueOf(++idx) + ") " + user.getId()): user.getId(), + pw().format(format, + user.getId(), org.onap.aaf.auth.cmd.ns.List.getType(user), date, tag); @@ -110,9 +107,9 @@ public class List extends BaseCmd { String format = reportColHead(" %-25s %-25s %-10s\n","User","Delegate","Expires"); String date = "XXXX-XX-XX"; for (Delg delg : delgs.getDelgs()) { - if (!this.aafcli.isTest()) + if (!this.aafcli.isTest()) date = Chrono.dateOnlyStamp(delg.getExpires()); - pw().printf(format, + pw().printf(format, delg.getUser(), delg.getDelegate(), date