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%2FListChildren.java;h=9a9f47ffe82c3dd979250fb242ecd38fe2f4ef2a;hb=1296352d8eafee57f982a4342ad79ada4aa56d28;hp=07dcf7012bad5fcfd36b3a3308e4e41315cef3cd;hpb=ceda6e8bc270202bcb24340b86617110289c902e;p=aaf%2Fauthz.git diff --git a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/ns/ListChildren.java b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/ns/ListChildren.java index 07dcf701..9a9f47ff 100644 --- a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/ns/ListChildren.java +++ b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/ns/ListChildren.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. @@ -41,41 +41,41 @@ import aaf.v2_0.Nss.Ns; * */ public class ListChildren extends Cmd { - private static final String HEADER="List Child Namespaces"; - - public ListChildren(List parent) { - super(parent,"children", - new Param("ns-name",true)); - } + private static final String HEADER="List Child Namespaces"; + + public ListChildren(List parent) { + super(parent,"children", + new Param("ns-name",true)); + } - @Override - public int _exec(int _idx, final String ... args) throws CadiException, APIException, LocatorException { - int idx = _idx; - final String ns=args[idx++]; - return same(new Retryable() { - @Override - public Integer code(Rcli client) throws CadiException, APIException { - Future fn = client.read("/authz/nss/children/"+ns,getDF(Nss.class)); - if(fn.get(AAFcli.timeout())) { - parent.reportHead(HEADER); - for(Ns ns : fn.value.getNs()) { - pw().format(List.kformat, ns.getName()); - } - } else if(fn.code()==404) { - ((List)parent).report(null,HEADER,ns); - return 200; - } else { - error(fn); - } - return fn.code(); - } - }); - } + @Override + public int _exec(int idxValue, final String ... args) throws CadiException, APIException, LocatorException { + int idx = idxValue; + final String ns=args[idx++]; + return same(new Retryable() { + @Override + public Integer code(Rcli client) throws CadiException, APIException { + Future fn = client.read("/authz/nss/children/"+ns,getDF(Nss.class)); + if (fn.get(AAFcli.timeout())) { + parent.reportHead(HEADER); + for (Ns ns : fn.value.getNs()) { + pw().format(List.kformat, ns.getName()); + } + } else if (fn.code()==404) { + ((List)parent).report(null,HEADER,ns); + return 200; + } else { + error(fn); + } + return fn.code(); + } + }); + } - @Override - public void detailedHelp(int indent, StringBuilder sb) { - detailLine(sb,indent,HEADER); - api(sb,indent,HttpMethods.GET,"authz/nss/children/",Nss.class,true); - } + @Override + public void detailedHelp(int indent, StringBuilder sb) { + detailLine(sb,indent,HEADER); + api(sb,indent,HttpMethods.GET,"authz/nss/children/",Nss.class,true); + } }