Remove sal.core.api.BrokerService 90/73890/1
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 10 Jul 2018 17:41:28 +0000 (19:41 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 10 Jul 2018 17:49:22 +0000 (19:49 +0200)
This interface has been long deprecated and it is not really used
anywhere. Remove it.

Change-Id: I8dcee98f19d80df4532891f73776dc4c268ef025
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 files changed:
opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/util/BindingTestContext.java
opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/md/sal/dom/api/DOMDataBroker.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/md/sal/dom/api/DOMNotificationPublishService.java
opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/md/sal/dom/api/DOMNotificationService.java
opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/md/sal/dom/api/DOMService.java
opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/BrokerService.java [deleted file]
opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/package-info.java [deleted file]
opendaylight/md-sal/sal-dom-broker/pom.xml
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/AbstractBrokerServiceProxy.java [deleted file]
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/DOMDataBrokerProxy.java [deleted file]
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/DOMMountPointServiceProxy.java [deleted file]
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/ProxyFactory.java [deleted file]

index a5d0b261f1d28c0b657373dfbe31b2a88b88fbf0..99385b0325f0e3626495b15aa1d811c04c8b135b 100644 (file)
@@ -10,10 +10,8 @@ package org.opendaylight.controller.sal.binding.test.util;
 import static com.google.common.base.Preconditions.checkState;
 
 import com.google.common.annotations.Beta;
-import com.google.common.collect.ClassToInstanceMap;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.MutableClassToInstanceMap;
 import com.google.common.util.concurrent.ListeningExecutorService;
 import com.google.common.util.concurrent.MoreExecutors;
 import javassist.ClassPool;
@@ -45,7 +43,6 @@ import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore;
 import org.opendaylight.controller.sal.binding.api.RpcConsumerRegistry;
 import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
 import org.opendaylight.controller.sal.binding.impl.RootBindingAwareBroker;
-import org.opendaylight.controller.sal.core.api.BrokerService;
 import org.opendaylight.controller.sal.core.spi.data.DOMStore;
 import org.opendaylight.mdsal.binding.dom.codec.gen.impl.DataObjectSerializerGenerator;
 import org.opendaylight.mdsal.binding.dom.codec.gen.impl.StreamWriterGenerator;
@@ -208,9 +205,6 @@ public class BindingTestContext implements AutoCloseable {
         org.opendaylight.mdsal.dom.broker.DOMRpcRouter delegate =
                 org.opendaylight.mdsal.dom.broker.DOMRpcRouter.newInstance(mockSchemaService);
         this.domRouter = new DOMRpcRouter(delegate, delegate);
-
-        final ClassToInstanceMap<BrokerService> services = MutableClassToInstanceMap.create();
-        services.put(DOMRpcService.class, this.domRouter);
     }
 
     public void startBindingNotificationBroker() {
index b841509490e4abb4ac3d442955fd8bfeefb78c0e..9507ac5d4b2a226cbc4d36551dfb7cefc54bfd79 100644 (file)
@@ -5,13 +5,11 @@
  * 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.dom.api;
 
 import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker;
 import org.opendaylight.controller.md.sal.common.api.data.TransactionChainFactory;
 import org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener;
-import org.opendaylight.controller.sal.core.api.BrokerService;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 
@@ -22,11 +20,10 @@ import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
  * <p>
  * This interface is type capture of generic interfaces and returns type captures
  * of results for client-code convenience.
- *
  */
 public interface DOMDataBroker extends
         AsyncDataBroker<YangInstanceIdentifier, NormalizedNode<?, ?>>,
-        TransactionChainFactory<YangInstanceIdentifier, NormalizedNode<?, ?>>, BrokerService,
+        TransactionChainFactory<YangInstanceIdentifier, NormalizedNode<?, ?>>,
             DOMExtensibleService<DOMDataBroker, DOMDataBrokerExtension> {
 
     @Override
index 8880ae01710559af23f70bc4cfd9472dd175f065..19eea457cc30c9da571f90d304c33999a76a01bc 100644 (file)
@@ -5,18 +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.md.sal.dom.api;
 
 import com.google.common.base.Optional;
-import org.opendaylight.controller.sal.core.api.BrokerService;
 import org.opendaylight.controller.sal.core.api.mount.MountProvisionListener;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.concepts.ObjectRegistration;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 
-public interface DOMMountPointService extends BrokerService {
+public interface DOMMountPointService extends DOMService {
 
     Optional<DOMMountPoint> getMountPoint(YangInstanceIdentifier path);
 
index 3b6a88fe91de9c94a8d10554b021adafa620ebd0..02334464275ef3f8eb1f8ee59fb3dd95998991c3 100644 (file)
@@ -12,7 +12,6 @@ import com.google.common.util.concurrent.ListenableFuture;
 import java.util.concurrent.TimeUnit;
 import javax.annotation.Nonnegative;
 import javax.annotation.Nonnull;
-import org.opendaylight.controller.sal.core.api.BrokerService;
 
 /**
  * A {@link DOMService} which allows its user to send {@link DOMNotification}s. It
@@ -24,7 +23,7 @@ import org.opendaylight.controller.sal.core.api.BrokerService;
  *   the caller to specify that it should never wait, or put an upper bound on how
  *   long it is going to wait.
  */
-public interface DOMNotificationPublishService extends DOMService, BrokerService {
+public interface DOMNotificationPublishService extends DOMService {
     /**
      * Well-known value indicating that the implementation is currently not
      * able to accept a notification.
index 158d9e88c6d9f72c55a2194bba5cac77c5fece5b..3edde3c8cd721dc7b9c0c2c76ece498f17f67aab 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.controller.md.sal.dom.api;
 
 import java.util.Collection;
 import javax.annotation.Nonnull;
-import org.opendaylight.controller.sal.core.api.BrokerService;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
 
@@ -17,7 +16,7 @@ import org.opendaylight.yangtools.yang.model.api.SchemaPath;
  * A {@link DOMService} which allows its users to subscribe to receive
  * {@link DOMNotification}s.
  */
-public interface DOMNotificationService extends DOMService, BrokerService {
+public interface DOMNotificationService extends DOMService {
     /**
      * Register a {@link DOMNotificationListener} to receive a set of notifications. As with
      * other ListenerRegistration-based interfaces, registering an instance multiple times
index 0b6ce7a55f19fe4bccb0b67a15b251faef1fe84a..74f46344130bf23c42b47105dd378041b3edb8c5 100644 (file)
@@ -5,15 +5,12 @@
  * 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.dom.api;
 
-import org.opendaylight.controller.sal.core.api.BrokerService;
-
 /**
- * Marker interface for services which can be obtained from a {@link DOMMountPoint}
- * instance. No further semantics are implied.
+ * Marker interface for services which can be obtained from a {@link DOMMountPoint} instance. No further semantics are
+ * implied.
  */
-public interface DOMService extends BrokerService {
+public interface DOMService {
 
 }
diff --git a/opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/BrokerService.java b/opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/BrokerService.java
deleted file mode 100644 (file)
index 655d5fb..0000000
+++ /dev/null
@@ -1,19 +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.core.api;
-
-/**
- * Session-specific instance of the broker functionality. BrokerService is marker interface for infrastructure services
- * provided by the SAL.
- *
- * @deprecated Use blueprint instead for code wiring.
- */
-@Deprecated
-public interface BrokerService {
-
-}
diff --git a/opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/package-info.java b/opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/package-info.java
deleted file mode 100644 (file)
index 395c09a..0000000
+++ /dev/null
@@ -1,11 +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
- */
-/**
- * Core binding-independent SAL contracts and components
- */
-package org.opendaylight.controller.sal.core.api;
index dd4253cc86b5685dfd9f03beb3041cee4e08ad03..5361abe9d00d4994d0fa4589f1f68059f116bf37 100644 (file)
@@ -95,7 +95,6 @@
                             <!--  Legacy code -->
                             org.opendaylight.controller.sal.dom.broker,
                             org.opendaylight.controller.sal.dom.broker.impl,
-                            org.opendaylight.controller.sal.dom.broker.osgi,
                             org.opendaylight.controller.sal.dom.broker.util,
                             org.opendaylight.controller.sal.dom.broker.spi,
                             <!--sal.broker.impl is exported for sal-netconf-connector to use SchemaAwareRpcRegistry.-->
diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/AbstractBrokerServiceProxy.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/AbstractBrokerServiceProxy.java
deleted file mode 100644 (file)
index 42997d9..0000000
+++ /dev/null
@@ -1,80 +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.dom.broker.osgi;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.base.Preconditions.checkState;
-
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.annotation.Nullable;
-
-import org.opendaylight.controller.sal.core.api.BrokerService;
-import org.opendaylight.yangtools.concepts.Registration;
-import org.osgi.framework.ServiceReference;
-
-public abstract class AbstractBrokerServiceProxy<T extends BrokerService> implements AutoCloseable, BrokerService {
-
-    private T delegate;
-    private final ServiceReference<T> reference;
-
-    public AbstractBrokerServiceProxy(final @Nullable ServiceReference<T> ref, final T delegate) {
-        this.delegate = checkNotNull(delegate, "Delegate should not be null.");
-        this.reference = ref;
-    }
-
-    protected final T getDelegate() {
-        checkState(delegate != null, "Proxy was closed and unregistered.");
-        return delegate;
-    }
-
-    protected final ServiceReference<T> getReference() {
-        return reference;
-    }
-
-    private final Set<Registration> registrations = Collections.synchronizedSet(new HashSet<Registration>());
-
-    protected <R extends Registration> R addRegistration(final R registration) {
-        if (registration != null) {
-            registrations.add(registration);
-        }
-        return registration;
-    }
-
-    protected void closeBeforeUnregistrations() {
-        // NOOP
-    }
-
-    protected void closeAfterUnregistrations() {
-        // NOOP
-    }
-
-    @Override
-    @SuppressWarnings("checkstyle:IllegalCatch")
-    public void close() {
-        if (delegate != null) {
-            delegate = null;
-            RuntimeException potentialException = new RuntimeException(
-                    "Uncaught exceptions occured during unregistration");
-            boolean hasSuppressed = false;
-            for (Registration registration : registrations) {
-                try {
-                    registration.close();
-                } catch (Exception e) {
-                    potentialException.addSuppressed(e);
-                    hasSuppressed = true;
-                }
-            }
-            if (hasSuppressed) {
-                throw potentialException;
-            }
-        }
-    }
-}
diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/DOMDataBrokerProxy.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/DOMDataBrokerProxy.java
deleted file mode 100644 (file)
index e65976b..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2014, 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.sal.dom.broker.osgi;
-
-import java.util.Map;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataBrokerExtension;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataReadOnlyTransaction;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataReadWriteTransaction;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
-import org.opendaylight.controller.md.sal.dom.api.DOMTransactionChain;
-import org.osgi.framework.ServiceReference;
-
-public class DOMDataBrokerProxy extends AbstractBrokerServiceProxy<DOMDataBroker> implements DOMDataBroker {
-
-    public DOMDataBrokerProxy(final ServiceReference<DOMDataBroker> ref, final DOMDataBroker delegate) {
-        super(ref, delegate);
-    }
-
-    @Override
-    public DOMDataReadOnlyTransaction newReadOnlyTransaction() {
-        return getDelegate().newReadOnlyTransaction();
-    }
-
-    @Override
-    public DOMDataReadWriteTransaction newReadWriteTransaction() {
-        return getDelegate().newReadWriteTransaction();
-    }
-
-    @Override
-    public DOMDataWriteTransaction newWriteOnlyTransaction() {
-        return getDelegate().newWriteOnlyTransaction();
-    }
-
-    @Override
-    public DOMTransactionChain createTransactionChain(final TransactionChainListener listener) {
-        return getDelegate().createTransactionChain(listener);
-    }
-
-    @Override
-    public Map<Class<? extends DOMDataBrokerExtension>, DOMDataBrokerExtension> getSupportedExtensions() {
-        return getDelegate().getSupportedExtensions();
-    }
-}
diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/DOMMountPointServiceProxy.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/DOMMountPointServiceProxy.java
deleted file mode 100644 (file)
index 716decd..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.dom.broker.osgi;
-
-import com.google.common.base.Optional;
-import org.opendaylight.controller.md.sal.dom.api.DOMMountPoint;
-import org.opendaylight.controller.md.sal.dom.api.DOMMountPointService;
-import org.opendaylight.controller.sal.core.api.mount.MountProvisionListener;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
-import org.osgi.framework.ServiceReference;
-
-public class DOMMountPointServiceProxy extends AbstractBrokerServiceProxy<DOMMountPointService> implements
-        DOMMountPointService {
-
-    public DOMMountPointServiceProxy(final ServiceReference<DOMMountPointService> ref,
-                                     final DOMMountPointService delegate) {
-        super(ref, delegate);
-    }
-
-    @Override
-    public Optional<DOMMountPoint> getMountPoint(final YangInstanceIdentifier path) {
-        return getDelegate().getMountPoint(path);
-    }
-
-    @Override
-    public DOMMountPointBuilder createMountPoint(final YangInstanceIdentifier path) {
-        return getDelegate().createMountPoint(path);
-    }
-
-    public ListenerRegistration<MountProvisionListener> registerProvisionListener(
-            final MountProvisionListener listener) {
-        return getDelegate().registerProvisionListener(listener);
-    }
-}
diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/ProxyFactory.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/ProxyFactory.java
deleted file mode 100644 (file)
index 250ef7d..0000000
+++ /dev/null
@@ -1,55 +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.dom.broker.osgi;
-
-import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
-import org.opendaylight.controller.md.sal.dom.api.DOMMountPointService;
-import org.opendaylight.controller.sal.core.api.BrokerService;
-import org.osgi.framework.ServiceReference;
-
-@SuppressWarnings("unchecked")
-public final class ProxyFactory {
-
-    private ProxyFactory() {
-    }
-
-    public static <T extends BrokerService> T createProxy(final ServiceReference<T> serviceRef, final T service) {
-
-        Object createProxyImpl = ProxyFactory.createProxyImpl(serviceRef, service);
-        return (T) createProxyImpl;
-    }
-
-    private static Object createProxyImpl(final ServiceReference<?> ref, final DOMMountPointService service) {
-
-        return new DOMMountPointServiceProxy((ServiceReference<DOMMountPointService>) ref, service);
-    }
-
-    private static DOMDataBrokerProxy createProxyImpl(final ServiceReference<?> ref, final DOMDataBroker service) {
-
-        return new DOMDataBrokerProxy((ServiceReference<DOMDataBroker>) ref, service);
-    }
-
-    private static Object createProxyImpl(final ServiceReference<?> ref, final BrokerService service) {
-        if (service == null) {
-            throw new IllegalArgumentException("service can't be null");
-        }
-
-        if (service instanceof DOMDataBroker) {
-            return createProxyImpl(ref, (DOMDataBroker) service);
-        } else if (service instanceof DOMMountPointService) {
-            return createProxyImpl(ref, (DOMMountPointService) service);
-        }
-
-        return createProxyImplFallback(ref, service);
-    }
-
-    private static Object createProxyImplFallback(final ServiceReference<?> reference, final BrokerService service) {
-
-        return service;
-    }
-}