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%2FList.java;h=ef25f75aeec6773c01315a6a8dda19344cf01e28;hb=1296352d8eafee57f982a4342ad79ada4aa56d28;hp=3dae0fa54cda71cdae66ac09657526d7ed0acaf1;hpb=190372539017be0ab732655817845fbc6fb48fd2;p=aaf%2Fauthz.git diff --git a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/ns/List.java b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/ns/List.java index 3dae0fa5..ef25f75a 100644 --- a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/ns/List.java +++ b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/ns/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. @@ -26,6 +26,7 @@ import java.util.Comparator; import org.onap.aaf.auth.cmd.BaseCmd; import org.onap.aaf.auth.cmd.DeprecatedCMD; +import org.onap.aaf.auth.common.Define; import org.onap.aaf.cadi.client.Future; import org.onap.aaf.misc.env.util.Chrono; @@ -46,9 +47,9 @@ public class List extends BaseCmd { public List(NS parent) { super(parent,"list"); cmds.add(new ListByName(this)); - -// TODO: uncomment when on cassandra 2.1.2 if we like cli command to get all ns's -// a user is admin or responsible for + +// TODO: uncomment when on cassandra 2.1.2 if we like cli command to get all ns's +// a user is admin or responsible for cmds.add(new ListAdminResponsible(this)); cmds.add(new DeprecatedCMD(this,"responsible","'responsible' is deprecated. use 'owner'")); // deprecated cmds.add(new ListActivity(this)); @@ -56,13 +57,13 @@ public class List extends BaseCmd { cmds.add(new ListChildren(this)); cmds.add(new ListNsKeysByAttrib(this)); } - + public void report(Future fp, String ... str) { reportHead(str); if (fp==null) { pw().println(" *** Namespace Not Found ***"); } - + if (fp!=null && fp.value!=null) { for (Ns ns : fp.value.getNs()) { pw().println(ns.getName()); @@ -92,12 +93,12 @@ public class List extends BaseCmd { } pw().format(sformat,sb.toString()); } - + } } } } - + public void reportName(Future fp, String ... str) { reportHead(str); if (fp!=null && fp.value!=null) { @@ -108,7 +109,7 @@ public class List extends BaseCmd { return ns1.getName().compareTo(ns2.getName()); } }); - + for (Ns ns : nss) { pw().println(ns.getName()); if (this.aafcli.isDetailed() && ns.getDescription() != null) { @@ -135,9 +136,9 @@ public class List extends BaseCmd { } } } - - public void reportCred(Future fc) { + + public void reportCred(Future fc) { if (fc!=null && fc.value!=null && !(fc.value.getUser().isEmpty())) { pw().println(" Credentials"); java.util.List users = fc.value.getUser(); @@ -161,15 +162,9 @@ public class List extends BaseCmd { Integer type; if ((type=u.getType())==null) { type = 9999; - } - switch(type) { - case 1: return "U/P"; - case 2: return "U/P2"; - case 10: return "Cert"; - case 200: return "x509"; - default: - return "n/a"; } + return Define.getCredType(type); } + }