summaryrefslogtreecommitdiffstats
path: root/auth/auth-cmd/src/main
diff options
context:
space:
mode:
authorJonathan Gathman <jonathan.gathman@att.com>2018-12-12 23:39:28 +0000
committerGerrit Code Review <gerrit@onap.org>2018-12-12 23:39:28 +0000
commitfad7e682d0a0bbb8e218dabd9381634955ff80ad (patch)
treecbf44ca3b7ce9e56ecee0a73c8a0eae1e5cadb16 /auth/auth-cmd/src/main
parent27e133b8f3f189bb41354d0624dcdb0998bd4701 (diff)
parent078467f242dd9e10c124031c4119e23f27e66a97 (diff)
Merge "Sonar Fix: List.java"
Diffstat (limited to 'auth/auth-cmd/src/main')
-rw-r--r--auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/perm/List.java34
1 files changed, 15 insertions, 19 deletions
diff --git a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/perm/List.java b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/perm/List.java
index 5df2afa2..d0481bc5 100644
--- a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/perm/List.java
+++ b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/perm/List.java
@@ -34,8 +34,20 @@ import org.onap.aaf.misc.env.APIException;
import aaf.v2_0.Perms;
public class List extends BaseCmd<Perm> {
-// private static final String LIST_PERM_DETAILS = "list permission details";
-
+ private static final String permFormat = "%-30s %-30s %-10s\n";
+ private static final Comparator<aaf.v2_0.Perm> permCompare = new Comparator<aaf.v2_0.Perm>() {
+ @Override
+ public int compare(aaf.v2_0.Perm a, aaf.v2_0.Perm b) {
+ int rc;
+ if ((rc=a.getType().compareTo(b.getType()))!=0) {
+ return rc;
+ }
+ if ((rc=a.getInstance().compareTo(b.getInstance()))!=0) {
+ return rc;
+ }
+ return a.getAction().compareTo(b.getAction());
+ }
+ };
public List(Perm parent) {
super(parent,"list");
@@ -47,7 +59,7 @@ public class List extends BaseCmd<Perm> {
}
// Package Level on purpose
abstract class ListPerms extends Retryable<Integer> {
- protected int list(Future<Perms> fp,String header, String parentPerm) throws CadiException, APIException {
+ protected int list(Future<Perms> fp,String header, String parentPerm) throws CadiException {
if (fp.get(AAFcli.timeout())) {
report(fp,header, parentPerm);
} else {
@@ -56,22 +68,6 @@ public class List extends BaseCmd<Perm> {
return fp.code();
}
}
-
- private static final Comparator<aaf.v2_0.Perm> permCompare = new Comparator<aaf.v2_0.Perm>() {
- @Override
- public int compare(aaf.v2_0.Perm a, aaf.v2_0.Perm b) {
- int rc;
- if ((rc=a.getType().compareTo(b.getType()))!=0) {
- return rc;
- }
- if ((rc=a.getInstance().compareTo(b.getInstance()))!=0) {
- return rc;
- }
- return a.getAction().compareTo(b.getAction());
- }
- };
-
- private static final String permFormat = "%-30s %-30s %-10s\n";
void report(Future<Perms> fp, String ... str) {
reportHead(str);