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%2FBackwardsCompatibleMountPoint.java;h=d837d75ddc09aecef00a9d2dc7fc78e5be89890c;hb=bdcd6c4baea3357499a1fcdff459259b56373baa;hp=c2329ef4b0583a930b9576dad49c16ecd524602a;hpb=a6a97a57081df63432dde5a6b1613eb779b74d79;p=controller.git diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/BackwardsCompatibleMountPoint.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/BackwardsCompatibleMountPoint.java index c2329ef4b0..d837d75ddc 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/BackwardsCompatibleMountPoint.java +++ b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/BackwardsCompatibleMountPoint.java @@ -67,8 +67,8 @@ import org.opendaylight.yangtools.concepts.Registration; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.common.RpcResult; import org.opendaylight.yangtools.yang.data.api.CompositeNode; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; import org.opendaylight.yangtools.yang.model.api.Module; import org.opendaylight.yangtools.yang.model.api.SchemaContext; @@ -77,9 +77,9 @@ import org.opendaylight.yangtools.yang.model.api.SchemaServiceListener; public class BackwardsCompatibleMountPoint implements MountProvisionInstance, SchemaContextProvider, SchemaService { private final DataProviderService dataReader; - private final DataReader readWrapper; + private final DataReader readWrapper; - private final InstanceIdentifier mountPath; + private final YangInstanceIdentifier mountPath; private final NotificationPublishService notificationPublishService; private final RpcProvisionRegistry rpcs; @@ -87,7 +87,7 @@ public class BackwardsCompatibleMountPoint implements MountProvisionInstance, Sc private SchemaContext schemaContext; - public BackwardsCompatibleMountPoint(final InstanceIdentifier path, final DOMMountPointService.DOMMountPointBuilder mountPointBuilder) { + public BackwardsCompatibleMountPoint(final YangInstanceIdentifier path, final DOMMountPointService.DOMMountPointBuilder mountPointBuilder) { this.mountPath = Preconditions.checkNotNull(path); Preconditions.checkNotNull(mountPointBuilder); @@ -105,7 +105,7 @@ public class BackwardsCompatibleMountPoint implements MountProvisionInstance, Sc mountPointBuilder.register(); } - public BackwardsCompatibleMountPoint(final InstanceIdentifier path, final DOMMountPoint mount) { + public BackwardsCompatibleMountPoint(final YangInstanceIdentifier path, final DOMMountPoint mount) { this.mountPath = Preconditions.checkNotNull(path); Preconditions.checkNotNull(mount); @@ -169,29 +169,29 @@ public class BackwardsCompatibleMountPoint implements MountProvisionInstance, Sc } // TODO Read wrapper is never used ... same in org.opendaylight.controller.sal.dom.broker.MountPointImpl - public DataReader getReadWrapper() { + public DataReader getReadWrapper() { return readWrapper; } @Override - public CompositeNode readConfigurationData(final InstanceIdentifier path) { + public CompositeNode readConfigurationData(final YangInstanceIdentifier path) { return dataReader.readConfigurationData(path); } @Override - public CompositeNode readOperationalData(final InstanceIdentifier path) { + public CompositeNode readOperationalData(final YangInstanceIdentifier path) { return dataReader.readOperationalData(path); } @Override public Registration registerOperationalReader( - final InstanceIdentifier path, final DataReader reader) { + final YangInstanceIdentifier path, final DataReader reader) { return dataReader.registerOperationalReader(path, reader); } @Override public Registration registerConfigurationReader( - final InstanceIdentifier path, final DataReader reader) { + final YangInstanceIdentifier path, final DataReader reader) { return dataReader.registerConfigurationReader(path, reader); } @@ -237,14 +237,14 @@ public class BackwardsCompatibleMountPoint implements MountProvisionInstance, Sc } @Override - public ListenerRegistration registerDataChangeListener(final InstanceIdentifier path, + public ListenerRegistration registerDataChangeListener(final YangInstanceIdentifier path, final DataChangeListener listener) { return dataReader.registerDataChangeListener(path, listener); } @Override public Registration registerCommitHandler( - final InstanceIdentifier path, final DataCommitHandler commitHandler) { + final YangInstanceIdentifier path, final DataCommitHandler commitHandler) { return dataReader.registerCommitHandler(path, commitHandler); } @@ -280,19 +280,19 @@ public class BackwardsCompatibleMountPoint implements MountProvisionInstance, Sc } } - class ReadWrapper implements DataReader { - private InstanceIdentifier shortenPath(final InstanceIdentifier path) { - InstanceIdentifier ret = null; + class ReadWrapper implements DataReader { + private YangInstanceIdentifier shortenPath(final YangInstanceIdentifier path) { + YangInstanceIdentifier ret = null; if(mountPath.contains(path)) { final List newArgs = path.getPath().subList(mountPath.getPath().size(), path.getPath().size()); - ret = InstanceIdentifier.create(newArgs); + ret = YangInstanceIdentifier.create(newArgs); } return ret; } @Override - public CompositeNode readConfigurationData(final InstanceIdentifier path) { - final InstanceIdentifier newPath = shortenPath(path); + public CompositeNode readConfigurationData(final YangInstanceIdentifier path) { + final YangInstanceIdentifier newPath = shortenPath(path); if(newPath == null) { return null; } @@ -300,8 +300,8 @@ public class BackwardsCompatibleMountPoint implements MountProvisionInstance, Sc } @Override - public CompositeNode readOperationalData(final InstanceIdentifier path) { - final InstanceIdentifier newPath = shortenPath(path); + public CompositeNode readOperationalData(final YangInstanceIdentifier path) { + final YangInstanceIdentifier newPath = shortenPath(path); if(newPath == null) { return null; } @@ -310,13 +310,13 @@ public class BackwardsCompatibleMountPoint implements MountProvisionInstance, Sc } @Override - public ListenerRegistration>> registerCommitHandlerListener( - final RegistrationListener> commitHandlerListener) { + public ListenerRegistration>> registerCommitHandlerListener( + final RegistrationListener> commitHandlerListener) { return dataReader.registerCommitHandlerListener(commitHandlerListener); } @Override - public > ListenerRegistration registerRouteChangeListener( + public > ListenerRegistration registerRouteChangeListener( final L listener) { return rpcs.registerRouteChangeListener(listener); } @@ -344,7 +344,7 @@ public class BackwardsCompatibleMountPoint implements MountProvisionInstance, Sc } @Override - public ListenerRegistration registerDataChangeListener(final LogicalDatastoreType store, final InstanceIdentifier path, final DOMDataChangeListener listener, final DataChangeScope triggeringScope) { + public ListenerRegistration registerDataChangeListener(final LogicalDatastoreType store, final YangInstanceIdentifier path, final DOMDataChangeListener listener, final DataChangeScope triggeringScope) { throw new UnsupportedOperationException("Register data listener not supported for mount point"); } @@ -380,7 +380,7 @@ public class BackwardsCompatibleMountPoint implements MountProvisionInstance, Sc } @Override - public ListenableFuture>> read(final LogicalDatastoreType store, final InstanceIdentifier path) { + public ListenableFuture>> read(final LogicalDatastoreType store, final YangInstanceIdentifier path) { CompositeNode rawData = null; @@ -396,7 +396,7 @@ public class BackwardsCompatibleMountPoint implements MountProvisionInstance, Sc } Preconditions.checkNotNull(rawData, "Unable to read %s data on path %s", store, path); - final Map.Entry> normalized = normalizer.toNormalized(path, rawData); + final Map.Entry> normalized = normalizer.toNormalized(path, rawData); final Optional> normalizedNodeOptional = Optional.>fromNullable(normalized.getValue()); return com.google.common.util.concurrent.Futures.immediateFuture(normalizedNodeOptional); } @@ -424,10 +424,10 @@ public class BackwardsCompatibleMountPoint implements MountProvisionInstance, Sc } @Override - public void put(final LogicalDatastoreType store, final InstanceIdentifier path, final NormalizedNode data) { + public void put(final LogicalDatastoreType store, final YangInstanceIdentifier path, final NormalizedNode data) { final CompositeNode legacyData = dataNormalizer.toLegacy(path, data); try { - final InstanceIdentifier legacyPath = dataNormalizer.toLegacy(path); + final YangInstanceIdentifier legacyPath = dataNormalizer.toLegacy(path); switch (store) { case CONFIGURATION: { @@ -443,15 +443,15 @@ public class BackwardsCompatibleMountPoint implements MountProvisionInstance, Sc } @Override - public void merge(final LogicalDatastoreType store, final InstanceIdentifier path, final NormalizedNode data) { + public void merge(final LogicalDatastoreType store, final YangInstanceIdentifier path, final NormalizedNode data) { // TODO not supported throw new UnsupportedOperationException("Merge not supported for mount point"); } @Override - public void delete(final LogicalDatastoreType store, final InstanceIdentifier path) { + public void delete(final LogicalDatastoreType store, final YangInstanceIdentifier path) { try { - final InstanceIdentifier legacyPath = dataNormalizer.toLegacy(path); + final YangInstanceIdentifier legacyPath = dataNormalizer.toLegacy(path); switch (store) { case CONFIGURATION: { @@ -508,7 +508,7 @@ public class BackwardsCompatibleMountPoint implements MountProvisionInstance, Sc } @Override - public ListenableFuture>> read(final LogicalDatastoreType store, final InstanceIdentifier path) { + public ListenableFuture>> read(final LogicalDatastoreType store, final YangInstanceIdentifier path) { return new BackwardsCompatibleReadTransaction(dataReader, dataNormalizer).read(store, path); } @@ -518,17 +518,17 @@ public class BackwardsCompatibleMountPoint implements MountProvisionInstance, Sc } @Override - public void put(final LogicalDatastoreType store, final InstanceIdentifier path, final NormalizedNode data) { + public void put(final LogicalDatastoreType store, final YangInstanceIdentifier path, final NormalizedNode data) { delegateWriteTx.put(store, path, data); } @Override - public void merge(final LogicalDatastoreType store, final InstanceIdentifier path, final NormalizedNode data) { + public void merge(final LogicalDatastoreType store, final YangInstanceIdentifier path, final NormalizedNode data) { delegateWriteTx.merge(store, path, data); } @Override - public void delete(final LogicalDatastoreType store, final InstanceIdentifier path) { + public void delete(final LogicalDatastoreType store, final YangInstanceIdentifier path) { delegateWriteTx.delete(store, path); }