X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=auth%2Fauth-cmd%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faaf%2Fauth%2Fcmd%2FCmd.java;fp=auth%2Fauth-cmd%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faaf%2Fauth%2Fcmd%2FCmd.java;h=0ae4ce9922b62ce163d02ffc8afa8544eb1ff620;hb=1296352d8eafee57f982a4342ad79ada4aa56d28;hp=6ca09213f1f8b3d412c1fb7f0f1d390e911487f1;hpb=bdce7667a6e272e2fa32e298d957a0d9090c5bc9;p=aaf%2Fauthz.git diff --git a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/Cmd.java b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/Cmd.java index 6ca09213..0ae4ce99 100644 --- a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/Cmd.java +++ b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/Cmd.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. @@ -67,7 +67,7 @@ public abstract class Cmd { public static final String STARTDATE = "startdate"; public static final String ENDDATE = "enddate"; - + private String name; private final Param[] params; private int required; @@ -104,7 +104,7 @@ public abstract class Cmd { ++required; } } - + String temp = access.getProperty(Config.AAF_DEFAULT_REALM,null); if (temp!=null && !temp.startsWith("@")) { defaultRealm = '@' + temp; @@ -112,16 +112,16 @@ public abstract class Cmd { defaultRealm=""; } } - + public final int exec(int idx, String ... args) throws CadiException, APIException, LocatorException { if (args.length-idx ": "] "); } - + boolean first = true; for (Cmd child : children) { if (!(child instanceof DeprecatedCMD)) { @@ -222,7 +222,7 @@ public abstract class Cmd { } return sb; } - + protected void error(Future future) { StringBuilder sb = new StringBuilder("Failed"); String desc = future.body(); @@ -275,7 +275,7 @@ public abstract class Cmd { pw().println(sb); } - + private void withCode(StringBuilder sb, Integer code) { sb.append(" with code "); sb.append(code); @@ -303,7 +303,7 @@ public abstract class Cmd { if ((str = access.getProperty(Cmd.STARTDATE,null))!=null) { req.setStart(Chrono.timeStamp(Date.valueOf(str))); } - + if ((str = access.getProperty(Cmd.ENDDATE,null))!=null) { req.setEnd(Chrono.timeStamp(Date.valueOf(str))); } @@ -311,7 +311,7 @@ public abstract class Cmd { /** * For Derived classes, who have ENV in this parent - * + * * @param cls * @return * @throws APIException @@ -349,17 +349,17 @@ public abstract class Cmd { pw().print('-'); } pw().println(); - + pw().format(hformat,"Date","Table","User","Memo"); for (int i=0;i items = history.getItem(); java.util.Collections.sort(items, (Comparator) (o1, o2) -> o2.getTimestamp().compare(o1.getTimestamp())); - + for (History.Item item : items) { GregorianCalendar gc = item.getTimestamp().toGregorianCalendar(); pw().format(hformat, @@ -370,7 +370,7 @@ public abstract class Cmd { } } } - + /** * Turn String Array into a | delimited String * @param options @@ -389,12 +389,12 @@ public abstract class Cmd { } return sb.toString(); } - + /** * return which index number the Option matches. - * + * * throws an Exception if not part of this Option Set - * + * * @param options * @param test * @return @@ -420,9 +420,9 @@ public abstract class Cmd { retryable.item(aafcli.prevCall.item()); retryable.lastClient=aafcli.prevCall.lastClient; } - + RET ret = aafcli.hman.same(aafcli.ss,retryable); - + // Store last call in AAFcli, because Cmds are all different instances. aafcli.prevCall = retryable; return ret; @@ -445,7 +445,7 @@ public abstract class Cmd { public String getName() { return name; } - + public void reportHead(String ... str) { pw().println(); boolean first = true; @@ -467,7 +467,7 @@ public abstract class Cmd { pw().println(); reportLine(); } - + public String reportColHead(String format, String ... args) { pw().format(format,(Object[])args); reportLine(); @@ -480,7 +480,7 @@ public abstract class Cmd { } pw().println(); } - + protected void setQueryParamsOn(Rcli rcli) { StringBuilder sb=null; String force; @@ -502,7 +502,7 @@ public abstract class Cmd { // // /** // * If Force is set, will return True once only, then revert to "FALSE". -// * +// * // * @return // */ // protected String checkForce() { @@ -525,7 +525,7 @@ public abstract class Cmd { /** * Appends shortID with Realm, but only when allowed by Organization - * @throws OrganizationException + * @throws OrganizationException */ public String fullID(String id) { if (id != null) {