fix FirstNSbyType 05/66205/1
authorInstrumental <jonathan.gathman@att.com>
Wed, 12 Sep 2018 19:32:46 +0000 (14:32 -0500)
committerInstrumental <jonathan.gathman@att.com>
Wed, 12 Sep 2018 19:32:55 +0000 (14:32 -0500)
Issue-ID: AAF-488
Change-Id: Ie20a7f6fa53068defa11c04492c41970888d2248
Signed-off-by: Instrumental <jonathan.gathman@att.com>
auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/hl/Question.java

index e63bc52..43a88aa 100644 (file)
@@ -391,6 +391,14 @@ public class Question {
                 lookup = nsd.parent;
                 if (type.type == nsd.type) {
                     return Result.ok(nsd);
+                } else {
+                    int dot = str.lastIndexOf('.');
+                       
+                       if (dot < 0) {
+                           return Result.err(Status.ERR_NsNotFound, "No Namespace for [%s]", str);
+                       } else {
+                           return deriveFirstNsForType(trans, str.substring(0, dot),type);
+                       }
                 }
             } else {
                 return Result.err(Status.ERR_NsNotFound,"There is no valid Company Namespace for %s",str);