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%2Fperm%2FDescribe.java;h=8396f7d358d45301aa0137a587f67bca4a7fbfc3;hb=4b5a7d721d994a49057e9bfb403c7bff1b376660;hp=5a3fad3ee0e9002313fb449070970298f4508dc9;hpb=824dc7b5fc0e1ccdf7f460479aff344727f0f01e;p=aaf%2Fauthz.git diff --git a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/perm/Describe.java b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/perm/Describe.java index 5a3fad3e..8396f7d3 100644 --- a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/perm/Describe.java +++ b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/perm/Describe.java @@ -35,66 +35,66 @@ import org.onap.aaf.misc.env.APIException; import aaf.v2_0.PermRequest; public class Describe extends Cmd { - private static final String PERM_PATH = "/authz/perm"; - public Describe(Perm parent) { - super(parent,"describe", - new Param("type",true), - new Param("instance", true), - new Param("action", true), - new Param("description",true)); - } + private static final String PERM_PATH = "/authz/perm"; + public Describe(Perm parent) { + super(parent,"describe", + new Param("type",true), + new Param("instance", true), + new Param("action", true), + new Param("description",true)); + } - @Override - public int _exec(final int index, final String ... args) throws CadiException, APIException, LocatorException { - return same(new Retryable() { - @Override - public Integer code(Rcli client) throws CadiException, APIException { - int idx = index; - String type = args[idx++]; - String instance = args[idx++]; - String action = args[idx++]; - StringBuilder desc = new StringBuilder(); - while (idx < args.length) { - desc.append(args[idx++] + ' '); - } - - PermRequest pr = new PermRequest(); - pr.setType(type); - pr.setInstance(instance); - pr.setAction(action); - pr.setDescription(desc.toString()); - - // Set Start/End commands - setStartEnd(pr); - - Future fp = null; - int rv; + @Override + public int _exec(final int index, final String ... args) throws CadiException, APIException, LocatorException { + return same(new Retryable() { + @Override + public Integer code(Rcli client) throws CadiException, APIException { + int idx = index; + String type = args[idx++]; + String instance = args[idx++]; + String action = args[idx++]; + StringBuilder desc = new StringBuilder(); + while (idx < args.length) { + desc.append(args[idx++] + ' '); + } + + PermRequest pr = new PermRequest(); + pr.setType(type); + pr.setInstance(instance); + pr.setAction(action); + pr.setDescription(desc.toString()); + + // Set Start/End commands + setStartEnd(pr); + + Future fp = null; + int rv; - fp = client.update( - PERM_PATH, - getDF(PermRequest.class), - pr - ); + fp = client.update( + PERM_PATH, + getDF(PermRequest.class), + pr + ); - if(fp.get(AAFcli.timeout())) { - rv=fp.code(); - pw().println("Description added to Permission"); - } else { - if((rv=fp.code())==202) { - pw().print("Adding description"); - pw().println(" Accepted, but requires Approvals before actualizing"); - } else { - error(fp); - } - } - return rv; - } - }); - } + if(fp.get(AAFcli.timeout())) { + rv=fp.code(); + pw().println("Description added to Permission"); + } else { + if((rv=fp.code())==202) { + pw().print("Adding description"); + pw().println(" Accepted, but requires Approvals before actualizing"); + } else { + error(fp); + } + } + return rv; + } + }); + } - @Override - public void detailedHelp(int indent, StringBuilder sb) { - detailLine(sb,indent,"Add a description to a permission"); - api(sb,indent,HttpMethods.PUT,"authz/perm",PermRequest.class,true); - } + @Override + public void detailedHelp(int indent, StringBuilder sb) { + detailLine(sb,indent,"Add a description to a permission"); + api(sb,indent,HttpMethods.PUT,"authz/perm",PermRequest.class,true); + } }