<groupId>${project.groupId}</groupId>
<artifactId>sal-core-spi</artifactId>
</dependency>
- <dependency>
- <!-- TODO start-level="70" -->
- <groupId>${project.groupId}</groupId>
- <artifactId>sal-schema-service</artifactId>
- </dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>sal-broker-impl</artifactId>
<feature name="odl-mdsal-broker-local" version="${project.version}">
<feature version="[3.1.0,4)">odl-lmax-3</feature>
<feature version="[2.0.3,3)">odl-yangtools-codec</feature>
- <bundle start-level="70">mvn:org.opendaylight.controller/sal-schema-service/${project.version}</bundle>
<bundle start-level="40">mvn:org.opendaylight.controller/blueprint/${blueprint.version}</bundle>
</feature>
</features>
<artifactId>sal-inmemory-datastore</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>sal-schema-service</artifactId>
- <version>${project.version}</version>
- </dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>mdsal-trace-api</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
- <build>
+
+ <build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
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,
*
</Import-Package>
</instructions>
</configuration>
</plugin>
</plugins>
- </build>
+ </build>
</project>
<module>sal-dom-broker</module>
<module>sal-dom-spi</module>
<module>sal-dom-compat</module>
- <module>sal-schema-service</module>
<!-- Binding Aware -->
<module>sal-binding-api</module>
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 {
return this.bindingToNormalized;
}
- public SchemaService getSchemaService() {
+ public DOMSchemaService getSchemaService() {
return this.schemaService;
}
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 {
return dataBrokerTest.getDataBrokerTestCustomizer().getDomNotificationRouter();
}
- public SchemaService getSchemaService() {
+ public DOMSchemaService getSchemaService() {
return dataBrokerTest.getDataBrokerTestCustomizer().getSchemaService();
}
*/
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<SchemaContextListener> listeners = ListenerRegistry.create();
- @Override
- public void addModule(final Module module) {
- throw new UnsupportedOperationException();
- }
-
@Override
public synchronized SchemaContext getGlobalContext() {
return schemaContext;
return listeners.register(listener);
}
- @Override
- public void removeModule(final Module module) {
- throw new UnsupportedOperationException();
- }
-
@Override
public synchronized SchemaContext getSchemaContext() {
return schemaContext;
+++ /dev/null
-/*
- * 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<SchemaContextListener> registerSchemaContextListener(SchemaContextListener listener);
-}
+++ /dev/null
-/*
- * 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<YangTextSchemaSource> {
-}
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;
/**
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);
}
*/
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;
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<SchemaService> {
+ private static final class SchemaServiceAdapter implements SchemaContextProvider, Delegator<DOMSchemaService> {
- private final SchemaService service;
+ private final DOMSchemaService service;
- SchemaServiceAdapter(final SchemaService service) {
+ SchemaServiceAdapter(final DOMSchemaService service) {
this.service = service;
}
}
@Override
- public SchemaService getDelegate() {
+ public DOMSchemaService getDelegate() {
return service;
}
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")
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);
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);
}
+++ /dev/null
-/*
- * 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;
- }
-}
<!-- Schema Service -->
- <odl:static-reference id="schemaService" interface="org.opendaylight.controller.sal.core.api.model.SchemaService"/>
+ <odl:static-reference id="schemaService" interface="org.opendaylight.mdsal.dom.api.DOMSchemaService"/>
<!-- DOM Notification Service -->
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>mdsal-parent</artifactId>
- <version>1.8.0-SNAPSHOT</version>
- <relativePath>../parent</relativePath>
- </parent>
-
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-schema-service</artifactId>
- <version>1.8.0-SNAPSHOT</version>
- <packaging>bundle</packaging>
-
- <dependencies>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-core-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>yang-parser-impl</artifactId>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </dependency>
- </dependencies>
-
- <scm>
- <connection>scm:git:http://git.opendaylight.org/gerrit/controller.git</connection>
- <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>
- <tag>HEAD</tag>
- <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL</url>
- </scm>
-
-</project>
+++ /dev/null
-/*
- * 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<ListenerRegistration<?>> 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<SchemaContextListener> registerSchemaContextListener(
- final SchemaContextListener listener) {
- synchronized (lock) {
- final ListenerRegistration<SchemaContextListener> reg = schemaService.registerSchemaContextListener(
- listener);
-
- final ListenerRegistration<SchemaContextListener> ret =
- new AbstractListenerRegistration<SchemaContextListener>(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<YangTextSchemaSource, SchemaSourceException> getSource(
- final SourceIdentifier sourceIdentifier) {
- if (yangProvider == null) {
- return Futures.immediateFailedCheckedFuture(new MissingSchemaSourceException(
- "Source provider is not available", sourceIdentifier));
- }
-
- return Futures.makeChecked((ListenableFuture<YangTextSchemaSource>) yangProvider.getSource(sourceIdentifier),
- e -> new SchemaSourceException("Error retrieving source", e));
- }
-}
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
- xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0"
- xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0">
- <!-- MD-SAL's DOMSchemaService -->
- <odl:static-reference id="domSchemaService" interface="org.opendaylight.mdsal.dom.api.DOMSchemaService"/>
-
- <!-- Schema Service -->
- <bean id="schemaService" class="org.opendaylight.controller.sal.schema.service.impl.GlobalBundleScanningSchemaServiceImpl"
- factory-method="createInstance">
- <argument ref="domSchemaService"/>
- </bean>
-
- <service ref="schemaService" odl:type="default">
- <interfaces>
- <value>org.opendaylight.controller.sal.core.api.model.SchemaService</value>
- <value>org.opendaylight.controller.sal.core.api.model.YangTextSourceProvider</value>
- </interfaces>
- </service>
-</blueprint>
* 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;
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;
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;
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,
<reference id="domRpcProviderService" interface="org.opendaylight.controller.md.sal.dom.api.DOMRpcProviderService"/>
<reference id="clusterSingletonService" interface="org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider"/>
<reference id="domDataBroker" interface="org.opendaylight.controller.md.sal.dom.api.DOMDataBroker"/>
- <reference id="schemaService" interface="org.opendaylight.controller.sal.core.api.model.SchemaService"/>
+ <reference id="schemaService" interface="org.opendaylight.mdsal.dom.api.DOMSchemaService"/>
<reference id="normalizedNodeSerializer" interface="org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer"/>
<reference id="notificationPublishService" interface="org.opendaylight.controller.md.sal.binding.api.NotificationPublishService" />
<reference id="notificationListenerService" interface="org.opendaylight.controller.md.sal.binding.api.NotificationService" />