X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=cadi%2Faaf%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faaf%2Fcadi%2Faaf%2FAAFPermission.java;h=4a4863582c5bdca7fd4591376cef7b79326237c6;hb=refs%2Fchanges%2F24%2F97124%2F3;hp=8c39e44db42e23a705bb35e3230b5f03e60751a4;hpb=bdce7667a6e272e2fa32e298d957a0d9090c5bc9;p=aaf%2Fauthz.git diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/AAFPermission.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/AAFPermission.java index 8c39e44d..4a486358 100644 --- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/AAFPermission.java +++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/AAFPermission.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. @@ -30,7 +30,7 @@ import org.onap.aaf.misc.env.util.Split; /** * A Class that understands the AAF format of Permission (name/type/action) * or String "name|type|action" - * + * * @author Jonathan * */ @@ -38,7 +38,7 @@ public class AAFPermission implements Permission { private static final List NO_ROLES; protected String ns,type,instance,action,key; private List roles; - + static { NO_ROLES = new ArrayList<>(); } @@ -71,15 +71,15 @@ public class AAFPermission implements Permission { } this.roles = roles==null?NO_ROLES:roles; } - + /** * Match a Permission * if Permission is Fielded type "Permission", we use the fields * otherwise, we split the Permission with '|' - * + * * when the type or action starts with REGEX indicator character ( ! ), * then it is evaluated as a regular expression. - * + * * If you want a simple field comparison, it is faster without REGEX */ public boolean match(Permission p) { @@ -100,7 +100,7 @@ public class AAFPermission implements Permission { aafInstance = ap.getInstance(); aafAction = ap.getAction(); } else { - // Permission is concatenated together: separated by + // Permission is concatenated together: separated by String[] aaf = Split.splitTrim('|', p.getKey()); switch(aaf.length) { case 1: @@ -116,13 +116,13 @@ public class AAFPermission implements Permission { case 3: aafNS = aaf[0]; aafType = aaf[1]; - aafInstance = aaf[2]; + aafInstance = aaf[2]; aafAction = "*"; break; default: aafNS = aaf[0]; aafType = aaf[1]; - aafInstance = aaf[2]; + aafInstance = aaf[2]; aafAction = aaf[3]; break; } @@ -157,15 +157,15 @@ public class AAFPermission implements Permission { public String getFullType() { return ns + '.' + type; } - + public String getInstance() { return instance; } - + public String getAction() { return action; } - + public String getKey() { return key; } @@ -183,7 +183,7 @@ public class AAFPermission implements Permission { public String toString() { return "AAFPermission:" + "\n\tNS: " + ns + - "\n\tType: " + type + + "\n\tType: " + type + "\n\tInstance: " + instance + "\n\tAction: " + action + "\n\tKey: " + key;