aboutsummaryrefslogtreecommitdiffstats
path: root/cps-ncmp-service/src/main/java
diff options
context:
space:
mode:
authoregernug <gerard.nugent@est.tech>2024-11-08 13:34:00 +0000
committeregernug <gerard.nugent@est.tech>2024-11-12 11:43:56 +0000
commitaf283af05c69a93304935e152d7c83a23ac82b1e (patch)
tree09244e62acc1f52402b649812748ba21a3d23036 /cps-ncmp-service/src/main/java
parent3399fdea15b9c7e6d05148f82f9ceeeee813b84a (diff)
Hashmark support in 3gpp objects
NCMP should cut off the part after the # of an alternateid and use only the first part in CPS match check, but send the complete request to the DMI plugin. Issue-ID: CPS-2485 Change-Id: Icc1442f2be9545036619043692c3559ffadecb0d Signed-off-by: egernug <gerard.nugent@est.tech>
Diffstat (limited to 'cps-ncmp-service/src/main/java')
-rw-r--r--cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/utils/AlternateIdMatcher.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/utils/AlternateIdMatcher.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/utils/AlternateIdMatcher.java
index c526dfb297..9facd630a2 100644
--- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/utils/AlternateIdMatcher.java
+++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/utils/AlternateIdMatcher.java
@@ -38,14 +38,15 @@ public class AlternateIdMatcher {
/**
* Get data node that matches longest alternate id by removing elements (as defined by the separator string)
- * from right to left.
+ * from right to left. If alternate id contains a hash then all elements after that hash are ignored.
*
* @param alternateId alternate ID
* @param separator a string that separates each element from the next.
* @return data node
*/
public DataNode getCmHandleDataNodeByLongestMatchingAlternateId(final String alternateId, final String separator) {
- String bestMatch = alternateId;
+ final String[] splitPath = alternateId.split("#", 2);
+ String bestMatch = splitPath[0];
while (StringUtils.isNotEmpty(bestMatch)) {
try {
return inventoryPersistence.getCmHandleDataNodeByAlternateId(bestMatch);