From c7515b27b065ef5f4d14ae931413ea83a4c047a8 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Tue, 10 Jul 2018 09:48:19 +0200 Subject: [PATCH 1/1] Remove sal.core.api.model This removes deprecated and unused sal.core.api.model package along with its only implementation, migrating final stragglers to DOMSchemaService. Change-Id: Id355ffd96a5aaa0ffa48e018bfadea596ec58ac8 Signed-off-by: Robert Varga --- features/mdsal/odl-mdsal-broker-local/pom.xml | 5 - .../src/main/feature/feature.xml | 1 - opendaylight/md-sal/mdsal-artifacts/pom.xml | 5 - .../md-sal/mdsal-trace/binding-impl/pom.xml | 6 +- opendaylight/md-sal/pom.xml | 1 - .../AbstractDataBrokerTestCustomizer.java | 4 +- .../binding/test/DataBrokerTestModule.java | 4 +- .../binding/test/util/MockSchemaService.java | 15 +-- .../sal/core/api/model/SchemaService.java | 55 -------- .../api/model/YangTextSourceProvider.java | 18 --- .../LegacyShardedDOMDataBrokerAdapter.java | 6 +- .../broker/impl/SchemaContextProviders.java | 12 +- .../sal/dom/broker/osgi/ProxyFactory.java | 8 -- .../dom/broker/osgi/SchemaServiceProxy.java | 50 ------- .../org/opendaylight/blueprint/dom-broker.xml | 2 +- .../md-sal/sal-schema-service/pom.xml | 38 ------ ...GlobalBundleScanningSchemaServiceImpl.java | 122 ------------------ .../blueprint/sal-schema-service.xml | 20 --- .../provider/MdsalLowLevelTestProvider.java | 7 +- .../blueprint/cluster-test-app.xml | 2 +- 20 files changed, 23 insertions(+), 358 deletions(-) delete mode 100644 opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/model/SchemaService.java delete mode 100644 opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/model/YangTextSourceProvider.java delete mode 100644 opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/SchemaServiceProxy.java delete mode 100644 opendaylight/md-sal/sal-schema-service/pom.xml delete mode 100644 opendaylight/md-sal/sal-schema-service/src/main/java/org/opendaylight/controller/sal/schema/service/impl/GlobalBundleScanningSchemaServiceImpl.java delete mode 100644 opendaylight/md-sal/sal-schema-service/src/main/resources/org/opendaylight/blueprint/sal-schema-service.xml diff --git a/features/mdsal/odl-mdsal-broker-local/pom.xml b/features/mdsal/odl-mdsal-broker-local/pom.xml index 8f06a67f27..9b21e23074 100644 --- a/features/mdsal/odl-mdsal-broker-local/pom.xml +++ b/features/mdsal/odl-mdsal-broker-local/pom.xml @@ -139,11 +139,6 @@ ${project.groupId} sal-core-spi - - - ${project.groupId} - sal-schema-service - ${project.groupId} sal-broker-impl diff --git a/features/mdsal/odl-mdsal-broker-local/src/main/feature/feature.xml b/features/mdsal/odl-mdsal-broker-local/src/main/feature/feature.xml index b62ed47add..93066baa94 100644 --- a/features/mdsal/odl-mdsal-broker-local/src/main/feature/feature.xml +++ b/features/mdsal/odl-mdsal-broker-local/src/main/feature/feature.xml @@ -10,7 +10,6 @@ odl-lmax-3 odl-yangtools-codec - mvn:org.opendaylight.controller/sal-schema-service/${project.version} mvn:org.opendaylight.controller/blueprint/${blueprint.version} diff --git a/opendaylight/md-sal/mdsal-artifacts/pom.xml b/opendaylight/md-sal/mdsal-artifacts/pom.xml index 3ac86873cb..08495bb0e4 100644 --- a/opendaylight/md-sal/mdsal-artifacts/pom.xml +++ b/opendaylight/md-sal/mdsal-artifacts/pom.xml @@ -86,11 +86,6 @@ sal-inmemory-datastore ${project.version} - - ${project.groupId} - sal-schema-service - ${project.version} - ${project.groupId} mdsal-trace-api diff --git a/opendaylight/md-sal/mdsal-trace/binding-impl/pom.xml b/opendaylight/md-sal/mdsal-trace/binding-impl/pom.xml index 11da07fde8..38b2d2ee7a 100644 --- a/opendaylight/md-sal/mdsal-trace/binding-impl/pom.xml +++ b/opendaylight/md-sal/mdsal-trace/binding-impl/pom.xml @@ -39,7 +39,8 @@ and is available at http://www.eclipse.org/legal/epl-v10.html test - + + org.apache.felix @@ -52,12 +53,11 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.controller.md.sal.dom.api, org.opendaylight.controller.md.sal.binding.api, org.opendaylight.controller.md.sal.binding.spi, - org.opendaylight.controller.sal.core.api.model, * - + diff --git a/opendaylight/md-sal/pom.xml b/opendaylight/md-sal/pom.xml index 183bc25de2..776fdf6589 100644 --- a/opendaylight/md-sal/pom.xml +++ b/opendaylight/md-sal/pom.xml @@ -28,7 +28,6 @@ sal-dom-broker sal-dom-spi sal-dom-compat - sal-schema-service sal-binding-api diff --git a/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/md/sal/binding/test/AbstractDataBrokerTestCustomizer.java b/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/md/sal/binding/test/AbstractDataBrokerTestCustomizer.java index f36b685435..722bbd28d0 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/md/sal/binding/test/AbstractDataBrokerTestCustomizer.java +++ b/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/md/sal/binding/test/AbstractDataBrokerTestCustomizer.java @@ -24,13 +24,13 @@ import org.opendaylight.controller.md.sal.dom.broker.impl.DOMNotificationRouter; import org.opendaylight.controller.md.sal.dom.broker.impl.SerializedDOMDataBroker; import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore; import org.opendaylight.controller.sal.binding.test.util.MockSchemaService; -import org.opendaylight.controller.sal.core.api.model.SchemaService; import org.opendaylight.controller.sal.core.spi.data.DOMStore; import org.opendaylight.mdsal.binding.dom.codec.gen.impl.DataObjectSerializerGenerator; import org.opendaylight.mdsal.binding.dom.codec.gen.impl.StreamWriterGenerator; import org.opendaylight.mdsal.binding.dom.codec.impl.BindingNormalizedNodeCodecRegistry; import org.opendaylight.mdsal.binding.generator.impl.GeneratedClassLoadingStrategy; import org.opendaylight.mdsal.binding.generator.util.JavassistUtils; +import org.opendaylight.mdsal.dom.api.DOMSchemaService; import org.opendaylight.yangtools.yang.model.api.SchemaContext; public abstract class AbstractDataBrokerTestCustomizer { @@ -98,7 +98,7 @@ public abstract class AbstractDataBrokerTestCustomizer { return this.bindingToNormalized; } - public SchemaService getSchemaService() { + public DOMSchemaService getSchemaService() { return this.schemaService; } diff --git a/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/md/sal/binding/test/DataBrokerTestModule.java b/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/md/sal/binding/test/DataBrokerTestModule.java index fd95a50145..f98f1a1845 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/md/sal/binding/test/DataBrokerTestModule.java +++ b/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/md/sal/binding/test/DataBrokerTestModule.java @@ -11,7 +11,7 @@ import org.opendaylight.controller.md.sal.binding.api.DataBroker; import org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec; import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker; import org.opendaylight.controller.md.sal.dom.broker.impl.DOMNotificationRouter; -import org.opendaylight.controller.sal.core.api.model.SchemaService; +import org.opendaylight.mdsal.dom.api.DOMSchemaService; import org.opendaylight.yangtools.yang.model.api.SchemaContextProvider; public class DataBrokerTestModule { @@ -56,7 +56,7 @@ public class DataBrokerTestModule { return dataBrokerTest.getDataBrokerTestCustomizer().getDomNotificationRouter(); } - public SchemaService getSchemaService() { + public DOMSchemaService getSchemaService() { return dataBrokerTest.getDataBrokerTestCustomizer().getSchemaService(); } diff --git a/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/util/MockSchemaService.java b/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/util/MockSchemaService.java index 8fc60e4bbb..cd89c4ed6c 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/util/MockSchemaService.java +++ b/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/util/MockSchemaService.java @@ -7,25 +7,19 @@ */ package org.opendaylight.controller.sal.binding.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 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/opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/model/SchemaService.java b/opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/model/SchemaService.java deleted file mode 100644 index 673849d09d..0000000000 --- a/opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/model/SchemaService.java +++ /dev/null @@ -1,55 +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.model; - -import org.opendaylight.controller.sal.core.api.BrokerService; -import org.opendaylight.mdsal.dom.api.DOMSchemaService; -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; - -/** - * Deprecated. - * - * @deprecated Use {@link DOMSchemaService} instead. - */ -@Deprecated -public interface SchemaService extends BrokerService, DOMSchemaService { - - /** - * Registers a YANG module to session and global context. - */ - void addModule(Module module); - - /** - * Unregisters a YANG module from session context. - */ - void removeModule(Module module); - - /** - * Returns session specific YANG schema context. - */ - @Override - SchemaContext getSessionContext(); - - /** - * Returns global schema context. - */ - @Override - SchemaContext getGlobalContext(); - - /** - * Register a listener for changes in schema context. - * - * @param listener Listener which should be registered - * @return Listener registration handle - */ - @Override - ListenerRegistration registerSchemaContextListener(SchemaContextListener listener); -} diff --git a/opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/model/YangTextSourceProvider.java b/opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/model/YangTextSourceProvider.java deleted file mode 100644 index a17cd70310..0000000000 --- a/opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/model/YangTextSourceProvider.java +++ /dev/null @@ -1,18 +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.model; - -import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource; -import org.opendaylight.yangtools.yang.model.repo.spi.SchemaSourceProvider; - -/** - * Concrete source provider for text based yang sources. Suitable when trying to avoid - * generics e.g. when exposing a source provider into config subsystem. - */ -public interface YangTextSourceProvider extends SchemaSourceProvider { -} diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/legacy/sharded/adapter/LegacyShardedDOMDataBrokerAdapter.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/legacy/sharded/adapter/LegacyShardedDOMDataBrokerAdapter.java index 402d9753d8..8839b96a2c 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/legacy/sharded/adapter/LegacyShardedDOMDataBrokerAdapter.java +++ b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/legacy/sharded/adapter/LegacyShardedDOMDataBrokerAdapter.java @@ -21,7 +21,7 @@ import org.opendaylight.controller.md.sal.dom.api.DOMDataReadOnlyTransaction; import org.opendaylight.controller.md.sal.dom.api.DOMDataReadWriteTransaction; import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction; import org.opendaylight.controller.md.sal.dom.api.DOMTransactionChain; -import org.opendaylight.controller.sal.core.api.model.SchemaService; +import org.opendaylight.mdsal.dom.api.DOMSchemaService; import org.opendaylight.mdsal.dom.broker.ShardedDOMDataBrokerAdapter; /** @@ -40,12 +40,12 @@ import org.opendaylight.mdsal.dom.broker.ShardedDOMDataBrokerAdapter; public class LegacyShardedDOMDataBrokerAdapter implements DOMDataBroker { private final org.opendaylight.mdsal.dom.api.DOMDataBroker delegateDataBroker; - private final SchemaService schemaService; + private final DOMSchemaService schemaService; private final AtomicLong txNum = new AtomicLong(); private final AtomicLong chainNum = new AtomicLong(); public LegacyShardedDOMDataBrokerAdapter(final ShardedDOMDataBrokerAdapter delegateDataBroker, - final SchemaService schemaService) { + final DOMSchemaService schemaService) { this.delegateDataBroker = checkNotNull(delegateDataBroker); this.schemaService = checkNotNull(schemaService); } diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/impl/SchemaContextProviders.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/impl/SchemaContextProviders.java index 7fc33d15c5..6a7ab9c3c5 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/impl/SchemaContextProviders.java +++ b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/impl/SchemaContextProviders.java @@ -7,7 +7,7 @@ */ package org.opendaylight.controller.sal.dom.broker.impl; -import org.opendaylight.controller.sal.core.api.model.SchemaService; +import org.opendaylight.mdsal.dom.api.DOMSchemaService; import org.opendaylight.yangtools.concepts.Delegator; import org.opendaylight.yangtools.yang.model.api.SchemaContext; import org.opendaylight.yangtools.yang.model.api.SchemaContextProvider; @@ -18,18 +18,18 @@ public final class SchemaContextProviders { throw new UnsupportedOperationException("Utility class."); } - public static SchemaContextProvider fromSchemaService(final SchemaService schemaService) { + public static SchemaContextProvider fromSchemaService(final DOMSchemaService schemaService) { if (schemaService instanceof SchemaContextProvider) { return (SchemaContextProvider) schemaService; } return new SchemaServiceAdapter(schemaService); } - private static final class SchemaServiceAdapter implements SchemaContextProvider, Delegator { + private static final class SchemaServiceAdapter implements SchemaContextProvider, Delegator { - private final SchemaService service; + private final DOMSchemaService service; - SchemaServiceAdapter(final SchemaService service) { + SchemaServiceAdapter(final DOMSchemaService service) { this.service = service; } @@ -39,7 +39,7 @@ public final class SchemaContextProviders { } @Override - public SchemaService getDelegate() { + public DOMSchemaService getDelegate() { return service; } diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/ProxyFactory.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/ProxyFactory.java index 1ca9f5da96..250ef7d463 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/ProxyFactory.java +++ b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/ProxyFactory.java @@ -10,7 +10,6 @@ package org.opendaylight.controller.sal.dom.broker.osgi; import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker; import org.opendaylight.controller.md.sal.dom.api.DOMMountPointService; import org.opendaylight.controller.sal.core.api.BrokerService; -import org.opendaylight.controller.sal.core.api.model.SchemaService; import org.osgi.framework.ServiceReference; @SuppressWarnings("unchecked") @@ -30,11 +29,6 @@ public final class ProxyFactory { return new DOMMountPointServiceProxy((ServiceReference) ref, service); } - private static Object createProxyImpl(final ServiceReference ref, final SchemaService service) { - - return new SchemaServiceProxy((ServiceReference) ref, service); - } - private static DOMDataBrokerProxy createProxyImpl(final ServiceReference ref, final DOMDataBroker service) { return new DOMDataBrokerProxy((ServiceReference) ref, service); @@ -47,8 +41,6 @@ public final class ProxyFactory { 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); } diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/SchemaServiceProxy.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/SchemaServiceProxy.java deleted file mode 100644 index 330caa932b..0000000000 --- a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/SchemaServiceProxy.java +++ /dev/null @@ -1,50 +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 implements SchemaService { - - public SchemaServiceProxy(ServiceReference 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 registerSchemaContextListener(SchemaContextListener listener) { - ListenerRegistration registration = getDelegate() - .registerSchemaContextListener(listener); - addRegistration(registration); - return registration; - } -} diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/resources/org/opendaylight/blueprint/dom-broker.xml b/opendaylight/md-sal/sal-dom-broker/src/main/resources/org/opendaylight/blueprint/dom-broker.xml index bff959c0ed..f77b7935e5 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/main/resources/org/opendaylight/blueprint/dom-broker.xml +++ b/opendaylight/md-sal/sal-dom-broker/src/main/resources/org/opendaylight/blueprint/dom-broker.xml @@ -14,7 +14,7 @@ - + diff --git a/opendaylight/md-sal/sal-schema-service/pom.xml b/opendaylight/md-sal/sal-schema-service/pom.xml deleted file mode 100644 index 7bbd3362e6..0000000000 --- a/opendaylight/md-sal/sal-schema-service/pom.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - 4.0.0 - - org.opendaylight.controller - mdsal-parent - 1.8.0-SNAPSHOT - ../parent - - - org.opendaylight.controller - sal-schema-service - 1.8.0-SNAPSHOT - bundle - - - - org.opendaylight.controller - sal-core-api - - - org.opendaylight.yangtools - yang-parser-impl - - - org.slf4j - slf4j-api - - - - - scm:git:http://git.opendaylight.org/gerrit/controller.git - scm:git:ssh://git.opendaylight.org:29418/controller.git - HEAD - https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL - - - diff --git a/opendaylight/md-sal/sal-schema-service/src/main/java/org/opendaylight/controller/sal/schema/service/impl/GlobalBundleScanningSchemaServiceImpl.java b/opendaylight/md-sal/sal-schema-service/src/main/java/org/opendaylight/controller/sal/schema/service/impl/GlobalBundleScanningSchemaServiceImpl.java deleted file mode 100644 index 7a91cdf7be..0000000000 --- a/opendaylight/md-sal/sal-schema-service/src/main/java/org/opendaylight/controller/sal/schema/service/impl/GlobalBundleScanningSchemaServiceImpl.java +++ /dev/null @@ -1,122 +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.schema.service.impl; - -import com.google.common.base.Preconditions; -import com.google.common.util.concurrent.CheckedFuture; -import com.google.common.util.concurrent.Futures; -import com.google.common.util.concurrent.ListenableFuture; -import java.util.HashSet; -import java.util.Set; -import javax.annotation.concurrent.GuardedBy; -import org.opendaylight.controller.sal.core.api.model.SchemaService; -import org.opendaylight.controller.sal.core.api.model.YangTextSourceProvider; -import org.opendaylight.mdsal.dom.api.DOMSchemaService; -import org.opendaylight.mdsal.dom.api.DOMYangTextSourceProvider; -import org.opendaylight.yangtools.concepts.AbstractListenerRegistration; -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.opendaylight.yangtools.yang.model.api.SchemaContextProvider; -import org.opendaylight.yangtools.yang.model.repo.api.MissingSchemaSourceException; -import org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceException; -import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier; -import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource; - -@Deprecated -public final class GlobalBundleScanningSchemaServiceImpl implements SchemaContextProvider, SchemaService, - YangTextSourceProvider, AutoCloseable { - - @GuardedBy("lock") - private final Set> listeners = new HashSet<>(); - private final Object lock = new Object(); - private final DOMSchemaService schemaService; - private final DOMYangTextSourceProvider yangProvider; - - private GlobalBundleScanningSchemaServiceImpl(final DOMSchemaService schemaService) { - this.schemaService = Preconditions.checkNotNull(schemaService); - this.yangProvider = (DOMYangTextSourceProvider) schemaService.getSupportedExtensions() - .get(DOMYangTextSourceProvider.class); - } - - public static GlobalBundleScanningSchemaServiceImpl createInstance(final DOMSchemaService schemaService) { - return new GlobalBundleScanningSchemaServiceImpl(schemaService); - } - - @Override - public SchemaContext getSchemaContext() { - return schemaService.getGlobalContext(); - } - - @Override - public SchemaContext getGlobalContext() { - return schemaService.getGlobalContext(); - } - - @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 ListenerRegistration registerSchemaContextListener( - final SchemaContextListener listener) { - synchronized (lock) { - final ListenerRegistration reg = schemaService.registerSchemaContextListener( - listener); - - final ListenerRegistration ret = - new AbstractListenerRegistration(listener) { - @Override - protected void removeRegistration() { - synchronized (lock) { - listeners.remove(this); - } - reg.close(); - } - }; - - listeners.add(ret); - return ret; - } - } - - @Override - public void close() { - synchronized (lock) { - for (ListenerRegistration l : listeners) { - l.close(); - } - listeners.clear(); - } - } - - @SuppressWarnings("unchecked") - @Override - public CheckedFuture getSource( - final SourceIdentifier sourceIdentifier) { - if (yangProvider == null) { - return Futures.immediateFailedCheckedFuture(new MissingSchemaSourceException( - "Source provider is not available", sourceIdentifier)); - } - - return Futures.makeChecked((ListenableFuture) yangProvider.getSource(sourceIdentifier), - e -> new SchemaSourceException("Error retrieving source", e)); - } -} diff --git a/opendaylight/md-sal/sal-schema-service/src/main/resources/org/opendaylight/blueprint/sal-schema-service.xml b/opendaylight/md-sal/sal-schema-service/src/main/resources/org/opendaylight/blueprint/sal-schema-service.xml deleted file mode 100644 index a9a1bdbb19..0000000000 --- a/opendaylight/md-sal/sal-schema-service/src/main/resources/org/opendaylight/blueprint/sal-schema-service.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - org.opendaylight.controller.sal.core.api.model.SchemaService - org.opendaylight.controller.sal.core.api.model.YangTextSourceProvider - - - diff --git a/opendaylight/md-sal/samples/clustering-test-app/provider/src/main/java/org/opendaylight/controller/clustering/it/provider/MdsalLowLevelTestProvider.java b/opendaylight/md-sal/samples/clustering-test-app/provider/src/main/java/org/opendaylight/controller/clustering/it/provider/MdsalLowLevelTestProvider.java index da6df6b855..9075a56c5e 100644 --- a/opendaylight/md-sal/samples/clustering-test-app/provider/src/main/java/org/opendaylight/controller/clustering/it/provider/MdsalLowLevelTestProvider.java +++ b/opendaylight/md-sal/samples/clustering-test-app/provider/src/main/java/org/opendaylight/controller/clustering/it/provider/MdsalLowLevelTestProvider.java @@ -5,7 +5,6 @@ * 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.clustering.it.provider; import static akka.actor.ActorRef.noSender; @@ -59,12 +58,12 @@ import org.opendaylight.controller.md.sal.dom.api.DOMRpcImplementationRegistrati import org.opendaylight.controller.md.sal.dom.api.DOMRpcProviderService; import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; -import org.opendaylight.controller.sal.core.api.model.SchemaService; import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer; import org.opendaylight.mdsal.common.api.LogicalDatastoreType; import org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier; import org.opendaylight.mdsal.dom.api.DOMDataTreeLoopException; import org.opendaylight.mdsal.dom.api.DOMDataTreeService; +import org.opendaylight.mdsal.dom.api.DOMSchemaService; import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider; import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceRegistration; import org.opendaylight.yang.gen.v1.tag.opendaylight.org._2017.controller.yang.lowlevel.control.rev170215.AddShardReplicaInput; @@ -170,7 +169,7 @@ public class MdsalLowLevelTestProvider implements OdlMdsalLowlevelControlService private final DOMDataBroker domDataBroker; private final NotificationPublishService notificationPublishService; private final NotificationService notificationService; - private final SchemaService schemaService; + private final DOMSchemaService schemaService; private final ClusterSingletonServiceProvider singletonService; private final DOMRpcProviderService domRpcService; private final PrefixLeaderHandler prefixLeaderHandler; @@ -197,7 +196,7 @@ public class MdsalLowLevelTestProvider implements OdlMdsalLowlevelControlService public MdsalLowLevelTestProvider(final RpcProviderRegistry rpcRegistry, final DOMRpcProviderService domRpcService, final ClusterSingletonServiceProvider singletonService, - final SchemaService schemaService, + final DOMSchemaService schemaService, final BindingNormalizedNodeSerializer bindingNormalizedNodeSerializer, final NotificationPublishService notificationPublishService, final NotificationService notificationService, diff --git a/opendaylight/md-sal/samples/clustering-test-app/provider/src/main/resources/org/opendaylight/blueprint/cluster-test-app.xml b/opendaylight/md-sal/samples/clustering-test-app/provider/src/main/resources/org/opendaylight/blueprint/cluster-test-app.xml index 2a914ffae7..ba2e312c82 100644 --- a/opendaylight/md-sal/samples/clustering-test-app/provider/src/main/resources/org/opendaylight/blueprint/cluster-test-app.xml +++ b/opendaylight/md-sal/samples/clustering-test-app/provider/src/main/resources/org/opendaylight/blueprint/cluster-test-app.xml @@ -11,7 +11,7 @@ - + -- 2.36.6