diff options
Diffstat (limited to 'cps-service/src/main/java')
-rw-r--r-- | cps-service/src/main/java/org/onap/cps/notification/NotificationService.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/cps-service/src/main/java/org/onap/cps/notification/NotificationService.java b/cps-service/src/main/java/org/onap/cps/notification/NotificationService.java index 5ad59df2aa..5e26a22045 100644 --- a/cps-service/src/main/java/org/onap/cps/notification/NotificationService.java +++ b/cps-service/src/main/java/org/onap/cps/notification/NotificationService.java @@ -37,8 +37,6 @@ import org.springframework.stereotype.Service; @Slf4j public class NotificationService { - private static final String ROOT_NODE_XPATH = "/"; - private NotificationProperties notificationProperties; private NotificationPublisher notificationPublisher; private CpsDataUpdatedEventFactory cpsDataUpdatedEventFactory; @@ -120,7 +118,15 @@ public class NotificationService { } private Operation getRootNodeOperation(final String xpath, final Operation operation) { - return ROOT_NODE_XPATH.equals(xpath) ? operation : Operation.UPDATE; + return isRootXpath(xpath) || isRootContainerNodeXpath(xpath) ? operation : Operation.UPDATE; + } + + private static boolean isRootXpath(final String xpath) { + return "/".equals(xpath) || "".equals(xpath); + } + + private static boolean isRootContainerNodeXpath(final String xpath) { + return 0 == xpath.lastIndexOf('/'); } } |