Updated MountPoint implementation
[controller.git] / opendaylight / md-sal / sal-dom-broker / src / main / java / org / opendaylight / controller / sal / dom / broker / MountPointManagerImpl.xtend
index c64d1e56dd9638d28d9dee0d1d508aaead85e030..19634d79c2203fafe5aaa0156c41bf45a62f905f 100644 (file)
@@ -6,15 +6,27 @@ import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier
 import java.util.concurrent.ConcurrentMap
 import java.util.concurrent.ConcurrentHashMap
 import static com.google.common.base.Preconditions.*;
+import org.opendaylight.controller.sal.core.api.data.DataProviderService
 
 class MountPointManagerImpl implements MountProvisionService {
     
+    @Property
+    DataProviderService dataBroker;
+    
     ConcurrentMap<InstanceIdentifier,MountPointImpl> mounts = new ConcurrentHashMap();
     
     override createMountPoint(InstanceIdentifier path) {
         checkState(!mounts.containsKey(path),"Mount already created");
         val mount = new MountPointImpl(path);
+        registerMountPoint(mount);
         mounts.put(path,mount);
+        return mount;
+    }
+    
+    def registerMountPoint(MountPointImpl impl) {
+        dataBroker?.registerConfigurationReader(impl.mountPath,impl.readWrapper);
+        dataBroker?.registerOperationalReader(impl.mountPath,impl.readWrapper);
+        
     }
     
     
@@ -30,6 +42,4 @@ class MountPointManagerImpl implements MountProvisionService {
     override getMountPoint(InstanceIdentifier path) {
         mounts.get(path);
     }
-    
-    
 }