Merge "Cleaned up dom-api and dom-broker from legacy concepts."
authorRobert Varga <nite@hq.sk>
Wed, 26 Aug 2015 06:41:03 +0000 (06:41 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 26 Aug 2015 06:41:03 +0000 (06:41 +0000)
37 files changed:
binding/mdsal-binding-dom-adapter/src/main/java/org/opendaylight/mdsal/binding/dom/adapter/AbstractForwardedDataBroker.java
binding/mdsal-binding-dom-adapter/src/main/java/org/opendaylight/mdsal/binding/dom/adapter/BindingDOMMountPointListenerAdapter.java
binding/mdsal-binding-dom-adapter/src/test/java/org/opendaylight/mdsal/binding/dom/adapter/test/DataBrokerTestCustomizer.java
binding/mdsal-binding-dom-adapter/src/test/java/org/opendaylight/mdsal/binding/dom/adapter/test/util/BindingTestContext.java
binding/mdsal-binding-dom-adapter/src/test/java/org/opendaylight/mdsal/binding/dom/adapter/test/util/MockSchemaService.java
dom/mdsal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/Broker.java [deleted file]
dom/mdsal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/BrokerService.java [deleted file]
dom/mdsal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/Consumer.java [deleted file]
dom/mdsal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/Provider.java [deleted file]
dom/mdsal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/package-info.java [deleted file]
dom/mdsal-dom-api/src/main/java/org/opendaylight/mdsal/dom/api/DOMDataBroker.java
dom/mdsal-dom-api/src/main/java/org/opendaylight/mdsal/dom/api/DOMMountPointListener.java [moved from dom/mdsal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/mount/MountProvisionListener.java with 81% similarity]
dom/mdsal-dom-api/src/main/java/org/opendaylight/mdsal/dom/api/DOMMountPointService.java
dom/mdsal-dom-api/src/main/java/org/opendaylight/mdsal/dom/api/DOMNotificationPublishService.java
dom/mdsal-dom-api/src/main/java/org/opendaylight/mdsal/dom/api/DOMNotificationService.java
dom/mdsal-dom-api/src/main/java/org/opendaylight/mdsal/dom/api/DOMSchemaService.java [moved from dom/mdsal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/model/SchemaService.java with 67% similarity]
dom/mdsal-dom-api/src/main/java/org/opendaylight/mdsal/dom/api/DOMService.java
dom/mdsal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/BrokerImpl.java [deleted file]
dom/mdsal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/ConsumerContextImpl.java [deleted file]
dom/mdsal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/ProviderContextImpl.java [deleted file]
dom/mdsal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/impl/SchemaContextProviders.java [deleted file]
dom/mdsal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/AbstractBrokerServiceProxy.java [deleted file]
dom/mdsal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/DOMDataBrokerProxy.java [deleted file]
dom/mdsal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/DOMMountPointServiceProxy.java [deleted file]
dom/mdsal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/ProxyFactory.java [deleted file]
dom/mdsal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/SchemaServiceProxy.java [deleted file]
dom/mdsal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/package-info.java [deleted file]
dom/mdsal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/util/ProxySchemaContext.java [deleted file]
dom/mdsal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/util/YangSchemaUtils.java [deleted file]
dom/mdsal-dom-broker/src/main/java/org/opendaylight/mdsal/dom/broker/DOMMountPointServiceImpl.java
dom/mdsal-dom-broker/src/main/java/org/opendaylight/mdsal/dom/broker/ShardedDOMDataTree.java
dom/mdsal-dom-broker/src/main/java/org/opendaylight/mdsal/dom/broker/osgi/OsgiBundleScanningSchemaService.java [moved from dom/mdsal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/GlobalBundleScanningSchemaServiceImpl.java with 80% similarity]
dom/mdsal-dom-broker/src/main/java/org/opendaylight/mdsal/dom/broker/osgi/SchemaServiceActivator.java [moved from dom/mdsal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/SchemaServiceActivator.java with 58% similarity]
dom/mdsal-dom-inmemory-datastore/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/InMemoryDOMDataStoreFactory.java
dom/mdsal-dom-spi/src/main/java/org/opendaylight/controller/sal/core/spi/ForwardingConsumerSession.java [deleted file]
dom/mdsal-dom-spi/src/main/java/org/opendaylight/controller/sal/core/spi/ForwardingProviderSession.java [deleted file]
dom/mdsal-dom-spi/src/main/java/org/opendaylight/controller/sal/core/spi/package-info.java [deleted file]

index 405273d610444a0d51ac0975b4b503153421fd0b..dcb2bc30a10e2e6f9823d6c52f8fb8ec54e6bde9 100644 (file)
@@ -24,7 +24,6 @@ import java.util.Set;
 import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
 import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.sal.core.api.model.SchemaService;
 import org.opendaylight.yangtools.concepts.AbstractListenerRegistration;
 import org.opendaylight.yangtools.concepts.Delegator;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
@@ -44,12 +43,6 @@ public abstract class AbstractForwardedDataBroker implements Delegator<DOMDataBr
 
     private final BindingToNormalizedNodeCodec codec;
 
-    protected AbstractForwardedDataBroker(final DOMDataBroker domDataBroker, final BindingToNormalizedNodeCodec codec,
-            final SchemaService schemaService) {
-        this.domDataBroker = domDataBroker;
-        this.codec = codec;
-    }
-
     protected AbstractForwardedDataBroker(final DOMDataBroker domDataBroker, final BindingToNormalizedNodeCodec codec) {
         this.domDataBroker = domDataBroker;
         this.codec = codec;
index 3abc3605ac6298075e6812ff44d4bcb4ef7fb1a1..40260da2fe374144a721bc8a3693b17bfb121f3e 100644 (file)
@@ -7,21 +7,20 @@
  */
 package org.opendaylight.mdsal.binding.dom.adapter;
 
-import org.opendaylight.mdsal.dom.api.DOMMountPointService;
-
-import org.opendaylight.mdsal.binding.api.MountPointService.MountPointListener;
 import com.google.common.base.Optional;
-import org.opendaylight.controller.sal.core.api.mount.MountProvisionListener;
+import org.opendaylight.mdsal.binding.api.MountPointService.MountPointListener;
+import org.opendaylight.mdsal.dom.api.DOMMountPointListener;
+import org.opendaylight.mdsal.dom.api.DOMMountPointService;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 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 {
+final class BindingDOMMountPointListenerAdapter<T extends MountPointListener> implements ListenerRegistration<T>, DOMMountPointListener {
 
     private final T listener;
-    private final ListenerRegistration<MountProvisionListener> registration;
+    private final ListenerRegistration<DOMMountPointListener> registration;
     private final BindingToNormalizedNodeCodec codec;
 
     public BindingDOMMountPointListenerAdapter(final T listener, final BindingToNormalizedNodeCodec codec, final DOMMountPointService mountService) {
index 4e992be56b0fafcda32dd7f0f8de16e1baaa1ea4..dd8ddd1833d99614a42ccbd4b06868ad2f06da86 100644 (file)
@@ -7,26 +7,25 @@
  */
 package org.opendaylight.mdsal.binding.dom.adapter.test;
 
-import org.opendaylight.mdsal.dom.broker.DOMNotificationRouter;
-import org.opendaylight.mdsal.dom.broker.SerializedDOMDataBroker;
-
-import org.opendaylight.mdsal.dom.api.DOMDataBroker;
-import org.opendaylight.mdsal.binding.api.DataBroker;
-import org.opendaylight.mdsal.binding.api.NotificationPublishService;
-import org.opendaylight.mdsal.binding.api.NotificationService;
-import org.opendaylight.mdsal.binding.dom.adapter.test.util.MockSchemaService;
-import org.opendaylight.mdsal.binding.dom.adapter.BindingDOMDataBrokerAdapter;
-import org.opendaylight.mdsal.binding.dom.adapter.BindingDOMNotificationPublishServiceAdapter;
-import org.opendaylight.mdsal.binding.dom.adapter.BindingDOMNotificationServiceAdapter;
-import org.opendaylight.mdsal.binding.dom.adapter.BindingToNormalizedNodeCodec;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.util.concurrent.ListeningExecutorService;
 import com.google.common.util.concurrent.MoreExecutors;
 import javassist.ClassPool;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore;
-import org.opendaylight.controller.sal.core.api.model.SchemaService;
 import org.opendaylight.controller.sal.core.spi.data.DOMStore;
+import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.NotificationPublishService;
+import org.opendaylight.mdsal.binding.api.NotificationService;
+import org.opendaylight.mdsal.binding.dom.adapter.BindingDOMDataBrokerAdapter;
+import org.opendaylight.mdsal.binding.dom.adapter.BindingDOMNotificationPublishServiceAdapter;
+import org.opendaylight.mdsal.binding.dom.adapter.BindingDOMNotificationServiceAdapter;
+import org.opendaylight.mdsal.binding.dom.adapter.BindingToNormalizedNodeCodec;
+import org.opendaylight.mdsal.binding.dom.adapter.test.util.MockSchemaService;
+import org.opendaylight.mdsal.dom.api.DOMDataBroker;
+import org.opendaylight.mdsal.dom.api.DOMSchemaService;
+import org.opendaylight.mdsal.dom.broker.DOMNotificationRouter;
+import org.opendaylight.mdsal.dom.broker.SerializedDOMDataBroker;
 import org.opendaylight.yangtools.binding.data.codec.gen.impl.DataObjectSerializerGenerator;
 import org.opendaylight.yangtools.binding.data.codec.gen.impl.StreamWriterGenerator;
 import org.opendaylight.yangtools.binding.data.codec.impl.BindingNormalizedNodeCodecRegistry;
@@ -97,7 +96,7 @@ public class DataBrokerTestCustomizer {
         return bindingToNormalized;
     }
 
-    public SchemaService getSchemaService() {
+    public DOMSchemaService getSchemaService() {
         return schemaService;
     }
 
index e14b167b99a32e3b28598faa6be2d0729653c7c8..b9e603b888c2786d024e561f52401e0f7818891a 100644 (file)
@@ -9,35 +9,10 @@ package org.opendaylight.mdsal.binding.dom.adapter.test.util;
 
 import static com.google.common.base.Preconditions.checkState;
 
-import org.opendaylight.mdsal.dom.broker.DOMMountPointServiceImpl;
-
-import org.opendaylight.mdsal.dom.broker.DOMNotificationRouter;
-import org.opendaylight.mdsal.dom.broker.DOMRpcRouter;
-import org.opendaylight.mdsal.dom.broker.SerializedDOMDataBroker;
-import org.opendaylight.mdsal.dom.api.DOMDataBroker;
-import org.opendaylight.mdsal.dom.api.DOMMountPointService;
-import org.opendaylight.mdsal.dom.api.DOMNotificationPublishService;
-import org.opendaylight.mdsal.dom.api.DOMNotificationService;
-import org.opendaylight.mdsal.dom.api.DOMRpcProviderService;
-import org.opendaylight.mdsal.dom.api.DOMRpcService;
-import org.opendaylight.mdsal.binding.api.RpcConsumerRegistry;
-import org.opendaylight.mdsal.binding.api.DataBroker;
-import org.opendaylight.mdsal.binding.api.MountPointService;
-import org.opendaylight.mdsal.binding.api.NotificationPublishService;
-import org.opendaylight.mdsal.binding.api.NotificationService;
-import org.opendaylight.mdsal.binding.dom.adapter.BindingDOMDataBrokerAdapter;
-import org.opendaylight.mdsal.binding.dom.adapter.BindingDOMMountPointServiceAdapter;
-import org.opendaylight.mdsal.binding.dom.adapter.BindingDOMNotificationPublishServiceAdapter;
-import org.opendaylight.mdsal.binding.dom.adapter.BindingDOMNotificationServiceAdapter;
-import org.opendaylight.mdsal.binding.dom.adapter.BindingDOMRpcProviderServiceAdapter;
-import org.opendaylight.mdsal.binding.dom.adapter.BindingDOMRpcServiceAdapter;
-import org.opendaylight.mdsal.binding.dom.adapter.BindingToNormalizedNodeCodec;
 import com.google.common.annotations.Beta;
-import com.google.common.collect.ClassToInstanceMap;
 import com.google.common.collect.ImmutableClassToInstanceMap;
 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;
@@ -46,10 +21,29 @@ import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore;
 import org.opendaylight.controller.sal.binding.api.BindingAwareService;
 import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
 import org.opendaylight.controller.sal.binding.impl.RootBindingAwareBroker;
-import org.opendaylight.controller.sal.core.api.Broker.ProviderSession;
-import org.opendaylight.controller.sal.core.api.BrokerService;
 import org.opendaylight.controller.sal.core.spi.data.DOMStore;
-import org.opendaylight.controller.sal.dom.broker.BrokerImpl;
+import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.MountPointService;
+import org.opendaylight.mdsal.binding.api.NotificationPublishService;
+import org.opendaylight.mdsal.binding.api.NotificationService;
+import org.opendaylight.mdsal.binding.api.RpcConsumerRegistry;
+import org.opendaylight.mdsal.binding.dom.adapter.BindingDOMDataBrokerAdapter;
+import org.opendaylight.mdsal.binding.dom.adapter.BindingDOMMountPointServiceAdapter;
+import org.opendaylight.mdsal.binding.dom.adapter.BindingDOMNotificationPublishServiceAdapter;
+import org.opendaylight.mdsal.binding.dom.adapter.BindingDOMNotificationServiceAdapter;
+import org.opendaylight.mdsal.binding.dom.adapter.BindingDOMRpcProviderServiceAdapter;
+import org.opendaylight.mdsal.binding.dom.adapter.BindingDOMRpcServiceAdapter;
+import org.opendaylight.mdsal.binding.dom.adapter.BindingToNormalizedNodeCodec;
+import org.opendaylight.mdsal.dom.api.DOMDataBroker;
+import org.opendaylight.mdsal.dom.api.DOMMountPointService;
+import org.opendaylight.mdsal.dom.api.DOMNotificationPublishService;
+import org.opendaylight.mdsal.dom.api.DOMNotificationService;
+import org.opendaylight.mdsal.dom.api.DOMRpcProviderService;
+import org.opendaylight.mdsal.dom.api.DOMRpcService;
+import org.opendaylight.mdsal.dom.broker.DOMMountPointServiceImpl;
+import org.opendaylight.mdsal.dom.broker.DOMNotificationRouter;
+import org.opendaylight.mdsal.dom.broker.DOMRpcRouter;
+import org.opendaylight.mdsal.dom.broker.SerializedDOMDataBroker;
 import org.opendaylight.yangtools.binding.data.codec.gen.impl.DataObjectSerializerGenerator;
 import org.opendaylight.yangtools.binding.data.codec.gen.impl.StreamWriterGenerator;
 import org.opendaylight.yangtools.binding.data.codec.impl.BindingNormalizedNodeCodecRegistry;
@@ -68,8 +62,6 @@ public class BindingTestContext implements AutoCloseable {
 
     private RootBindingAwareBroker baBrokerImpl;
 
-    private BrokerImpl biBrokerImpl;
-
     private final ListeningExecutorService executor;
     private final ClassPool classPool;
 
@@ -160,33 +152,6 @@ public class BindingTestContext implements AutoCloseable {
 
     }
 
-    private ProviderSession createMockContext() {
-
-        final ClassToInstanceMap<BrokerService> domBrokerServices = ImmutableClassToInstanceMap
-                .<BrokerService> builder()
-                //
-                .put(DOMRpcRouter.class, biBrokerImpl.getRouter()) //
-                .put(DOMMountPointService.class, biMountImpl)
-                .build();
-
-        return new ProviderSession() {
-
-            @Override
-            public <T extends BrokerService> T getService(final Class<T> service) {
-                return domBrokerServices.getInstance(service);
-            }
-
-            @Override
-            public boolean isClosed() {
-                return false;
-            }
-
-            @Override
-            public void close() {
-            }
-        };
-    }
-
     public void startBindingToDomMappingService() {
         checkState(classPool != null, "ClassPool needs to be present");
 
@@ -229,15 +194,8 @@ public class BindingTestContext implements AutoCloseable {
 
     private void startDomBroker() {
         checkState(executor != null);
-
         domRouter = new DOMRpcRouter();
         mockSchemaService.registerSchemaContextListener(domRouter);
-
-        final ClassToInstanceMap<BrokerService> services = MutableClassToInstanceMap.create();
-        services.put(DOMRpcService.class, domRouter);
-
-        biBrokerImpl = new BrokerImpl(domRouter,services);
-
     }
 
     public void startBindingNotificationBroker() {
index 5a859467f001edeee63d8dbd74df62e374ca095e..98c0738c0dbf10fc0cb5ea38418547e410be3d10 100644 (file)
@@ -7,25 +7,19 @@
  */
 package org.opendaylight.mdsal.binding.dom.adapter.test.util;
 
-import org.opendaylight.controller.sal.core.api.model.SchemaService;
+import org.opendaylight.mdsal.dom.api.DOMSchemaService;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.util.ListenerRegistry;
-import org.opendaylight.yangtools.yang.model.api.Module;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.opendaylight.yangtools.yang.model.api.SchemaContextListener;
 import org.opendaylight.yangtools.yang.model.api.SchemaContextProvider;
 
-public final class MockSchemaService implements SchemaService, SchemaContextProvider {
+public final class MockSchemaService implements DOMSchemaService, SchemaContextProvider {
 
     private SchemaContext schemaContext;
 
     ListenerRegistry<SchemaContextListener> listeners = ListenerRegistry.create();
 
-    @Override
-    public void addModule(final Module module) {
-        throw new UnsupportedOperationException();
-    }
-
     @Override
     public synchronized SchemaContext getGlobalContext() {
         return schemaContext;
@@ -42,11 +36,6 @@ public final class MockSchemaService implements SchemaService, SchemaContextProv
         return listeners.register(listener);
     }
 
-    @Override
-    public void removeModule(final Module module) {
-        throw new UnsupportedOperationException();
-    }
-
     @Override
     public synchronized SchemaContext getSchemaContext() {
         return schemaContext;
diff --git a/dom/mdsal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/Broker.java b/dom/mdsal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/Broker.java
deleted file mode 100644 (file)
index b677656..0000000
+++ /dev/null
@@ -1,162 +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;
-
-import org.osgi.framework.BundleContext;
-
-/**
- * Core component of the SAL layer responsible for wiring the SAL consumers.
- *
- * The responsibility of the broker is to maintain registration of SAL
- * functionality {@link Consumer}s and {@link Provider}s, store provider and
- * consumer specific context and functionality registration via
- * {@link ConsumerSession} and provide access to infrastructure services, which
- * removes direct dependencies between providers and consumers.
- *
- *
- * The services are exposed via session.
- *
- * <h3>Session-based access</h3>
- *
- * The providers and consumers needs to register in order to use the
- * binding-independent SAL layer and to expose functionality via SAL layer.
- *
- * For more information about session-based access see {@link ConsumerSession}
- * and {@link ProviderSession}
- *
- *
- *
- */
-public interface Broker {
-
-    /**
-     * Registers the {@link Consumer}, which will use the SAL layer.
-     *
-     * <p>
-     * Note that consumer could register additional functionality at later point
-     * by using service and functionality specific APIs.
-     *
-     * <p>
-     * The consumer is required to use returned session for all communication
-     * with broker or one of the broker services. The session is announced to
-     * the consumer by invoking
-     * {@link Consumer#onSessionInitiated(ConsumerSession)}.
-     *
-     * @param cons
-     *            Consumer to be registered.
-     * @return a session specific to consumer registration
-     * @throws IllegalArgumentException
-     *             If the consumer is <code>null</code>.
-     * @throws IllegalStateException
-     *             If the consumer is already registered.
-     */
-    ConsumerSession registerConsumer(Consumer cons);
-
-    /*
-     * @deprecated Use registerConsumer(Consumer cons) instead (BundleContext is no longer used)
-     */
-    @Deprecated
-    ConsumerSession registerConsumer(Consumer cons, BundleContext context);
-
-    /**
-     * Registers the {@link Provider}, which will use the SAL layer.
-     *
-     * <p>
-     * The consumer is <b>required to use</b> returned session for all
-     * communication with broker or one of the broker services. The session is
-     * announced to the consumer by invoking
-     * {@link Provider#onSessionInitiated(ProviderSession)}.
-     *
-     *
-     * @param prov
-     *            Provider to be registered.
-     * @return a session unique to the provider registration.
-     * @throws IllegalArgumentException
-     *             If the provider is <code>null</code>.
-     * @throws IllegalStateException
-     *             If the consumer is already registered.
-     */
-    ProviderSession registerProvider(Provider prov);
-
-    /*
-     * @deprecated Use registerProvider(Provider cons) instead (BundleContext is no longer used)
-     */
-    @Deprecated
-    ProviderSession registerProvider(Provider prov, BundleContext context);
-
-    /**
-     * {@link Consumer} specific access to the SAL functionality.
-     *
-     * <p>
-     * ConsumerSession is {@link Consumer}-specific access to the SAL
-     * functionality and infrastructure services.
-     *
-     * <p>
-     * The session serves to store SAL context (e.g. registration of
-     * functionality) for the consumer and provides access to the SAL
-     * infrastructure services and other functionality provided by
-     * {@link Provider}s.
-     *
-     *
-     *
-     */
-    public interface ConsumerSession {
-
-        boolean isClosed();
-
-        /**
-         * Returns a session specific instance (implementation) of requested
-         * service
-         *
-         * @param service
-         *            Broker service
-         * @return Session specific implementation of service
-         */
-        <T extends BrokerService> T getService(Class<T> service);
-
-        /**
-         * Closes a session between consumer and broker.
-         *
-         * <p>
-         * The close operation unregisters a consumer and remove all registered
-         * functionality of the consumer from the system.
-         *
-         */
-        void close();
-    }
-
-    /**
-     * {@link Provider} specific access to the SAL functionality.
-     *
-     * <p>
-     * ProviderSession is {@link Provider}-specific access to the SAL
-     * functionality and infrastructure services, which also allows for exposing
-     * the provider's functionality to the other {@link Consumer}s.
-     *
-     * <p>
-     * The session serves to store SAL context (e.g. registration of
-     * functionality) for the providers and exposes access to the SAL
-     * infrastructure services, dynamic functionality registration and any other
-     * functionality provided by other {@link Provider}s.
-     *
-     */
-    public interface ProviderSession extends ConsumerSession {
-        /**
-         * Closes a session between provider and SAL.
-         *
-         * <p>
-         * The close operation unregisters a provider and remove all registered
-         * functionality of the provider from the system.
-         */
-        @Override
-        void close();
-
-        @Override
-        boolean isClosed();
-    }
-}
diff --git a/dom/mdsal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/BrokerService.java b/dom/mdsal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/BrokerService.java
deleted file mode 100644 (file)
index 7c00c9c..0000000
+++ /dev/null
@@ -1,36 +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.
- *
- * <p>
- * BrokerService is marker interface for infrastructure services provided by the
- * SAL. These services are session-specific, each {@link Provider} and
- * {@link Consumer} usually has own instance of the service with it's own
- * context.
- *
- * <p>
- * The consumer's (or provider's) instance of specific service could be obtained
- * by invoking {@link org.opendaylight.controller.sal.core.api.Broker.ConsumerSession#getService(Class)} method on session
- * assigned to the consumer.
- *
- * <p>
- * {@link BrokerService} and {@link Provider} may seem similar, but provider
- * provides YANG model-based functionality and {@link BrokerService} exposes the
- * necessary supporting functionality to implement specific functionality of
- * YANG and to reuse it in the development of {@link Consumer}s and
- * {@link Provider}s.
- *
- *
- */
-public interface BrokerService {
-
-}
diff --git a/dom/mdsal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/Consumer.java b/dom/mdsal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/Consumer.java
deleted file mode 100644 (file)
index 1e9f4d3..0000000
+++ /dev/null
@@ -1,40 +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;
-
-import java.util.Collection;
-
-import org.opendaylight.controller.sal.core.api.Broker.ConsumerSession;
-
-/**
- *
- * Defines the component of controller and supplies additional metadata. A
- * component of the controller or application supplies a concrete implementation
- * of this interface.
- *
- * A user-implemented component (application) which facilitates the SAL and SAL
- * services to access infrastructure services or providers' functionality.
- *
- *
- */
-public interface Consumer {
-
-    /**
-     * Callback signaling initialization of the consumer session to the SAL.
-     *
-     * The consumer MUST use the session for all communication with SAL or
-     * retrieving SAL infrastructure services.
-     *
-     * This method is invoked by {@link Broker#registerConsumer(Consumer)}
-     *
-     * @param session
-     *            Unique session between consumer and SAL.
-     */
-    public void onSessionInitiated(ConsumerSession session);
-
-}
diff --git a/dom/mdsal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/Provider.java b/dom/mdsal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/Provider.java
deleted file mode 100644 (file)
index 61e4d89..0000000
+++ /dev/null
@@ -1,43 +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;
-
-import java.util.Collection;
-
-import org.opendaylight.controller.sal.core.api.Broker.ProviderSession;
-
-/**
- *
- * Defines the component of controller and supplies additional metadata. A
- * component of the controller or application supplies a concrete implementation
- * of this interface.
- *
- * <p>
- * A user-implemented component (application) which facilitates the SAL and SAL
- * services to access infrastructure services and to provide functionality to
- * {@link Consumer}s and other providers.
- *
- *
- */
-public interface Provider {
-
-    /**
-     * Callback signaling initialization of the provider session to the SAL.
-     *
-     * <p>
-     * The provider <b>MUST use the session</b> for all communication with SAL
-     * or retrieving SAL infrastructure services.
-     *
-     * <p>
-     * This method is invoked by {@link Broker#registerConsumer(Consumer)}
-     *
-     * @param session
-     *            Unique session between provider and SAL.
-     */
-    public void onSessionInitiated(ProviderSession session);
-}
diff --git a/dom/mdsal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/package-info.java b/dom/mdsal-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 ddd158a792933a8aa680493905da16109dfe7525..e0b863f32444a94790de662ff19e2e22299f989a 100644 (file)
@@ -11,7 +11,6 @@ package org.opendaylight.mdsal.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;
 
@@ -25,7 +24,8 @@ import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
  */
 public interface DOMDataBroker extends
         AsyncDataBroker<YangInstanceIdentifier, NormalizedNode<?, ?>, DOMDataChangeListener>,
-        TransactionChainFactory<YangInstanceIdentifier, NormalizedNode<?, ?>>, BrokerService, DOMExtensibleService<DOMDataBroker, DOMDataBrokerExtension> {
+        TransactionChainFactory<YangInstanceIdentifier, NormalizedNode<?, ?>>,
+        DOMExtensibleService<DOMDataBroker, DOMDataBrokerExtension> {
 
     /**
      * {@inheritDoc}
similarity index 81%
rename from dom/mdsal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/mount/MountProvisionListener.java
rename to dom/mdsal-dom-api/src/main/java/org/opendaylight/mdsal/dom/api/DOMMountPointListener.java
index c4d00626ac8a0dfd9e9c1275dec3af9612b65ddc..5c48540628d042a3c855a1ce85bd632d719dd435 100644 (file)
@@ -6,12 +6,12 @@
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
 
-package org.opendaylight.controller.sal.core.api.mount;
+package org.opendaylight.mdsal.dom.api;
 
 import java.util.EventListener;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 
-public interface MountProvisionListener extends EventListener {
+public interface DOMMountPointListener extends EventListener {
 
     void onMountPointCreated(YangInstanceIdentifier path);
 
index 66f1a2986b61aa6d0031595c01bfe2717cfa4006..665ede0a7d7eda569a01e3cad0ed0d7e653d3244 100644 (file)
@@ -8,23 +8,20 @@
 
 package org.opendaylight.mdsal.dom.api;
 
-import org.opendaylight.controller.sal.core.api.BrokerService;
-import org.opendaylight.controller.sal.core.api.mount.MountProvisionListener;
+import com.google.common.base.Optional;
 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;
 
-import com.google.common.base.Optional;
-
 
-public interface DOMMountPointService extends BrokerService {
+public interface DOMMountPointService extends DOMService {
 
     Optional<DOMMountPoint> getMountPoint(YangInstanceIdentifier path);
 
     DOMMountPointBuilder createMountPoint(YangInstanceIdentifier path);
 
-    ListenerRegistration<MountProvisionListener> registerProvisionListener(MountProvisionListener listener);
+    ListenerRegistration<DOMMountPointListener> registerProvisionListener(DOMMountPointListener listener);
 
     public interface DOMMountPointBuilder {
 
index df9b775eb77a50b768e140d89ad8262dbba0730b..03332d4837a6c70023b161baf4b76326643ab86e 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 90d6b40af96ba97c679961cf6c4cda011a291f35..967721100066a6c6c0867ce082156ab9c5a85d78 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.mdsal.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 results in
similarity index 67%
rename from dom/mdsal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/model/SchemaService.java
rename to dom/mdsal-dom-api/src/main/java/org/opendaylight/mdsal/dom/api/DOMSchemaService.java
index c3e979c536b268c4a6156b7241e745f328569618..b6946c9552c86bcf7e45eff426a04e7d0fe62d81 100644 (file)
@@ -5,29 +5,13 @@
  * 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.model;
+package org.opendaylight.mdsal.dom.api;
 
-import org.opendaylight.controller.sal.core.api.BrokerService;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.yang.model.api.Module;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.opendaylight.yangtools.yang.model.api.SchemaContextListener;
 
-public interface SchemaService extends BrokerService {
-
-    /**
-     * Registers a YANG module to session and global context
-     *
-     * @param module
-     */
-    void addModule(Module module);
-
-    /**
-     * Unregisters a YANG module from session context
-     *
-     * @param module
-     */
-    void removeModule(Module module);
+public interface DOMSchemaService extends DOMService {
 
     /**
      * Returns session specific YANG schema context
index 5e3b15b4c081eeff21a55f363dcd9c44e8849aec..ba623398f25c0588c5dd892682677e1b81bb45b6 100644 (file)
@@ -8,12 +8,11 @@
 
 package org.opendaylight.mdsal.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.
  */
-public interface DOMService extends BrokerService {
+public interface DOMService {
 
 }
diff --git a/dom/mdsal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/BrokerImpl.java b/dom/mdsal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/BrokerImpl.java
deleted file mode 100644 (file)
index 7997f23..0000000
+++ /dev/null
@@ -1,198 +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.dom.broker;
-
-import org.opendaylight.mdsal.dom.broker.DOMRpcRouter;
-
-import org.opendaylight.mdsal.dom.api.DOMRpcAvailabilityListener;
-import org.opendaylight.mdsal.dom.api.DOMRpcException;
-import org.opendaylight.mdsal.dom.api.DOMRpcIdentifier;
-import org.opendaylight.mdsal.dom.api.DOMRpcImplementation;
-import org.opendaylight.mdsal.dom.api.DOMRpcImplementationRegistration;
-import org.opendaylight.mdsal.dom.api.DOMRpcProviderService;
-import org.opendaylight.mdsal.dom.api.DOMRpcResult;
-import org.opendaylight.mdsal.dom.api.DOMRpcService;
-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 com.google.common.util.concurrent.CheckedFuture;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-import org.opendaylight.controller.sal.core.api.Broker;
-import org.opendaylight.controller.sal.core.api.BrokerService;
-import org.opendaylight.controller.sal.core.api.Consumer;
-import org.opendaylight.controller.sal.core.api.Provider;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
-import org.opendaylight.yangtools.yang.model.api.SchemaPath;
-import org.osgi.framework.BundleContext;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class BrokerImpl implements Broker, DOMRpcProviderService, DOMRpcService, AutoCloseable {
-    private final static Logger log = LoggerFactory.getLogger(BrokerImpl.class);
-
-    // Broker Generic Context
-    private final Set<ConsumerContextImpl> sessions = Collections
-            .synchronizedSet(new HashSet<ConsumerContextImpl>());
-    private final Set<ProviderContextImpl> providerSessions = Collections
-            .synchronizedSet(new HashSet<ProviderContextImpl>());
-
-    private AutoCloseable deactivator = null;
-
-    private DOMRpcRouter router = null;
-
-    private final ClassToInstanceMap<BrokerService> services;
-
-    public  BrokerImpl(final DOMRpcRouter router,final ClassToInstanceMap<BrokerService> services) {
-        this.router = Preconditions.checkNotNull(router, "RPC Router must not be null");
-        this.services = ImmutableClassToInstanceMap.copyOf(services);
-    }
-
-
-    @Override
-    public ConsumerSession registerConsumer(final Consumer consumer,
-            final BundleContext ctx) {
-        return registerConsumer(consumer);
-    }
-
-    @Override
-    public ProviderSession registerProvider(final Provider provider,
-            final BundleContext ctx) {
-        return registerProvider(provider);
-    }
-
-    // Validation
-    private void checkPredicates(final Provider prov) {
-        Preconditions.checkNotNull(prov, "Provider should not be null.");
-        for (final ProviderContextImpl session : providerSessions) {
-            if (prov.equals(session.getProvider())) {
-                throw new IllegalStateException("Provider already registered");
-            }
-        }
-
-    }
-
-    private void checkPredicates(final Consumer cons) {
-        Preconditions.checkNotNull(cons, "Consumer should not be null.");
-        for (final ConsumerContextImpl session : sessions) {
-            if (cons.equals(session.getConsumer())) {
-                throw new IllegalStateException("Consumer already registered");
-            }
-        }
-    }
-
-    // Private Factory methods
-    private ConsumerContextImpl newSessionFor(final Consumer provider) {
-        final ConsumerContextImpl ret = new ConsumerContextImpl(provider, this);
-        return ret;
-    }
-
-    private ProviderContextImpl newSessionFor(final Provider provider) {
-        final ProviderContextImpl ret = new ProviderContextImpl(provider, this);
-        return ret;
-    }
-
-    protected void consumerSessionClosed(
-            final ConsumerContextImpl consumerContextImpl) {
-        sessions.remove(consumerContextImpl);
-        providerSessions.remove(consumerContextImpl);
-    }
-
-    @Override
-    public void close() throws Exception {
-        if (deactivator != null) {
-            deactivator.close();
-            deactivator = null;
-        }
-    }
-
-    /**
-     * @return the deactivator
-     */
-    public AutoCloseable getDeactivator() {
-        return deactivator;
-    }
-
-    /**
-     * @param deactivator
-     *            the deactivator to set
-     */
-    public void setDeactivator(final AutoCloseable deactivator) {
-        this.deactivator = deactivator;
-    }
-
-    /**
-     * @return the router
-     */
-    public DOMRpcRouter getRouter() {
-        return router;
-    }
-
-    /**
-     * @param router
-     *            the router to set
-     */
-    public void setRouter(final DOMRpcRouter router) {
-        this.router = router;
-    }
-
-    protected <T extends BrokerService> Optional<T> getGlobalService(final Class<T> service) {
-        return Optional.fromNullable(services.getInstance(service));
-    }
-
-
-    @Override
-    public ConsumerSession registerConsumer(final Consumer consumer) {
-        checkPredicates(consumer);
-        log.trace("Registering consumer {}", consumer);
-        final ConsumerContextImpl session = newSessionFor(consumer);
-        consumer.onSessionInitiated(session);
-        sessions.add(session);
-        return session;
-    }
-
-
-    @Override
-    public ProviderSession registerProvider(final Provider provider) {
-        checkPredicates(provider);
-        final ProviderContextImpl session = newSessionFor(provider);
-        provider.onSessionInitiated(session);
-        providerSessions.add(session);
-        return session;
-    }
-
-
-    @Nonnull
-    @Override
-    public <T extends DOMRpcImplementation> DOMRpcImplementationRegistration<T> registerRpcImplementation(@Nonnull final T implementation, @Nonnull final DOMRpcIdentifier... rpcs) {
-        return router.registerRpcImplementation(implementation, rpcs);
-    }
-
-    @Nonnull
-    @Override
-    public <T extends DOMRpcImplementation> DOMRpcImplementationRegistration<T> registerRpcImplementation(@Nonnull final T implementation, @Nonnull final Set<DOMRpcIdentifier> rpcs) {
-        return router.registerRpcImplementation(implementation, rpcs);
-    }
-
-    @Nonnull
-    @Override
-    public CheckedFuture<DOMRpcResult, DOMRpcException> invokeRpc(@Nonnull final SchemaPath type, @Nullable final NormalizedNode<?, ?> input) {
-        return router.invokeRpc(type, input);
-    }
-
-    @Nonnull
-    @Override
-    public <T extends DOMRpcAvailabilityListener> ListenerRegistration<T> registerRpcListener(@Nonnull final T listener) {
-        return router.registerRpcListener(listener);
-    }
-}
diff --git a/dom/mdsal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/ConsumerContextImpl.java b/dom/mdsal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/ConsumerContextImpl.java
deleted file mode 100644 (file)
index 721b1e5..0000000
+++ /dev/null
@@ -1,98 +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;
-
-import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.ClassToInstanceMap;
-import com.google.common.collect.MutableClassToInstanceMap;
-import org.opendaylight.controller.sal.core.api.Broker.ConsumerSession;
-import org.opendaylight.controller.sal.core.api.BrokerService;
-import org.opendaylight.controller.sal.core.api.Consumer;
-import org.opendaylight.controller.sal.dom.broker.osgi.AbstractBrokerServiceProxy;
-import org.opendaylight.controller.sal.dom.broker.osgi.ProxyFactory;
-
-import javax.annotation.concurrent.GuardedBy;
-import java.util.Collection;
-
-class ConsumerContextImpl implements ConsumerSession {
-
-    private final ClassToInstanceMap<BrokerService> instantiatedServices = MutableClassToInstanceMap
-            .create();
-    private final Consumer consumer;
-
-    private BrokerImpl broker = null;
-    @GuardedBy("this")
-    private boolean closed = false;
-
-    public ConsumerContextImpl(final Consumer provider, final BrokerImpl brokerImpl) {
-        broker = brokerImpl;
-        consumer = provider;
-    }
-
-    @Override
-    public <T extends BrokerService> T getService(final Class<T> service) {
-        checkNotClosed();
-        final T localProxy = instantiatedServices.getInstance(service);
-        if (localProxy != null) {
-            return localProxy;
-        }
-        final Optional<T> serviceImpl = broker.getGlobalService(service);
-        if(serviceImpl.isPresent()) {
-            final T ret = ProxyFactory.createProxy(null,serviceImpl.get());
-            instantiatedServices.putInstance(service, ret);
-            return ret;
-        } else {
-            return null;
-        }
-    }
-
-    @Override
-    public void close() {
-        synchronized (this) {
-            if (closed) {
-                return;
-            }
-            this.closed = true;
-        }
-
-        Collection<BrokerService> toStop = instantiatedServices.values();
-        for (BrokerService brokerService : toStop) {
-            if (brokerService instanceof AbstractBrokerServiceProxy<?>) {
-                ((AbstractBrokerServiceProxy<?>) brokerService).close();
-            }
-        }
-        broker.consumerSessionClosed(this);
-        broker = null;
-    }
-
-
-    @Override
-    public synchronized boolean isClosed() {
-        return closed;
-    }
-
-    /**
-     * @return the broker
-     */
-    protected final  BrokerImpl getBrokerChecked() {
-        checkNotClosed();
-        return broker;
-    }
-
-    /**
-     * @return the _consumer
-     */
-    public Consumer getConsumer() {
-        return consumer;
-    }
-
-    protected final void checkNotClosed()  {
-        Preconditions.checkState(!closed, "Session is closed.");
-    }
-}
diff --git a/dom/mdsal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/ProviderContextImpl.java b/dom/mdsal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/ProviderContextImpl.java
deleted file mode 100644 (file)
index 0c46c67..0000000
+++ /dev/null
@@ -1,36 +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;
-
-import org.opendaylight.controller.sal.core.api.Broker.ProviderSession;
-import org.opendaylight.controller.sal.core.api.Provider;
-
-class ProviderContextImpl extends ConsumerContextImpl implements ProviderSession {
-    private final Provider provider;
-
-    public ProviderContextImpl(final Provider provider, final BrokerImpl broker) {
-        super(null, broker);
-        this.provider = provider;
-    }
-
-    @Override
-    public void close() {
-    }
-
-    /**
-     * @return the provider
-     */
-    public Provider getProvider() {
-        return provider;
-    }
-
-    /**
-     * @param provider
-     *            the provider to set
-     */
-}
diff --git a/dom/mdsal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/impl/SchemaContextProviders.java b/dom/mdsal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/impl/SchemaContextProviders.java
deleted file mode 100644 (file)
index 6806c5d..0000000
+++ /dev/null
@@ -1,52 +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.dom.broker.impl;
-
-import org.opendaylight.controller.sal.core.api.model.SchemaService;
-import org.opendaylight.yangtools.concepts.Delegator;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.opendaylight.yangtools.yang.model.api.SchemaContextProvider;
-
-public class SchemaContextProviders {
-
-    private SchemaContextProviders() {
-        throw new UnsupportedOperationException("Utility class.");
-    }
-
-    public static final SchemaContextProvider fromSchemaService(final SchemaService schemaService) {
-        if (schemaService instanceof SchemaContextProvider) {
-            return (SchemaContextProvider) schemaService;
-        }
-        return new SchemaServiceAdapter(schemaService);
-    }
-
-    private static final class SchemaServiceAdapter implements SchemaContextProvider, Delegator<SchemaService> {
-
-        private final SchemaService service;
-
-        public SchemaServiceAdapter(final SchemaService service) {
-            super();
-            this.service = service;
-        }
-
-        @Override
-        public SchemaContext getSchemaContext() {
-            return service.getGlobalContext();
-        }
-
-        @Override
-        public SchemaService getDelegate() {
-            return service;
-        }
-
-        @Override
-        public String toString() {
-            return "SchemaServiceAdapter [service=" + service + "]";
-        }
-    }
-}
diff --git a/dom/mdsal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/AbstractBrokerServiceProxy.java b/dom/mdsal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/AbstractBrokerServiceProxy.java
deleted file mode 100644 (file)
index 275107e..0000000
+++ /dev/null
@@ -1,79 +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
-    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/dom/mdsal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/DOMDataBrokerProxy.java b/dom/mdsal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/DOMDataBrokerProxy.java
deleted file mode 100644 (file)
index eb47b9f..0000000
+++ /dev/null
@@ -1,63 +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 org.opendaylight.mdsal.dom.api.DOMDataBroker;
-import org.opendaylight.mdsal.dom.api.DOMDataBrokerExtension;
-import org.opendaylight.mdsal.dom.api.DOMDataChangeListener;
-import org.opendaylight.mdsal.dom.api.DOMDataReadOnlyTransaction;
-import org.opendaylight.mdsal.dom.api.DOMDataReadWriteTransaction;
-import org.opendaylight.mdsal.dom.api.DOMDataWriteTransaction;
-import org.opendaylight.mdsal.dom.api.DOMTransactionChain;
-
-import java.util.Map;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
-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 ListenerRegistration<DOMDataChangeListener> registerDataChangeListener(final LogicalDatastoreType store,
-            final YangInstanceIdentifier path, final DOMDataChangeListener listener,
-            final org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope triggeringScope) {
-        return getDelegate().registerDataChangeListener(store, path, listener, triggeringScope);
-    }
-
-    @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/dom/mdsal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/DOMMountPointServiceProxy.java b/dom/mdsal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/DOMMountPointServiceProxy.java
deleted file mode 100644 (file)
index 0e4f773..0000000
+++ /dev/null
@@ -1,40 +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.mdsal.dom.api.DOMMountPoint;
-import org.opendaylight.mdsal.dom.api.DOMMountPointService;
-
-import com.google.common.base.Optional;
-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/dom/mdsal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/ProxyFactory.java b/dom/mdsal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/ProxyFactory.java
deleted file mode 100644 (file)
index d0d9244..0000000
+++ /dev/null
@@ -1,72 +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.mdsal.dom.api.DOMDataBroker;
-import org.opendaylight.mdsal.dom.api.DOMMountPointService;
-
-import org.opendaylight.controller.sal.core.api.BrokerService;
-import org.opendaylight.controller.sal.core.api.model.SchemaService;
-import org.osgi.framework.ServiceReference;
-import java.util.Arrays;
-
-@SuppressWarnings("unchecked")
-public class 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 Object createProxyImpl(final ServiceReference<?> ref,
-            final SchemaService service) {
-
-        return new SchemaServiceProxy(((ServiceReference<SchemaService>) ref),
-                service);
-    }
-
-    private static DOMDataBrokerProxy createProxyImpl(
-            final ServiceReference<?> ref, final DOMDataBroker service) {
-
-        return new DOMDataBrokerProxy(((ServiceReference<DOMDataBroker>) ref),
-                service);
-    }
-
-    private static Object createProxyImplFallback(final ServiceReference<?> reference,
-            final BrokerService service) {
-
-       return service;
-    }
-
-    private static Object createProxyImpl(final ServiceReference<?> ref,
-            final BrokerService service) {
-
-        if (service instanceof DOMDataBroker) {
-            return createProxyImpl(ref, (DOMDataBroker) service);
-        } else if (service instanceof SchemaService) {
-            return createProxyImpl(ref, (SchemaService) service);
-        } else if (service instanceof DOMMountPointService) {
-            return createProxyImpl(ref, (DOMMountPointService) service);
-        } else if (service != null) {
-            return createProxyImplFallback(ref, service);
-        } else {
-            throw new IllegalArgumentException("Unhandled parameter types: "
-                    + Arrays.<Object> asList(ref, service).toString());
-        }
-    }
-}
\ No newline at end of file
diff --git a/dom/mdsal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/SchemaServiceProxy.java b/dom/mdsal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/SchemaServiceProxy.java
deleted file mode 100644 (file)
index d8d2346..0000000
+++ /dev/null
@@ -1,49 +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.sal.core.api.model.SchemaService;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.yang.model.api.Module;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.opendaylight.yangtools.yang.model.api.SchemaContextListener;
-import org.osgi.framework.ServiceReference;
-
-public class SchemaServiceProxy extends AbstractBrokerServiceProxy<SchemaService> implements SchemaService {
-
-    public SchemaServiceProxy(ServiceReference<SchemaService> ref, SchemaService delegate) {
-        super(ref, delegate);
-    }
-
-    @Override
-    public void addModule(Module module) {
-        getDelegate().addModule(module);
-    }
-
-    @Override
-    public void removeModule(Module module) {
-        getDelegate().removeModule(module);
-    }
-
-    @Override
-    public SchemaContext getSessionContext() {
-        return null;
-    }
-
-    @Override
-    public SchemaContext getGlobalContext() {
-        return getDelegate().getGlobalContext();
-    }
-
-    @Override
-    public ListenerRegistration<SchemaContextListener> registerSchemaContextListener(SchemaContextListener listener) {
-        ListenerRegistration<SchemaContextListener> registration = getDelegate().registerSchemaContextListener(listener);
-        addRegistration(registration);
-        return registration;
-    }
-}
diff --git a/dom/mdsal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/package-info.java b/dom/mdsal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/package-info.java
deleted file mode 100644 (file)
index 9793108..0000000
+++ /dev/null
@@ -1,8 +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.dom.broker;
\ No newline at end of file
diff --git a/dom/mdsal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/util/ProxySchemaContext.java b/dom/mdsal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/util/ProxySchemaContext.java
deleted file mode 100644 (file)
index b0274a6..0000000
+++ /dev/null
@@ -1,193 +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.util;
-
-import java.net.URI;
-import java.util.Collection;
-import java.util.Date;
-import java.util.List;
-import java.util.Set;
-
-import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.model.api.AugmentationSchema;
-import org.opendaylight.yangtools.yang.model.api.ConstraintDefinition;
-import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
-import org.opendaylight.yangtools.yang.model.api.ExtensionDefinition;
-import org.opendaylight.yangtools.yang.model.api.GroupingDefinition;
-import org.opendaylight.yangtools.yang.model.api.Module;
-import org.opendaylight.yangtools.yang.model.api.ModuleIdentifier;
-import org.opendaylight.yangtools.yang.model.api.NotificationDefinition;
-import org.opendaylight.yangtools.yang.model.api.RpcDefinition;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.opendaylight.yangtools.yang.model.api.SchemaContextProvider;
-import org.opendaylight.yangtools.yang.model.api.SchemaPath;
-import org.opendaylight.yangtools.yang.model.api.Status;
-import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
-import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
-import org.opendaylight.yangtools.yang.model.api.UsesNode;
-
-import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
-
-/**
- * ProxySchema Context for SchemaContextProviders
- */
-public class ProxySchemaContext implements SchemaContext {
-
-    private final SchemaContextProvider schemaProvider;
-
-    public ProxySchemaContext(final SchemaContextProvider schemaProvider) {
-        this.schemaProvider = schemaProvider;
-    }
-
-    private SchemaContext getCurrentSchema() {
-        Preconditions.checkState(schemaProvider.getSchemaContext() != null, "Schema context unavailable from %s", schemaProvider);
-        return schemaProvider.getSchemaContext();
-    }
-
-    @Override
-    public Set<DataSchemaNode> getDataDefinitions() {
-        return getCurrentSchema().getDataDefinitions();
-    }
-
-    @Override
-    public Set<Module> getModules() {
-        return getCurrentSchema().getModules();
-    }
-
-    @Override
-    public Set<NotificationDefinition> getNotifications() {
-        return getCurrentSchema().getNotifications();
-    }
-
-    @Override
-    public Set<RpcDefinition> getOperations() {
-        return getCurrentSchema().getOperations();
-    }
-
-    @Override
-    public Set<ExtensionDefinition> getExtensions() {
-        return getCurrentSchema().getExtensions();
-    }
-
-    @Override
-    public Module findModuleByName(final String s, final Date date) {
-        return getCurrentSchema().findModuleByName(s, date);
-    }
-
-    @Override
-    public Set<Module> findModuleByNamespace(final URI uri) {
-        return getCurrentSchema().findModuleByNamespace(uri);
-    }
-
-    @Override
-    public Module findModuleByNamespaceAndRevision(final URI uri, final Date date) {
-        return getCurrentSchema().findModuleByNamespaceAndRevision(uri, date);
-    }
-
-    @Override
-    public Optional<String> getModuleSource(final ModuleIdentifier moduleIdentifier) {
-        return getCurrentSchema().getModuleSource(moduleIdentifier);
-    }
-
-    @Override
-    public Set<ModuleIdentifier> getAllModuleIdentifiers() {
-        return getCurrentSchema().getAllModuleIdentifiers();
-    }
-
-    @Override
-    public boolean isPresenceContainer() {
-        return getCurrentSchema().isPresenceContainer();
-    }
-
-    @Override
-    public Set<TypeDefinition<?>> getTypeDefinitions() {
-        return getCurrentSchema().getTypeDefinitions();
-    }
-
-    @Override
-    public Collection<DataSchemaNode> getChildNodes() {
-        return getCurrentSchema().getChildNodes();
-    }
-
-    @Override
-    public Set<GroupingDefinition> getGroupings() {
-        return getCurrentSchema().getGroupings();
-    }
-
-    @Override
-    public DataSchemaNode getDataChildByName(final QName qName) {
-        return getCurrentSchema().getDataChildByName(qName);
-    }
-
-    @Override
-    public DataSchemaNode getDataChildByName(final String s) {
-        return getCurrentSchema().getDataChildByName(s);
-    }
-
-    @Override
-    public Set<UsesNode> getUses() {
-        return getCurrentSchema().getUses();
-    }
-
-    @Override
-    public Set<AugmentationSchema> getAvailableAugmentations() {
-        return getCurrentSchema().getAvailableAugmentations();
-    }
-
-    @Override
-    public boolean isAugmenting() {
-        return getCurrentSchema().isAugmenting();
-    }
-
-    @Override
-    public boolean isAddedByUses() {
-        return getCurrentSchema().isAddedByUses();
-    }
-
-    @Override
-    public boolean isConfiguration() {
-        return getCurrentSchema().isConfiguration();
-    }
-
-    @Override
-    public ConstraintDefinition getConstraints() {
-        return getCurrentSchema().getConstraints();
-    }
-
-    @Override
-    public QName getQName() {
-        return getCurrentSchema().getQName();
-    }
-
-    @Override
-    public SchemaPath getPath() {
-        return getCurrentSchema().getPath();
-    }
-
-    @Override
-    public List<UnknownSchemaNode> getUnknownSchemaNodes() {
-        return getCurrentSchema().getUnknownSchemaNodes();
-    }
-
-    @Override
-    public String getDescription() {
-        return getCurrentSchema().getDescription();
-    }
-
-    @Override
-    public String getReference() {
-        return getCurrentSchema().getReference();
-    }
-
-    @Override
-    public Status getStatus() {
-        return getCurrentSchema().getStatus();
-    }
-}
diff --git a/dom/mdsal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/util/YangSchemaUtils.java b/dom/mdsal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/util/YangSchemaUtils.java
deleted file mode 100644 (file)
index 238ad10..0000000
+++ /dev/null
@@ -1,238 +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.util;
-
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkState;
-
-import com.google.common.base.Function;
-import com.google.common.collect.FluentIterable;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
-import org.opendaylight.yangtools.yang.model.api.AugmentationSchema;
-import org.opendaylight.yangtools.yang.model.api.ChoiceCaseNode;
-import org.opendaylight.yangtools.yang.model.api.ChoiceSchemaNode;
-import org.opendaylight.yangtools.yang.model.api.ConstraintDefinition;
-import org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode;
-import org.opendaylight.yangtools.yang.model.api.DataNodeContainer;
-import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
-import org.opendaylight.yangtools.yang.model.api.GroupingDefinition;
-import org.opendaylight.yangtools.yang.model.api.LeafListSchemaNode;
-import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.opendaylight.yangtools.yang.model.api.SchemaPath;
-import org.opendaylight.yangtools.yang.model.api.Status;
-import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
-import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
-import org.opendaylight.yangtools.yang.model.api.UsesNode;
-
-public final class YangSchemaUtils {
-
-    private static final Function<PathArgument, QName> QNAME_FROM_PATH_ARGUMENT = new Function<PathArgument, QName>(){
-
-        @Override
-        public QName apply(final PathArgument input) {
-            if(input == null) {
-                return null;
-            }
-            return input.getNodeType();
-        }
-    };
-
-    private YangSchemaUtils() {
-        throw new UnsupportedOperationException("Utility class.");
-    }
-
-    public static DataSchemaNode getSchemaNode(final SchemaContext schema,final YangInstanceIdentifier path) {
-        checkArgument(schema != null,"YANG Schema must not be null.");
-        checkArgument(path != null,"Path must not be null.");
-        return getSchemaNode(schema, FluentIterable.from(path.getPathArguments()).transform(QNAME_FROM_PATH_ARGUMENT));
-    }
-
-    public static DataSchemaNode getSchemaNode(final SchemaContext schema,final Iterable<QName> path) {
-        checkArgument(schema != null,"YANG Schema must not be null.");
-        checkArgument(path != null,"Path must not be null.");
-        if(!path.iterator().hasNext()){
-            return toRootDataNode(schema);
-        }
-
-        QName firstNode = path.iterator().next();
-        DataNodeContainer previous = schema.findModuleByNamespaceAndRevision(firstNode.getNamespace(),
-                firstNode.getRevision());
-        Iterator<QName> iterator = path.iterator();
-
-        while (iterator.hasNext()) {
-            checkArgument(previous!= null, "Supplied path does not resolve into valid schema node.");
-            QName arg = iterator.next();
-            DataSchemaNode currentNode = previous.getDataChildByName(arg);
-            if (currentNode == null && previous instanceof DataNodeContainer) {
-                currentNode = searchInChoices(previous, arg);
-            }
-            if (currentNode instanceof DataNodeContainer) {
-                previous = (DataNodeContainer) currentNode;
-            } else if (currentNode instanceof LeafSchemaNode || currentNode instanceof LeafListSchemaNode) {
-                checkArgument(!iterator.hasNext(), "Path nests inside leaf node, which is not allowed.");
-                return currentNode;
-            }
-            checkState(currentNode != null, "Current node should not be null for %s",path);
-        }
-        checkState(previous instanceof DataSchemaNode, "Schema node for %s should be instance of DataSchemaNode. Found %s",path,previous);
-        return (DataSchemaNode) previous;
-    }
-
-    private static DataSchemaNode searchInChoices(final DataNodeContainer node, final QName arg) {
-        for (DataSchemaNode child : node.getChildNodes()) {
-            if (child instanceof ChoiceSchemaNode) {
-                ChoiceSchemaNode choiceNode = (ChoiceSchemaNode) child;
-                DataSchemaNode potential = searchInCases(choiceNode, arg);
-                if (potential != null) {
-                    return potential;
-                }
-            }
-        }
-        return null;
-    }
-
-    private static DataSchemaNode searchInCases(final ChoiceSchemaNode choiceNode, final QName arg) {
-        Set<ChoiceCaseNode> cases = choiceNode.getCases();
-        for (ChoiceCaseNode caseNode : cases) {
-            DataSchemaNode node = caseNode.getDataChildByName(arg);
-            if (node != null) {
-                return node;
-            }
-        }
-        return null;
-    }
-
-    private static ContainerSchemaNode toRootDataNode(final SchemaContext schema) {
-        return new NetconfDataRootNode(schema);
-    }
-
-    private static final class NetconfDataRootNode implements ContainerSchemaNode {
-
-        public NetconfDataRootNode(final SchemaContext schema) {
-            // TODO Auto-generated constructor stub
-        }
-
-        @Override
-        public Set<TypeDefinition<?>> getTypeDefinitions() {
-            // TODO Auto-generated method stub
-            return null;
-        }
-
-        @Override
-        public Set<DataSchemaNode> getChildNodes() {
-            // TODO Auto-generated method stub
-            return null;
-        }
-
-        @Override
-        public Set<GroupingDefinition> getGroupings() {
-            // TODO Auto-generated method stub
-            return null;
-        }
-
-        @Override
-        public DataSchemaNode getDataChildByName(final QName name) {
-            // TODO Auto-generated method stub
-            return null;
-        }
-
-        @Override
-        public DataSchemaNode getDataChildByName(final String name) {
-            // TODO Auto-generated method stub
-            return null;
-        }
-
-        @Override
-        public Set<UsesNode> getUses() {
-            // TODO Auto-generated method stub
-            return null;
-        }
-
-        @Override
-        public Set<AugmentationSchema> getAvailableAugmentations() {
-            // TODO Auto-generated method stub
-            return null;
-        }
-
-        @Override
-        public boolean isAugmenting() {
-            // TODO Auto-generated method stub
-            return false;
-        }
-
-        @Override
-        public boolean isAddedByUses() {
-            // TODO Auto-generated method stub
-            return false;
-        }
-
-        @Override
-        public boolean isConfiguration() {
-            // TODO Auto-generated method stub
-            return false;
-        }
-
-        @Override
-        public ConstraintDefinition getConstraints() {
-            // TODO Auto-generated method stub
-            return null;
-        }
-
-        @Override
-        public QName getQName() {
-            // TODO Auto-generated method stub
-            return null;
-        }
-
-        @Override
-        public SchemaPath getPath() {
-            // TODO Auto-generated method stub
-            return null;
-        }
-
-        @Override
-        public String getDescription() {
-            // TODO Auto-generated method stub
-            return null;
-        }
-
-        @Override
-        public String getReference() {
-            // TODO Auto-generated method stub
-            return null;
-        }
-
-        @Override
-        public Status getStatus() {
-            // TODO Auto-generated method stub
-            return null;
-        }
-
-        @Override
-        public List<UnknownSchemaNode> getUnknownSchemaNodes() {
-            // TODO Auto-generated method stub
-            return null;
-        }
-
-        @Override
-        public boolean isPresenceContainer() {
-            // TODO Auto-generated method stub
-            return false;
-        }
-
-    }
-
-}
index 2a3958cb52fe86362dbd17c9798f1288691e3d46..8d69edf18b5f37cef8d0bcc14730eb7aeac759f9 100644 (file)
@@ -8,10 +8,11 @@
 
 package org.opendaylight.mdsal.dom.broker;
 
+import org.opendaylight.mdsal.dom.api.DOMMountPointListener;
+
 import org.opendaylight.mdsal.dom.api.DOMMountPoint;
 import org.opendaylight.mdsal.dom.api.DOMMountPointService;
 import org.opendaylight.mdsal.dom.api.DOMService;
-
 import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ClassToInstanceMap;
@@ -19,7 +20,6 @@ import com.google.common.collect.MutableClassToInstanceMap;
 import java.util.HashMap;
 import java.util.Map;
 import org.opendaylight.controller.md.sal.dom.broker.spi.mount.SimpleDOMMountPoint;
-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.util.ListenerRegistry;
@@ -30,7 +30,7 @@ public class DOMMountPointServiceImpl implements DOMMountPointService {
 
     private final Map<YangInstanceIdentifier, DOMMountPoint> mountPoints = new HashMap<>();
 
-    private final ListenerRegistry<MountProvisionListener> listeners = ListenerRegistry.create();
+    private final ListenerRegistry<DOMMountPointListener> listeners = ListenerRegistry.create();
 
     @Override
     public Optional<DOMMountPoint> getMountPoint(final YangInstanceIdentifier path) {
@@ -44,22 +44,22 @@ public class DOMMountPointServiceImpl implements DOMMountPointService {
     }
 
     public void notifyMountCreated(final YangInstanceIdentifier identifier) {
-        for (final ListenerRegistration<MountProvisionListener> listener : listeners
+        for (final ListenerRegistration<DOMMountPointListener> listener : listeners
                 .getListeners()) {
             listener.getInstance().onMountPointCreated(identifier);
         }
     }
 
     public void notifyMountRemoved(final YangInstanceIdentifier identifier) {
-        for (final ListenerRegistration<MountProvisionListener> listener : listeners
+        for (final ListenerRegistration<DOMMountPointListener> listener : listeners
                 .getListeners()) {
             listener.getInstance().onMountPointRemoved(identifier);
         }
     }
 
     @Override
-    public ListenerRegistration<MountProvisionListener> registerProvisionListener(
-            final MountProvisionListener listener) {
+    public ListenerRegistration<DOMMountPointListener> registerProvisionListener(
+            final DOMMountPointListener listener) {
         return listeners.register(listener);
     }
 
index a35cbc728ae8808b0d8c00e49d0552f31c4efa33..1e0fa1b72e7dc0d469b7d72e0a444cb2349b97fa 100644 (file)
@@ -7,14 +7,6 @@
  */
 package org.opendaylight.mdsal.dom.broker;
 
-import org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier;
-import org.opendaylight.mdsal.dom.api.DOMDataTreeListener;
-import org.opendaylight.mdsal.dom.api.DOMDataTreeProducer;
-import org.opendaylight.mdsal.dom.api.DOMDataTreeService;
-import org.opendaylight.mdsal.dom.api.DOMDataTreeShard;
-import org.opendaylight.mdsal.dom.api.DOMDataTreeShardingConflictException;
-import org.opendaylight.mdsal.dom.api.DOMDataTreeShardingService;
-
 import com.google.common.base.Preconditions;
 import java.util.Collection;
 import java.util.EnumMap;
@@ -24,6 +16,13 @@ import java.util.Map.Entry;
 import java.util.TreeMap;
 import javax.annotation.concurrent.GuardedBy;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeListener;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeProducer;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeService;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeShard;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeShardingConflictException;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeShardingService;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -94,9 +93,14 @@ public final class ShardedDOMDataTree implements DOMDataTreeService, DOMDataTree
              * this registration.
              */
             final ShardingTableEntry parent = lookupShard(prefix);
-            parentReg = parent.getRegistration();
-            if (parentReg != null && prefix.equals(parentReg.getPrefix())) {
-                throw new DOMDataTreeShardingConflictException(String.format("Prefix %s is already occupied by shard %s", prefix, parentReg.getInstance()));
+            if (parent != null) {
+                parentReg = parent.getRegistration();
+                if (parentReg != null && prefix.equals(parentReg.getPrefix())) {
+                    throw new DOMDataTreeShardingConflictException(String.format(
+                            "Prefix %s is already occupied by shard %s", prefix, parentReg.getInstance()));
+                }
+            } else {
+                parentReg = null;
             }
 
             // FIXME: wrap the shard in a proper adaptor based on implemented interface
@@ -140,7 +144,7 @@ public final class ShardedDOMDataTree implements DOMDataTreeService, DOMDataTree
     private DOMDataTreeProducer createProducer(final Map<DOMDataTreeIdentifier, DOMDataTreeShard> shardMap) {
         // Record the producer's attachment points
         final DOMDataTreeProducer ret = ShardedDOMDataTreeProducer.create(this, shardMap);
-        for (DOMDataTreeIdentifier s : shardMap.keySet()) {
+        for (final DOMDataTreeIdentifier s : shardMap.keySet()) {
             idToProducer.put(s, ret);
         }
 
@@ -5,9 +5,10 @@
  * 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;
+package org.opendaylight.mdsal.dom.broker.osgi;
 
 import static com.google.common.base.Preconditions.checkState;
+
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
@@ -18,11 +19,10 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Enumeration;
 import java.util.List;
-import org.opendaylight.controller.sal.core.api.model.SchemaService;
+import org.opendaylight.mdsal.dom.api.DOMSchemaService;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.concepts.Registration;
 import org.opendaylight.yangtools.util.ListenerRegistry;
-import org.opendaylight.yangtools.yang.model.api.Module;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.opendaylight.yangtools.yang.model.api.SchemaContextListener;
 import org.opendaylight.yangtools.yang.model.api.SchemaContextProvider;
@@ -38,8 +38,8 @@ import org.osgi.util.tracker.ServiceTrackerCustomizer;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class GlobalBundleScanningSchemaServiceImpl implements SchemaContextProvider, SchemaService, ServiceTrackerCustomizer<SchemaContextListener, SchemaContextListener>, AutoCloseable {
-    private static final Logger LOG = LoggerFactory.getLogger(GlobalBundleScanningSchemaServiceImpl.class);
+public class OsgiBundleScanningSchemaService implements SchemaContextProvider, DOMSchemaService, ServiceTrackerCustomizer<SchemaContextListener, SchemaContextListener>, AutoCloseable {
+    private static final Logger LOG = LoggerFactory.getLogger(OsgiBundleScanningSchemaService.class);
 
     private final ListenerRegistry<SchemaContextListener> listeners = new ListenerRegistry<>();
     private final URLSchemaContextResolver contextResolver = URLSchemaContextResolver.create("global-bundle");
@@ -49,20 +49,20 @@ public class GlobalBundleScanningSchemaServiceImpl implements SchemaContextProvi
     private ServiceTracker<SchemaContextListener, SchemaContextListener> listenerTracker;
     private BundleTracker<Iterable<Registration>> bundleTracker;
     private boolean starting = true;
-    private static GlobalBundleScanningSchemaServiceImpl instance;
+    private static OsgiBundleScanningSchemaService instance;
 
-    private GlobalBundleScanningSchemaServiceImpl(final BundleContext context) {
+    private OsgiBundleScanningSchemaService(final BundleContext context) {
         this.context = Preconditions.checkNotNull(context);
     }
 
-    public synchronized static GlobalBundleScanningSchemaServiceImpl createInstance(final BundleContext ctx) {
+    public synchronized static OsgiBundleScanningSchemaService createInstance(final BundleContext ctx) {
         Preconditions.checkState(instance == null);
-        instance = new GlobalBundleScanningSchemaServiceImpl(ctx);
+        instance = new OsgiBundleScanningSchemaService(ctx);
         instance.start();
         return instance;
     }
 
-    public synchronized static GlobalBundleScanningSchemaServiceImpl getInstance() {
+    public synchronized static OsgiBundleScanningSchemaService getInstance() {
         Preconditions.checkState(instance != null, "Global Instance was not instantiated");
         return instance;
     }
@@ -84,7 +84,7 @@ public class GlobalBundleScanningSchemaServiceImpl implements SchemaContextProvi
         checkState(context != null);
         LOG.debug("start() starting");
 
-        listenerTracker = new ServiceTracker<>(context, SchemaContextListener.class, GlobalBundleScanningSchemaServiceImpl.this);
+        listenerTracker = new ServiceTracker<>(context, SchemaContextListener.class, OsgiBundleScanningSchemaService.this);
         bundleTracker = new BundleTracker<>(context, Bundle.RESOLVED | Bundle.STARTING |
                 Bundle.STOPPING | Bundle.ACTIVE, scanner);
         bundleTracker.open();
@@ -108,24 +108,14 @@ public class GlobalBundleScanningSchemaServiceImpl implements SchemaContextProvi
         return contextResolver.getSchemaContext().orNull();
     }
 
-    @Override
-    public void addModule(final Module module) {
-        throw new UnsupportedOperationException();
-    }
-
     @Override
     public SchemaContext getSessionContext() {
         throw new UnsupportedOperationException();
     }
 
-    @Override
-    public void removeModule(final Module module) {
-        throw new UnsupportedOperationException();
-    }
-
     @Override
     public synchronized ListenerRegistration<SchemaContextListener> registerSchemaContextListener(final SchemaContextListener listener) {
-        Optional<SchemaContext> potentialCtx = contextResolver.getSchemaContext();
+        final Optional<SchemaContext> potentialCtx = contextResolver.getSchemaContext();
         if(potentialCtx.isPresent()) {
             listener.onGlobalContextUpdated(potentialCtx.get());
         }
@@ -141,26 +131,26 @@ public class GlobalBundleScanningSchemaServiceImpl implements SchemaContextProvi
             listenerTracker.close();
         }
 
-        for (ListenerRegistration<SchemaContextListener> l : listeners.getListeners()) {
+        for (final ListenerRegistration<SchemaContextListener> l : listeners.getListeners()) {
             l.close();
         }
     }
 
     private synchronized void updateContext(final SchemaContext snapshot) {
-        Object[] services = listenerTracker.getServices();
-        for (ListenerRegistration<SchemaContextListener> listener : listeners) {
+        final Object[] services = listenerTracker.getServices();
+        for (final ListenerRegistration<SchemaContextListener> listener : listeners) {
             try {
                 listener.getInstance().onGlobalContextUpdated(snapshot);
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 LOG.error("Exception occured during invoking listener", e);
             }
         }
         if (services != null) {
-            for (Object rawListener : services) {
+            for (final Object rawListener : services) {
                 final SchemaContextListener listener = (SchemaContextListener) rawListener;
                 try {
                     listener.onGlobalContextUpdated(snapshot);
-                } catch (Exception e) {
+                } catch (final Exception e) {
                     LOG.error("Exception occured during invoking listener {}", listener, e);
                 }
             }
@@ -186,7 +176,7 @@ public class GlobalBundleScanningSchemaServiceImpl implements SchemaContextProvi
                 try {
                     urls.add(contextResolver.registerSource(u));
                     LOG.debug("Registered {}", u);
-                } catch (Exception e) {
+                } catch (final Exception e) {
                     LOG.warn("Failed to register {}, ignoring it", e);
                 }
             }
@@ -212,15 +202,15 @@ public class GlobalBundleScanningSchemaServiceImpl implements SchemaContextProvi
 
         @Override
         public synchronized void removedBundle(final Bundle bundle, final BundleEvent event, final Iterable<Registration> urls) {
-            for (Registration url : urls) {
+            for (final Registration url : urls) {
                 try {
                     url.close();
-                } catch (Exception e) {
+                } catch (final Exception e) {
                     LOG.warn("Failed do unregister URL {}, proceeding", url, e);
                 }
             }
 
-            int numUrls = Iterables.size(urls);
+            final int numUrls = Iterables.size(urls);
             if(numUrls > 0 ) {
                 if(LOG.isDebugEnabled()) {
                     LOG.debug("removedBundle: {}, state: {}, # urls: {}", bundle.getSymbolicName(), bundle.getState(), numUrls);
@@ -234,8 +224,8 @@ public class GlobalBundleScanningSchemaServiceImpl implements SchemaContextProvi
     @Override
     public synchronized SchemaContextListener addingService(final ServiceReference<SchemaContextListener> reference) {
 
-        SchemaContextListener listener = context.getService(reference);
-        SchemaContext _ctxContext = getGlobalContext();
+        final SchemaContextListener listener = context.getService(reference);
+        final SchemaContext _ctxContext = getGlobalContext();
         if (getContext() != null && _ctxContext != null) {
             listener.onGlobalContextUpdated(_ctxContext);
         }
@@ -246,7 +236,7 @@ public class GlobalBundleScanningSchemaServiceImpl implements SchemaContextProvi
         if (starting) {
             return;
         }
-        Optional<SchemaContext> schema = contextResolver.getSchemaContext();
+        final Optional<SchemaContext> schema = contextResolver.getSchemaContext();
         if(schema.isPresent()) {
             if(LOG.isDebugEnabled()) {
                 LOG.debug("Got new SchemaContext: # of modules {}", schema.get().getAllModuleIdentifiers().size());
similarity index 58%
rename from dom/mdsal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/SchemaServiceActivator.java
rename to dom/mdsal-dom-broker/src/main/java/org/opendaylight/mdsal/dom/broker/osgi/SchemaServiceActivator.java
index 37093c7d13fbe5d402f41bf56d758b980818e0a4..438ad76ac0d9238e7e06e67786c67f7e70fa8b05 100644 (file)
@@ -5,11 +5,10 @@
  * 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;
+package org.opendaylight.mdsal.dom.broker.osgi;
 
+import org.opendaylight.mdsal.dom.api.DOMSchemaService;
 import java.util.Hashtable;
-import org.opendaylight.controller.sal.core.api.model.SchemaService;
-import org.opendaylight.controller.sal.dom.broker.GlobalBundleScanningSchemaServiceImpl;
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceRegistration;
@@ -17,13 +16,13 @@ import org.osgi.framework.ServiceRegistration;
 public class SchemaServiceActivator implements BundleActivator {
 
 
-    private ServiceRegistration<SchemaService> schemaServiceReg;
-    private GlobalBundleScanningSchemaServiceImpl schemaService;
+    private ServiceRegistration<DOMSchemaService> schemaServiceReg;
+    private OsgiBundleScanningSchemaService schemaService;
 
     @Override
     public void start(final BundleContext context) {
-        schemaService = GlobalBundleScanningSchemaServiceImpl.createInstance(context);
-        schemaServiceReg = context.registerService(SchemaService.class, schemaService, new Hashtable<String,String>());
+        schemaService = OsgiBundleScanningSchemaService.createInstance(context);
+        schemaServiceReg = context.registerService(DOMSchemaService.class, schemaService, new Hashtable<String,String>());
     }
 
     @Override
index 00af3dfdd7fee6098b488739d743a332ba6d8ff8..55877ee184f2be4aaff53fb45d2b056a9256d7c0 100644 (file)
@@ -7,9 +7,10 @@
  */
 package org.opendaylight.controller.md.sal.dom.store.impl;
 
+import org.opendaylight.mdsal.dom.api.DOMSchemaService;
+
 import java.util.concurrent.ExecutorService;
 import javax.annotation.Nullable;
-import org.opendaylight.controller.sal.core.api.model.SchemaService;
 import org.opendaylight.yangtools.util.concurrent.SpecialExecutors;
 
 /**
@@ -23,7 +24,7 @@ public final class InMemoryDOMDataStoreFactory {
     }
 
     public static InMemoryDOMDataStore create(final String name,
-            @Nullable final SchemaService schemaService) {
+            @Nullable final DOMSchemaService schemaService) {
         return create(name, schemaService, null);
     }
 
@@ -37,7 +38,7 @@ public final class InMemoryDOMDataStoreFactory {
      * @return an InMemoryDOMDataStore instance
      */
     public static InMemoryDOMDataStore create(final String name,
-            @Nullable final SchemaService schemaService,
+            @Nullable final DOMSchemaService schemaService,
             @Nullable final InMemoryDOMDataStoreConfigProperties properties) {
         return create(name, schemaService, false, properties);
     }
@@ -53,7 +54,7 @@ public final class InMemoryDOMDataStoreFactory {
      * @return an InMemoryDOMDataStore instance
      */
     public static InMemoryDOMDataStore create(final String name,
-            @Nullable final SchemaService schemaService, final boolean debugTransactions,
+            @Nullable final DOMSchemaService schemaService, final boolean debugTransactions,
             @Nullable final InMemoryDOMDataStoreConfigProperties properties) {
 
         InMemoryDOMDataStoreConfigProperties actualProperties = properties;
diff --git a/dom/mdsal-dom-spi/src/main/java/org/opendaylight/controller/sal/core/spi/ForwardingConsumerSession.java b/dom/mdsal-dom-spi/src/main/java/org/opendaylight/controller/sal/core/spi/ForwardingConsumerSession.java
deleted file mode 100644 (file)
index a8c2d3e..0000000
+++ /dev/null
@@ -1,32 +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.sal.core.spi;
-
-import org.opendaylight.controller.sal.core.api.Broker.ConsumerSession;
-import org.opendaylight.controller.sal.core.api.BrokerService;
-
-public abstract class ForwardingConsumerSession implements ConsumerSession {
-
-    protected abstract ConsumerSession delegate();
-
-    @Override
-    public void close() {
-        delegate().close();
-    }
-
-    @Override
-    public <T extends BrokerService> T getService(Class<T> arg0) {
-        return delegate().getService(arg0);
-    }
-
-    @Override
-    public boolean isClosed() {
-        return delegate().isClosed();
-    }
-
-}
diff --git a/dom/mdsal-dom-spi/src/main/java/org/opendaylight/controller/sal/core/spi/ForwardingProviderSession.java b/dom/mdsal-dom-spi/src/main/java/org/opendaylight/controller/sal/core/spi/ForwardingProviderSession.java
deleted file mode 100644 (file)
index 87cce97..0000000
+++ /dev/null
@@ -1,33 +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.sal.core.spi;
-
-import org.opendaylight.controller.sal.core.api.Broker.ProviderSession;
-import org.opendaylight.controller.sal.core.api.BrokerService;
-
-public abstract class ForwardingProviderSession implements ProviderSession {
-
-    protected abstract ProviderSession delegate();
-
-    @Override
-    public void close() {
-        delegate().close();
-    }
-
-    @Override
-    public <T extends BrokerService> T getService(Class<T> arg0) {
-        return delegate().getService(arg0);
-    }
-
-    @Override
-    public boolean isClosed() {
-        return delegate().isClosed();
-    }
-
-}
diff --git a/dom/mdsal-dom-spi/src/main/java/org/opendaylight/controller/sal/core/spi/package-info.java b/dom/mdsal-dom-spi/src/main/java/org/opendaylight/controller/sal/core/spi/package-info.java
deleted file mode 100644 (file)
index 76493af..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.sal.core.spi;
\ No newline at end of file