Deprecate sal.core.api.mount.MountProvisionListener 91/73891/4
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 10 Jul 2018 17:59:03 +0000 (19:59 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 11 Jul 2018 11:26:18 +0000 (13:26 +0200)
This interface has an exact copy in DOMMountPointListener, deprecate
it and adjust implementations to not require it.

Change-Id: If19a3a34094a9dbbc25665967074a32e562a7dca
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/BindingDOMMountPointListenerAdapter.java
opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/md/sal/dom/api/DOMMountPointService.java
opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/mount/MountProvisionListener.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/mount/DOMMountPointServiceImpl.java

index 6861ff9..a929af5 100644 (file)
@@ -10,7 +10,7 @@ package org.opendaylight.controller.md.sal.binding.impl;
 import com.google.common.base.Optional;
 import org.opendaylight.controller.md.sal.binding.api.MountPointService.MountPointListener;
 import org.opendaylight.controller.md.sal.dom.api.DOMMountPointService;
-import org.opendaylight.controller.sal.core.api.mount.MountProvisionListener;
+import org.opendaylight.mdsal.dom.api.DOMMountPointListener;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
@@ -18,10 +18,10 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.impl.codec.DeserializationException;
 
 final class BindingDOMMountPointListenerAdapter<T extends MountPointListener>
-        implements ListenerRegistration<T>, MountProvisionListener {
+        implements ListenerRegistration<T>, DOMMountPointListener {
 
     private final T listener;
-    private final ListenerRegistration<MountProvisionListener> registration;
+    private final ListenerRegistration<DOMMountPointListener> registration;
     private final BindingToNormalizedNodeCodec codec;
 
     BindingDOMMountPointListenerAdapter(final T listener, final BindingToNormalizedNodeCodec codec,
index 19eea45..df0f5b4 100644 (file)
@@ -9,6 +9,7 @@ package org.opendaylight.controller.md.sal.dom.api;
 
 import com.google.common.base.Optional;
 import org.opendaylight.controller.sal.core.api.mount.MountProvisionListener;
+import org.opendaylight.mdsal.dom.api.DOMMountPointListener;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.concepts.ObjectRegistration;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
@@ -20,8 +21,11 @@ public interface DOMMountPointService extends DOMService {
 
     DOMMountPointBuilder createMountPoint(YangInstanceIdentifier path);
 
+    @Deprecated
     ListenerRegistration<MountProvisionListener> registerProvisionListener(MountProvisionListener listener);
 
+    ListenerRegistration<DOMMountPointListener> registerProvisionListener(DOMMountPointListener listener);
+
     interface DOMMountPointBuilder {
 
         <T extends DOMService> DOMMountPointBuilder addService(Class<T> type,T impl);
index f368dbb..1f7255b 100644 (file)
@@ -5,8 +5,16 @@
  * 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.core.api.mount;
 
-public interface MountProvisionListener extends org.opendaylight.mdsal.dom.api.DOMMountPointListener {
+import org.opendaylight.mdsal.dom.api.DOMMountPointListener;
+
+/**
+ * Listener for mountpoint events.
+ *
+ * @deprecated Use {@link DOMMountPointListener} instead.
+ */
+@Deprecated
+public interface MountProvisionListener extends DOMMountPointListener {
+
 }
index 4966348..5fce0f1 100644 (file)
@@ -34,7 +34,7 @@ public class DOMMountPointServiceImpl implements DOMMountPointService {
         this(new org.opendaylight.mdsal.dom.broker.DOMMountPointServiceImpl());
     }
 
-    public DOMMountPointServiceImpl(org.opendaylight.mdsal.dom.api.DOMMountPointService delegate) {
+    public DOMMountPointServiceImpl(final org.opendaylight.mdsal.dom.api.DOMMountPointService delegate) {
         this.delegate = delegate;
     }
 
@@ -44,7 +44,7 @@ public class DOMMountPointServiceImpl implements DOMMountPointService {
         return delegateMountPoint.isPresent() ? Optional.of(convert(delegateMountPoint.get())) : Optional.absent();
     }
 
-    private DOMMountPoint convert(final org.opendaylight.mdsal.dom.api.DOMMountPoint from) {
+    private static DOMMountPoint convert(final org.opendaylight.mdsal.dom.api.DOMMountPoint from) {
         return new DOMMountPoint() {
             @Override
             public YangInstanceIdentifier getIdentifier() {
@@ -52,7 +52,7 @@ public class DOMMountPointServiceImpl implements DOMMountPointService {
             }
 
             @Override
-            public <T extends DOMService> Optional<T> getService(Class<T> cls) {
+            public <T extends DOMService> Optional<T> getService(final Class<T> cls) {
                 return from.getService(cls);
             }
 
@@ -67,7 +67,7 @@ public class DOMMountPointServiceImpl implements DOMMountPointService {
             }
 
             @Override
-            public boolean equals(Object obj) {
+            public boolean equals(final Object obj) {
                 if (this == obj) {
                     return true;
                 }
@@ -99,6 +99,11 @@ public class DOMMountPointServiceImpl implements DOMMountPointService {
         };
     }
 
+    @Override
+    public ListenerRegistration<DOMMountPointListener> registerProvisionListener(final DOMMountPointListener listener) {
+        return delegate.registerProvisionListener(listener);
+    }
+
     /**
      * Deprecated.
 

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.