BUG 3121 - destroy topic implementation
[controller.git] / opendaylight / md-sal / messagebus-impl / src / main / java / org / opendaylight / controller / messagebus / eventsources / netconf / NotificationTopicRegistration.java
index 7812bd223d6759a2f767fe5606e36a15154168bb..c12b67ed24750ba207ebe74b78e9a5f42df9a2c4 100644 (file)
@@ -11,10 +11,14 @@ import java.util.ArrayList;
 
 import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.messagebus.eventaggregator.rev141202.TopicId;
 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 public abstract class NotificationTopicRegistration implements AutoCloseable {
 
+    private static final Logger LOG = LoggerFactory.getLogger(NotificationTopicRegistration.class);
+
     public enum NotificationSourceType{
         NetconfDeviceStream,
         ConnectionStatusChange;
@@ -54,6 +58,14 @@ public abstract class NotificationTopicRegistration implements AutoCloseable {
         return notificationUrnPrefix;
     }
 
+    public boolean checkNotificationPath(SchemaPath notificationPath){
+        if(notificationPath == null){
+            return false;
+        }
+        String nameSpace = notificationPath.getLastComponent().toString();
+        LOG.debug("CheckNotification - name space {} - NotificationUrnPrefix {}", nameSpace, getNotificationUrnPrefix());
+        return nameSpace.startsWith(getNotificationUrnPrefix());
+    }
     abstract void activateNotificationSource();
 
     abstract void deActivateNotificationSource();