Bug 8568: Remove deprecated MountProviderService APIs 74/58074/2
authorTom Pantelis <tompantelis@gmail.com>
Wed, 31 May 2017 17:48:34 +0000 (13:48 -0400)
committerTom Pantelis <tompantelis@gmail.com>
Fri, 2 Jun 2017 15:12:41 +0000 (11:12 -0400)
Removed the MountProviderService and associated APIs and implementations.

Change-Id: I0cfde4f9d6204c4bcee1b1fc7028402b9290c6e4
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/mount/MountInstance.java [deleted file]
opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/mount/MountProviderInstance.java [deleted file]
opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/mount/MountProviderService.java [deleted file]
opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/mount/MountService.java [deleted file]
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/compat/HydrogenMountInstanceAdapter.java [deleted file]
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/compat/HydrogenMountPointServiceAdapter.java [deleted file]
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/compat/HydrogenMountProvisionServiceAdapter.java [deleted file]

diff --git a/opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/mount/MountInstance.java b/opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/mount/MountInstance.java
deleted file mode 100644 (file)
index 8d12725..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (c) 2013 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.binding.api.mount;
-
-import org.opendaylight.controller.sal.binding.api.NotificationService;
-import org.opendaylight.controller.sal.binding.api.RpcConsumerRegistry;
-import org.opendaylight.yangtools.concepts.Identifiable;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
-public interface MountInstance //
-        extends //
-        RpcConsumerRegistry, //
-        Identifiable<InstanceIdentifier<?>>, //
-        NotificationService {
-
-}
diff --git a/opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/mount/MountProviderInstance.java b/opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/mount/MountProviderInstance.java
deleted file mode 100644 (file)
index d883495..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * 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.binding.api.mount;
-
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
-import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
-
-/**
- * Provider's version of Mount Point, this version allows access to MD-SAL
- * services specific for this mountpoint and registration / provision of
- * interfaces for mount point.
- *
- * @author ttkacik
- *
- */
-public interface MountProviderInstance //
-        extends //
-        MountInstance, //
-        RpcProviderRegistry, //
-        NotificationProviderService {
-
-}
diff --git a/opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/mount/MountProviderService.java b/opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/mount/MountProviderService.java
deleted file mode 100644 (file)
index 9eb704f..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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.binding.api.mount;
-
-import java.util.EventListener;
-
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
-/**
- * Provider MountProviderService, this version allows access to MD-SAL services
- * specific for this mountpoint and registration / provision of interfaces for
- * mount point.
- *
- * @author ttkacik
- *
- */
-public interface MountProviderService extends MountService {
-
-    @Override
-    MountProviderInstance getMountPoint(InstanceIdentifier<?> path);
-
-    MountProviderInstance createMountPoint(InstanceIdentifier<?> path);
-
-    MountProviderInstance createOrGetMountPoint(InstanceIdentifier<?> path);
-
-    ListenerRegistration<MountProvisionListener> registerProvisionListener(MountProvisionListener listener);
-
-    interface MountProvisionListener extends EventListener {
-
-        void onMountPointCreated(InstanceIdentifier<?> path);
-
-        void onMountPointRemoved(InstanceIdentifier<?> path);
-
-    }
-}
diff --git a/opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/mount/MountService.java b/opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/mount/MountService.java
deleted file mode 100644 (file)
index 1644c40..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Copyright (c) 2013 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.binding.api.mount;
-
-import org.opendaylight.controller.sal.binding.api.BindingAwareService;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
-public interface MountService extends BindingAwareService {
-
-    MountInstance getMountPoint(InstanceIdentifier<?> path);
-
-}
diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/compat/HydrogenMountInstanceAdapter.java b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/compat/HydrogenMountInstanceAdapter.java
deleted file mode 100644 (file)
index 3a4d785..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright (c) 2015 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.md.sal.binding.compat;
-
-import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.ClassToInstanceMap;
-import com.google.common.collect.ImmutableClassToInstanceMap;
-import java.util.concurrent.ExecutorService;
-import org.opendaylight.controller.md.sal.binding.api.MountPoint;
-import org.opendaylight.controller.md.sal.common.api.routing.RouteChangeListener;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RpcRegistration;
-import org.opendaylight.controller.sal.binding.api.BindingAwareService;
-import org.opendaylight.controller.sal.binding.api.NotificationListener;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
-import org.opendaylight.controller.sal.binding.api.NotificationService;
-import org.opendaylight.controller.sal.binding.api.RpcConsumerRegistry;
-import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
-import org.opendaylight.controller.sal.binding.api.mount.MountProviderInstance;
-import org.opendaylight.controller.sal.binding.api.rpc.RpcContextIdentifier;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.binding.Notification;
-import org.opendaylight.yangtools.yang.binding.RpcService;
-
-@Deprecated
-public class HydrogenMountInstanceAdapter implements MountProviderInstance {
-
-    private final ClassToInstanceMap<BindingAwareService> services;
-    private final InstanceIdentifier<?> identifier;
-
-
-    public HydrogenMountInstanceAdapter(final MountPoint key) {
-        this.identifier = key.getIdentifier();
-        final ImmutableClassToInstanceMap.Builder<BindingAwareService> builder = ImmutableClassToInstanceMap.builder();
-
-        final Optional<org.opendaylight.controller.md.sal.binding.api.NotificationService> notificationService = key.getService(org.opendaylight.controller.md.sal.binding.api.NotificationService.class);
-        if(notificationService.isPresent()) {
-            builder.put(NotificationService.class, new HeliumNotificationServiceAdapter(notificationService.get()));
-        }
-        final Optional<RpcConsumerRegistry> rpcRegistry = key.getService(RpcConsumerRegistry.class);
-        if(rpcRegistry.isPresent()) {
-            builder.put(RpcConsumerRegistry.class, rpcRegistry.get());
-        }
-        services = builder.build();
-    }
-
-
-    private <T extends BindingAwareService> T service(final Class<T> service) {
-        final T potential = services.getInstance(service);
-        Preconditions.checkState(potential != null, "Service %s is not supported by mount point %s",service,this.getIdentifier());
-        return potential;
-    }
-
-    @Override
-    public <T extends RpcService> T getRpcService(final Class<T> serviceInterface) {
-        return service(RpcConsumerRegistry.class).getRpcService(serviceInterface);
-    }
-
-    @Override
-    public InstanceIdentifier<?> getIdentifier() {
-        return identifier;
-    }
-
-    @Override
-    public <T extends Notification> ListenerRegistration<NotificationListener<T>> registerNotificationListener(
-            final Class<T> notificationType, final NotificationListener<T> listener) {
-        return service(NotificationService.class).registerNotificationListener(notificationType, listener);
-    }
-
-    @Override
-    public ListenerRegistration<org.opendaylight.yangtools.yang.binding.NotificationListener> registerNotificationListener(
-            final org.opendaylight.yangtools.yang.binding.NotificationListener listener) {
-        return service(NotificationService.class).registerNotificationListener(listener);
-    }
-
-    @Override
-    public <T extends RpcService> RoutedRpcRegistration<T> addRoutedRpcImplementation(final Class<T> serviceInterface,
-            final T implementation) throws IllegalStateException {
-        return service(RpcProviderRegistry.class).addRoutedRpcImplementation(serviceInterface, implementation);
-    }
-
-    @Override
-    public <T extends RpcService> RpcRegistration<T> addRpcImplementation(final Class<T> serviceInterface, final T implementation)
-            throws IllegalStateException {
-        return service(RpcProviderRegistry.class).addRpcImplementation(serviceInterface, implementation);
-    }
-
-    @Override
-    public void publish(final Notification notification) {
-        service(NotificationProviderService.class).publish(notification);
-    }
-
-    @Override
-    public void publish(final Notification notification, final ExecutorService executor) {
-        service(NotificationProviderService.class).publish(notification);
-    }
-
-    @Override
-    public ListenerRegistration<NotificationInterestListener> registerInterestListener(
-            final NotificationInterestListener interestListener) {
-        return service(NotificationProviderService.class).registerInterestListener(interestListener);
-    }
-
-    @Override
-    public <L extends RouteChangeListener<RpcContextIdentifier, InstanceIdentifier<?>>> ListenerRegistration<L> registerRouteChangeListener(
-            final L arg0) {
-        return service(RpcProviderRegistry.class).registerRouteChangeListener(arg0);
-    }
-
-}
diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/compat/HydrogenMountPointServiceAdapter.java b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/compat/HydrogenMountPointServiceAdapter.java
deleted file mode 100644 (file)
index cecd461..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2015 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.md.sal.binding.compat;
-
-import com.google.common.base.Optional;
-import com.google.common.cache.CacheBuilder;
-import com.google.common.cache.CacheLoader;
-import com.google.common.cache.LoadingCache;
-import org.opendaylight.controller.md.sal.binding.api.MountPoint;
-import org.opendaylight.controller.md.sal.binding.api.MountPointService;
-import org.opendaylight.controller.sal.binding.api.mount.MountService;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
-@Deprecated
-public class HydrogenMountPointServiceAdapter implements MountService {
-
-    private final MountPointService delegate;
-
-    public HydrogenMountPointServiceAdapter(final MountPointService mountService) {
-        delegate = mountService;
-    }
-
-    private final LoadingCache<MountPoint, HydrogenMountInstanceAdapter> mountAdapters = CacheBuilder.newBuilder().weakKeys()
-            .build(new CacheLoader<MountPoint, HydrogenMountInstanceAdapter>() {
-
-                @Override
-                public HydrogenMountInstanceAdapter load(final MountPoint key) throws Exception {
-                    return new HydrogenMountInstanceAdapter(key);
-                }
-            });
-
-    @Override
-    public HydrogenMountInstanceAdapter getMountPoint(final InstanceIdentifier<?> path) {
-        final Optional<MountPoint> mount = delegate.getMountPoint(path);
-        if (mount.isPresent()) {
-            return mountAdapters.getUnchecked(mount.get());
-        }
-        return null;
-    }
-
-    MountPointService getDelegate() {
-        return delegate;
-    }
-}
diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/compat/HydrogenMountProvisionServiceAdapter.java b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/compat/HydrogenMountProvisionServiceAdapter.java
deleted file mode 100644 (file)
index b2ee1a5..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2015 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.md.sal.binding.compat;
-
-import org.opendaylight.controller.md.sal.binding.api.MountPointService;
-import org.opendaylight.controller.sal.binding.api.mount.MountProviderInstance;
-import org.opendaylight.controller.sal.binding.api.mount.MountProviderService;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-@Deprecated
-public class HydrogenMountProvisionServiceAdapter extends HydrogenMountPointServiceAdapter implements MountProviderService {
-
-    public HydrogenMountProvisionServiceAdapter(final MountPointService mountService) {
-        super(mountService);
-    }
-
-    @Override
-    public MountProviderInstance createMountPoint(final InstanceIdentifier<?> path) {
-        throw new UnsupportedOperationException("Not implemented");
-    }
-
-    @Override
-    public MountProviderInstance createOrGetMountPoint(final InstanceIdentifier<?> path) {
-        return getMountPoint(path);
-    }
-
-    @Override
-    public ListenerRegistration<MountProvisionListener> registerProvisionListener(final MountProvisionListener listener) {
-        return new ListenerRegistration<MountProvisionListener>() {
-
-            @Override
-            public MountProvisionListener getInstance() {
-                return listener;
-            }
-
-            @Override
-            public void close() {
-            }
-        };
-    }
-
-}

©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.