X-Git-Url: https://gerrit.onap.org/r/gitweb?p=aaf%2Fauthz.git;a=blobdiff_plain;f=auth%2Fauth-cmd%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faaf%2Fauth%2Fcmd%2Fuser%2FDelg.java;h=6e96728605ba5784adf6c6923771891a106b3c7d;hp=e4ddc2b170933cb5bacfdb43cb5808e7588180a2;hb=ae446115193e39791cc2af70a5560ec86dc63b8e;hpb=cf04c089826d7f2bd139447de77db8e4d9761ddb diff --git a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/user/Delg.java b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/user/Delg.java index e4ddc2b1..6e967286 100644 --- a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/user/Delg.java +++ b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/user/Delg.java @@ -9,9 +9,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. @@ -45,7 +45,7 @@ public class Delg extends BaseCmd { static final String AUTHZ_DELG = "/authz/delegate"; private static final String[] options = {"add","upd","del"}; - public Delg(User user) throws APIException { + public Delg(User user){ super(user,"delegate", new Param(optionsToString(options),true), new Param("from",true), @@ -62,7 +62,7 @@ public class Delg extends BaseCmd { int idx = index; DelgRequest dr = new DelgRequest(); setStartEnd(dr); - + int option= whichOption(options, args[idx++]); String user = fullID(args[idx++]); dr.setUser(user); @@ -72,36 +72,36 @@ public class Delg extends BaseCmd { if (option<2 && args.length>idx) { Date date; try { - date = Chrono.dateOnlyFmt.parse(args[idx++]); + date = Chrono.dateOnlyFmt.parse(args[idx]); } catch (ParseException e) { throw new CadiException(e); } dr.setEnd(Chrono.timeStamp(date)); } } - + Future fp; RosettaDF df = getDF(DelgRequest.class); String verb; setQueryParamsOn(client); switch(option) { - case 0: + case 0: fp = client.create(AUTHZ_DELG, df, dr); verb = "Added"; break; - case 1: - fp = client.update(AUTHZ_DELG, df, dr); + case 1: + fp = client.update(AUTHZ_DELG, df, dr); verb = "Updated"; break; - case 2: - fp = client.delete(AUTHZ_DELG, df, dr); + case 2: + fp = client.delete(AUTHZ_DELG, df, dr); verb = "Deleted"; break; default: throw new CadiException("Bad Argument"); }; - + if (fp.get(AAFcli.timeout())) { pw().append("Delegate "); pw().println(verb);