From d4718965a35bf1f3ee4169f42f288dc4ddc53c11 Mon Sep 17 00:00:00 2001 From: Instrumental Date: Wed, 12 Sep 2018 14:32:46 -0500 Subject: fix FirstNSbyType Issue-ID: AAF-488 Change-Id: Ie20a7f6fa53068defa11c04492c41970888d2248 Signed-off-by: Instrumental --- .../src/main/java/org/onap/aaf/auth/dao/hl/Question.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'auth/auth-cass/src/main/java') diff --git a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/hl/Question.java b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/hl/Question.java index e63bc52a..43a88aa5 100644 --- a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/hl/Question.java +++ b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/hl/Question.java @@ -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); -- cgit 1.2.3-korg