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%2FListDelegates.java;h=788f1c771144a1fb652e65951cba12e1e3d1060b;hb=6dd9704640eb8cc8d6b4ccd266e40a3f6f589e75;hp=4397b426a921cf2d259203b7fba5870155e63ca4;hpb=71037c39a37d3549dcfe31926832a657744fbe05;p=aaf%2Fauthz.git diff --git a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/user/ListDelegates.java b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/user/ListDelegates.java index 4397b426..788f1c77 100644 --- a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/user/ListDelegates.java +++ b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/user/ListDelegates.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. @@ -39,54 +39,54 @@ import aaf.v2_0.Delgs; * */ public class ListDelegates extends Cmd { - private static final String HEADER = "List Delegates"; - private static final String[] options = {"user","delegate"}; - public ListDelegates(List parent) { - super(parent,"delegates", - new Param(optionsToString(options),true), - new Param("id",true)); - } + private static final String HEADER = "List Delegates"; + private static final String[] options = {"user","delegate"}; + public ListDelegates(List parent) { + super(parent,"delegates", + new Param(optionsToString(options),true), + new Param("id",true)); + } + + @Override + public int _exec(int _idx, final String ... args) throws CadiException, APIException, LocatorException { + int idx = _idx; + final String key = args[idx++]; + //int option = whichOption(options,key); + final String id = fullID(args[idx++]); + return same(new Retryable() { + @Override + public Integer code(Rcli client) throws CadiException, APIException { - @Override - public int _exec(int _idx, final String ... args) throws CadiException, APIException, LocatorException { - int idx = _idx; - final String key = args[idx++]; - //int option = whichOption(options,key); - final String id = fullID(args[idx++]); - return same(new Retryable() { - @Override - public Integer code(Rcli client) throws CadiException, APIException { - - Future fp = client.read( - "/authz/delegates/" + key + '/' + id, - getDF(Delgs.class) - ); - if(fp.get(AAFcli.timeout())) { - ((List)parent).report(fp.value,HEADER + " by " + key, id); - if(fp.code()==404)return 200; - } else { - error(fp); - } - return fp.code(); - } - }); - } + Future fp = client.read( + "/authz/delegates/" + key + '/' + id, + getDF(Delgs.class) + ); + if (fp.get(AAFcli.timeout())) { + ((List)parent).report(fp.value,HEADER + " by " + key, id); + if (fp.code()==404)return 200; + } else { + error(fp); + } + return fp.code(); + } + }); + } - @Override - public void detailedHelp(int _indent, StringBuilder sb) { - int indent = _indent; - detailLine(sb,indent,HEADER); - indent+=2; - detailLine(sb,indent,"Delegates are those people temporarily assigned to cover the"); - detailLine(sb,indent,"responsibility of Approving, etc, while the actual Responsible"); - detailLine(sb,indent,"Party is absent. Typically, this is for Vacation, or Business"); - detailLine(sb,indent,"Travel."); - sb.append('\n'); - detailLine(sb,indent,"Delegates can be listed by the User or by the Delegate"); - indent-=2; - api(sb,indent,HttpMethods.GET,"authz/delegates/user/",Delgs.class,true); - api(sb,indent,HttpMethods.GET,"authz/delegates/delegate/",Delgs.class,false); - } + @Override + public void detailedHelp(int _indent, StringBuilder sb) { + int indent = _indent; + detailLine(sb,indent,HEADER); + indent+=2; + detailLine(sb,indent,"Delegates are those people temporarily assigned to cover the"); + detailLine(sb,indent,"responsibility of Approving, etc, while the actual Responsible"); + detailLine(sb,indent,"Party is absent. Typically, this is for Vacation, or Business"); + detailLine(sb,indent,"Travel."); + sb.append('\n'); + detailLine(sb,indent,"Delegates can be listed by the User or by the Delegate"); + indent-=2; + api(sb,indent,HttpMethods.GET,"authz/delegates/user/",Delgs.class,true); + api(sb,indent,HttpMethods.GET,"authz/delegates/delegate/",Delgs.class,false); + } }