summaryrefslogtreecommitdiffstats
path: root/auth/auth-cass/src/main
diff options
context:
space:
mode:
authorInstrumental <jonathan.gathman@att.com>2018-09-12 14:32:46 -0500
committerInstrumental <jonathan.gathman@att.com>2018-09-12 14:32:55 -0500
commitd4718965a35bf1f3ee4169f42f288dc4ddc53c11 (patch)
tree6a68e76c7f26dbdb8fca1f68b7a275daf881057b /auth/auth-cass/src/main
parent812e78799e0d3f6659ae478859035b78bc1ff027 (diff)
fix FirstNSbyType
Issue-ID: AAF-488 Change-Id: Ie20a7f6fa53068defa11c04492c41970888d2248 Signed-off-by: Instrumental <jonathan.gathman@att.com>
Diffstat (limited to 'auth/auth-cass/src/main')
-rw-r--r--auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/hl/Question.java8
1 files changed, 8 insertions, 0 deletions
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);