X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=auth%2Fauth-cmd%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faaf%2Fauth%2Fcmd%2Fns%2FListNsKeysByAttrib.java;h=14bc331325378e6c6cfd8ee0ec2d34e326835f6c;hb=6dd9704640eb8cc8d6b4ccd266e40a3f6f589e75;hp=7c449565183fb275cacf11e5c16aea0549e988dc;hpb=ceda6e8bc270202bcb24340b86617110289c902e;p=aaf%2Fauthz.git diff --git a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/ns/ListNsKeysByAttrib.java b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/ns/ListNsKeysByAttrib.java index 7c449565..14bc3313 100644 --- a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/ns/ListNsKeysByAttrib.java +++ b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/ns/ListNsKeysByAttrib.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. @@ -44,45 +44,45 @@ import aaf.v2_0.Users; * */ public class ListNsKeysByAttrib extends Cmd { - private static final String HEADER="List Namespace Names by Attribute"; - - public ListNsKeysByAttrib(List parent) { - super(parent,"keys", - new Param("attrib",true)); - } + private static final String HEADER="List Namespace Names by Attribute"; + + public ListNsKeysByAttrib(List parent) { + super(parent,"keys", + new Param("attrib",true)); + } - @Override - public int _exec(final int idx, final String ... args) throws CadiException, APIException, LocatorException { - final String attrib=args[idx]; - return same(new Retryable() { - @Override - public Integer code(Rcli client) throws CadiException, APIException { - Future fn = client.read("/authz/ns/attrib/"+attrib,getDF(Keys.class)); - if(fn.get(AAFcli.timeout())) { - parent.reportHead(HEADER); - for(String key : fn.value.getKey()) { - pw().printf(List.kformat, key); - } - } else if(fn.code()==404) { - parent.reportHead(HEADER); - pw().println(" *** No Namespaces Found ***"); - return 200; - } else { - error(fn); - } - return fn.code(); - } - }); - } + @Override + public int _exec(final int idx, final String ... args) throws CadiException, APIException, LocatorException { + final String attrib=args[idx]; + return same(new Retryable() { + @Override + public Integer code(Rcli client) throws CadiException, APIException { + Future fn = client.read("/authz/ns/attrib/"+attrib,getDF(Keys.class)); + if (fn.get(AAFcli.timeout())) { + parent.reportHead(HEADER); + for (String key : fn.value.getKey()) { + pw().printf(List.kformat, key); + } + } else if (fn.code()==404) { + parent.reportHead(HEADER); + pw().println(" *** No Namespaces Found ***"); + 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/",Nss.class,true); - detailLine(sb,indent,"Indirectly uses:"); - api(sb,indent,HttpMethods.GET,"authz/roles/ns/",Roles.class,false); - api(sb,indent,HttpMethods.GET,"authz/perms/ns/",Perms.class,false); - api(sb,indent,HttpMethods.GET,"authn/creds/ns/",Users.class,false); - } + @Override + public void detailedHelp(int indent, StringBuilder sb) { + detailLine(sb,indent,HEADER); + api(sb,indent,HttpMethods.GET,"authz/nss/",Nss.class,true); + detailLine(sb,indent,"Indirectly uses:"); + api(sb,indent,HttpMethods.GET,"authz/roles/ns/",Roles.class,false); + api(sb,indent,HttpMethods.GET,"authz/perms/ns/",Perms.class,false); + api(sb,indent,HttpMethods.GET,"authn/creds/ns/",Users.class,false); + } }