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=023f906a67e90f495ae610ff0190687ecab54462;hb=c61d22e4dc73fdaba09aa8c0b189ea7459679e03;hp=19634d79c2203fafe5aaa0156c41bf45a62f905f;hpb=d542617f3486541cf9937009fb6aa1e3f2c9f0e2;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 19634d79c2..023f906a67 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 @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ package org.opendaylight.controller.sal.dom.broker @@ -7,12 +14,16 @@ 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) { @@ -20,13 +31,23 @@ class MountPointManagerImpl implements MountProvisionService { 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); - + //dataBroker?.registerConfigurationReader(impl.mountPath,impl.readWrapper); + //dataBroker?.registerOperationalReader(impl.mountPath,impl.readWrapper); + } + + override registerProvisionListener(MountProvisionListener listener) { + listeners.register(listener) }