X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-dom-broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fdom%2Fbroker%2FMountPointManagerImpl.xtend;h=c3bc88ed5e4acc55a85cc3829e743ed107150174;hb=6b98de000257414b2ae9b1db708c0f7962a0f033;hp=c64d1e56dd9638d28d9dee0d1d508aaead85e030;hpb=4f76ea30ad49331ca38ce63925b3fabf8e769731;p=controller.git diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/MountPointManagerImpl.xtend b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/MountPointManagerImpl.xtend index c64d1e56dd..c3bc88ed5e 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/MountPointManagerImpl.xtend +++ b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/MountPointManagerImpl.xtend @@ -6,15 +6,42 @@ 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 +import org.opendaylight.controller.sal.core.api.mount.MountProvisionService.MountProvisionListener +import org.opendaylight.yangtools.concepts.util.ListenerRegistry class MountPointManagerImpl implements MountProvisionService { + @Property + DataProviderService dataBroker; + + val ListenerRegistry listeners = ListenerRegistry.create() + ConcurrentMap 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); + notifyMountCreated(path); + return mount; + } + + def notifyMountCreated(InstanceIdentifier identifier) { + for(listener : listeners) { + listener.instance.onMountPointCreated(identifier); + } + } + + def registerMountPoint(MountPointImpl impl) { + //dataBroker?.registerConfigurationReader(impl.mountPath,impl.readWrapper); + //dataBroker?.registerOperationalReader(impl.mountPath,impl.readWrapper); + + } + + override registerProvisionListener(MountProvisionListener listener) { + listeners.register(listener) } @@ -30,6 +57,4 @@ class MountPointManagerImpl implements MountProvisionService { override getMountPoint(InstanceIdentifier path) { mounts.get(path); } - - }