Version Bump To Silicon.
JIRA-ID: ODLMICRO-56
Change-Id: Iecb6e2f3e5bea83da40043c6bc8367c7dcf4c14c
Signed-off-by: Venkatrangan Govindarajan <gvrangan@gmail.com>
<dependency>
<groupId>org.opendaylight.serviceutils</groupId>
<artifactId>srm-api</artifactId>
- <version>0.6.0-SNAPSHOT</version>
+ <version>0.7.0-SNAPSHOT</version>
</dependency>
<!--serviceutils-->
<dependency>
<groupId>org.opendaylight.serviceutils</groupId>
<artifactId>srm-impl</artifactId>
- <version>0.6.0-SNAPSHOT</version>
+ <version>0.7.0-SNAPSHOT</version>
</dependency>
<!--serviceutils-->
<dependency>
<groupId>org.opendaylight.serviceutils</groupId>
<artifactId>upgrade</artifactId>
- <version>0.6.0-SNAPSHOT</version>
+ <version>0.7.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<groupId>org.codehaus.woodstox</groupId>
<artifactId>stax2-api</artifactId>
</dependency>
+
+ <!-- fix build failures -->
+ <dependency>
+ <groupId>org.immutables</groupId>
+ <artifactId>value</artifactId>
+ <version>2.8.8</version>
+ <scope>compile</scope>
+ </dependency>
</dependencies>
<build>
</plugin>
</plugins>
</build>
-</project>
\ No newline at end of file
+</project>
import javax.inject.Singleton;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.stream.XMLStreamException;
+import org.gaul.modernizer_maven_annotations.SuppressModernizer;
import org.opendaylight.controller.blueprint.ext.BindingContext;
import org.opendaylight.controller.blueprint.ext.ConfigXMLReaderException;
import org.opendaylight.controller.blueprint.ext.DataStoreAppConfigDefaultXMLReader;
return read(resourcePathWithoutExtension, yangType, null);
}
+ @SuppressModernizer
public <T extends DataObject> T read(String resourcePathWithoutExtension, Class<T> yangType, String listKeyValue) {
String xmlResourcePath = resourcePathWithoutExtension + ".xml";
URL xmlResourceURL = Resources.getResource(ConfigReader.class, xmlResourcePath);
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.runtime.api.BindingRuntimeContext;
import org.opendaylight.mdsal.dom.api.DOMDataBroker;
-import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
public abstract class AbstractBaseDataBrokerTest extends AbstractSchemaAwareTest {
private static final int ASSERT_COMMIT_DEFAULT_TIMEOUT = 5000;
}
@Override
- protected void setupWithSchema(final EffectiveModelContext context) {
+ protected void setupWithRuntimeContext(final BindingRuntimeContext runtimeContext) {
testCustomizer = createDataBrokerTestCustomizer();
dataBroker = testCustomizer.createDataBroker();
domBroker = testCustomizer.getDOMDataBroker();
- testCustomizer.updateSchema(context);
+ testCustomizer.updateSchema(runtimeContext);
+ super.setupWithRuntimeContext(runtimeContext);
}
public DataBroker getDataBroker() {
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.test.util.MockSchemaService;
+import org.opendaylight.mdsal.binding.runtime.api.BindingRuntimeContext;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.mdsal.dom.api.DOMDataBroker;
import org.opendaylight.mdsal.dom.api.DOMSchemaService;
import org.opendaylight.mdsal.dom.broker.SerializedDOMDataBroker;
import org.opendaylight.mdsal.dom.spi.store.DOMStore;
import org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStore;
-import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
public abstract class AbstractDataBrokerTestCustomizer {
+ private final DOMNotificationRouter domNotificationRouter = DOMNotificationRouter.create(16);
+ private final MockSchemaService schemaService = new MockSchemaService();
private DOMDataBroker domDataBroker;
- private final DOMNotificationRouter domNotificationRouter;
- private final MockSchemaService schemaService;
private ImmutableMap<LogicalDatastoreType, DOMStore> datastores;
- private final MockAdapterContext adapterContext;
public ImmutableMap<LogicalDatastoreType, DOMStore> createDatastores() {
return ImmutableMap.<LogicalDatastoreType, DOMStore>builder()
.build();
}
- public AbstractDataBrokerTestCustomizer() {
- schemaService = new MockSchemaService();
- adapterContext = new MockAdapterContext();
- schemaService.registerSchemaContextListener(adapterContext);
- domNotificationRouter = DOMNotificationRouter.create(16);
- }
-
public DOMStore createConfigurationDatastore() {
final InMemoryDOMDataStore store = new InMemoryDOMDataStore("CFG", getDataTreeChangeListenerExecutor());
schemaService.registerSchemaContextListener(store);
}
public NotificationService createNotificationService() {
- return new BindingDOMNotificationServiceAdapter(adapterContext, domNotificationRouter);
+ return new BindingDOMNotificationServiceAdapter(schemaService, domNotificationRouter);
}
public NotificationPublishService createNotificationPublishService() {
- return new BindingDOMNotificationPublishServiceAdapter(adapterContext, domNotificationRouter);
+ return new BindingDOMNotificationPublishServiceAdapter(schemaService, domNotificationRouter);
}
public abstract ListeningExecutorService getCommitCoordinatorExecutor();
}
public DataBroker createDataBroker() {
- return new BindingDOMDataBrokerAdapter(adapterContext, getDOMDataBroker());
+ return new BindingDOMDataBrokerAdapter(schemaService, getDOMDataBroker());
}
public AdapterContext getAdapterContext() {
- return adapterContext;
+ return schemaService;
}
public DOMSchemaService getSchemaService() {
return datastores;
}
- public void updateSchema(final EffectiveModelContext ctx) {
+ public void updateSchema(final BindingRuntimeContext ctx) {
schemaService.changeSchema(ctx);
}
import org.opendaylight.mdsal.binding.api.NotificationPublishService;
import org.opendaylight.mdsal.binding.api.NotificationService;
import org.opendaylight.mdsal.binding.dom.adapter.AdapterContext;
+import org.opendaylight.mdsal.binding.runtime.api.BindingRuntimeContext;
import org.opendaylight.mdsal.dom.broker.DOMNotificationRouter;
-import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
public class AbstractNotificationBrokerTest extends AbstractSchemaAwareTest {
private AdapterContext bindingToNormalizedNodeCodec;
@Override
- protected void setupWithSchema(final EffectiveModelContext context) {
+ protected void setupWithRuntimeContext(final BindingRuntimeContext runtimeContext) {
final DataBrokerTestCustomizer testCustomizer = createDataBrokerTestCustomizer();
domNotificationRouter = testCustomizer.getDomNotificationRouter();
notificationService = testCustomizer.createNotificationService();
notificationPublishService = testCustomizer.createNotificationPublishService();
bindingToNormalizedNodeCodec = testCustomizer.getAdapterContext();
- testCustomizer.updateSchema(context);
+ testCustomizer.updateSchema(runtimeContext);
+ super.setupWithRuntimeContext(runtimeContext);
}
protected DataBrokerTestCustomizer createDataBrokerTestCustomizer() {
import com.google.common.cache.LoadingCache;
import java.util.Set;
import org.junit.Before;
-import org.opendaylight.binding.runtime.spi.BindingRuntimeHelpers;
+import org.opendaylight.mdsal.binding.runtime.api.BindingRuntimeContext;
+import org.opendaylight.mdsal.binding.runtime.spi.BindingRuntimeHelpers;
import org.opendaylight.mdsal.binding.spec.reflect.BindingReflections;
import org.opendaylight.yangtools.yang.binding.YangModuleInfo;
import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
public abstract class AbstractSchemaAwareTest {
- private static final LoadingCache<Set<YangModuleInfo>, EffectiveModelContext> SCHEMA_CONTEXT_CACHE =
+ private static final LoadingCache<Set<YangModuleInfo>, BindingRuntimeContext> RUNTIME_CONTEXT_CACHE =
CacheBuilder.newBuilder().weakValues().build(
- new CacheLoader<Set<YangModuleInfo>, EffectiveModelContext>() {
+ new CacheLoader<Set<YangModuleInfo>, BindingRuntimeContext>() {
@Override
- public EffectiveModelContext load(final Set<YangModuleInfo> key) {
- return BindingRuntimeHelpers.createEffectiveModel(key);
+ public BindingRuntimeContext load(final Set<YangModuleInfo> key) {
+ return BindingRuntimeHelpers.createRuntimeContext(key);
}
});
@Before
public final void setup() throws Exception {
- setupWithSchema(getSchemaContext());
+ setupWithRuntimeContext(getRuntimeContext());
}
protected Set<YangModuleInfo> getModuleInfos() throws Exception {
return BindingReflections.cacheModuleInfos(Thread.currentThread().getContextClassLoader());
}
+ protected BindingRuntimeContext getRuntimeContext() throws Exception {
+ return RUNTIME_CONTEXT_CACHE.getUnchecked(getModuleInfos());
+ }
+
protected EffectiveModelContext getSchemaContext() throws Exception {
- return SCHEMA_CONTEXT_CACHE.getUnchecked(getModuleInfos());
+ return getRuntimeContext().getEffectiveModelContext();
+ }
+
+ protected void setupWithRuntimeContext(final BindingRuntimeContext runtimeContext) {
+ setupWithSchema(runtimeContext.getEffectiveModelContext());
}
/**
- * Setups test with Schema context.
+ * Setups test with EffectiveModelContext.
*
* @param context schema context
*/
- protected abstract void setupWithSchema(EffectiveModelContext context);
+ protected void setupWithSchema(final EffectiveModelContext context) {
+ // No-op
+ }
}
+++ /dev/null
-/*
- * Copyright (c) 2020 PANTHEON.tech, s.r.o. 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.mdsal.micro.binding.dom.adapter;
-
-import static com.google.common.base.Verify.verifyNotNull;
-
-import org.opendaylight.binding.runtime.api.DefaultBindingRuntimeContext;
-import org.opendaylight.mdsal.binding.dom.adapter.AdapterContext;
-import org.opendaylight.mdsal.binding.dom.adapter.CurrentAdapterSerializer;
-import org.opendaylight.mdsal.binding.dom.codec.impl.BindingCodecContext;
-import org.opendaylight.mdsal.binding.generator.impl.DefaultBindingRuntimeGenerator;
-import org.opendaylight.yangtools.util.ClassLoaderUtils;
-import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
-import org.opendaylight.yangtools.yang.model.api.EffectiveModelContextListener;
-
-public final class MockAdapterContext implements AdapterContext, EffectiveModelContextListener {
- private volatile CurrentAdapterSerializer serializer = null;
-
- @Override
- public CurrentAdapterSerializer currentSerializer() {
- return verifyNotNull(serializer);
- }
-
- @Override
- public void onModelContextUpdated(final EffectiveModelContext newModelContext) {
- serializer = new CurrentAdapterSerializer(new BindingCodecContext(DefaultBindingRuntimeContext.create(
- new DefaultBindingRuntimeGenerator().generateTypeMapping(newModelContext),
- ClassLoaderUtils::loadClassWithTCCL)));
- }
-}
*/
package org.opendaylight.mdsal.micro.binding.dom.adapter;
+import static com.google.common.base.Verify.verifyNotNull;
+
+import com.google.common.cache.CacheBuilder;
+import com.google.common.cache.CacheLoader;
+import com.google.common.cache.LoadingCache;
import com.google.common.collect.ClassToInstanceMap;
import com.google.common.collect.ImmutableClassToInstanceMap;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.opendaylight.mdsal.binding.dom.adapter.AdapterContext;
+import org.opendaylight.mdsal.binding.dom.adapter.CurrentAdapterSerializer;
+import org.opendaylight.mdsal.binding.dom.codec.impl.BindingCodecContext;
+import org.opendaylight.mdsal.binding.dom.codec.spi.BindingDOMCodecServices;
+import org.opendaylight.mdsal.binding.runtime.api.BindingRuntimeContext;
import org.opendaylight.mdsal.dom.api.DOMSchemaService;
import org.opendaylight.mdsal.dom.api.DOMSchemaServiceExtension;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.yang.model.api.EffectiveModelContextListener;
import org.opendaylight.yangtools.yang.model.api.EffectiveModelContextProvider;
-public final class MockSchemaService implements DOMSchemaService, EffectiveModelContextProvider {
+public final class MockSchemaService implements DOMSchemaService, EffectiveModelContextProvider, AdapterContext {
+ // Codec has some amount of non-trivial state, such as generated classes. Its operation should not be affected by
+ // anything except BindingRuntimeContext, hence we should be able to reuse it.
+ private static final LoadingCache<BindingRuntimeContext, BindingDOMCodecServices> CODEC_CACHE =
+ CacheBuilder.newBuilder().weakKeys().weakValues().build(
+ new CacheLoader<BindingRuntimeContext, BindingDOMCodecServices>() {
+ @Override
+ public BindingDOMCodecServices load(final BindingRuntimeContext key) {
+ return new BindingCodecContext(key);
+ }
+ });
private EffectiveModelContext schemaContext;
+ private CurrentAdapterSerializer serializer;
final ListenerRegistry<EffectiveModelContextListener> listeners = ListenerRegistry.create();
return ImmutableClassToInstanceMap.of();
}
- public synchronized void changeSchema(final EffectiveModelContext newContext) {
- schemaContext = newContext;
+ @SuppressFBWarnings(value = "IS2_INCONSISTENT_SYNC")
+ public synchronized void changeSchema(final BindingRuntimeContext newContext) {
+ serializer = new CurrentAdapterSerializer(CODEC_CACHE.getUnchecked(newContext));
+ schemaContext = newContext.getEffectiveModelContext();
listeners.streamListeners().forEach(listener -> listener.onModelContextUpdated(schemaContext));
}
+
+ @Override
+ public synchronized CurrentAdapterSerializer currentSerializer() {
+ return verifyNotNull(serializer);
+ }
}
<dependency>
<groupId>org.opendaylight.netvirt</groupId>
<artifactId>netvirt-artifacts</artifactId>
- <version>0.11.0-SNAPSHOT</version>
+ <version>0.12.0-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.opendaylight.openflowplugin</groupId>
<artifactId>openflowplugin-artifacts</artifactId>
- <version>0.11.0-SNAPSHOT</version>
+ <version>0.12.0-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.opendaylight.ovsdb</groupId>
<artifactId>hwvtepsouthbound-artifacts</artifactId>
- <version>1.11.0-SNAPSHOT</version>
+ <version>1.12.0-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.opendaylight.ovsdb</groupId>
<artifactId>library-artifacts</artifactId>
- <version>1.11.0-SNAPSHOT</version>
+ <version>1.12.0-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.opendaylight.ovsdb</groupId>
<artifactId>southbound-artifacts</artifactId>
- <version>1.11.0-SNAPSHOT</version>
+ <version>1.12.0-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>7.0.5</version>
+ <version>8.0.0</version>
</parent>
<groupId>org.opendaylight.odlmicro</groupId>
notably e.g. https://git.opendaylight.org/gerrit/#/c/67179/ et al. (and we bumped odlparent) -->
<duplicate-finder.skip>true</duplicate-finder.skip>
<maven.javadoc.skip>true</maven.javadoc.skip>
+ <odlguice.version>1.0.1-SNAPSHOT</odlguice.version>
</properties>
<dependencyManagement>
<dependency>
<groupId>org.opendaylight.infrautils</groupId>
<artifactId>infrautils-artifacts</artifactId>
- <version>1.8.0</version>
+ <version>1.9.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yangtools-artifacts</artifactId>
- <version>5.0.5</version>
+ <version>7.0.0-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.opendaylight.aaa</groupId>
<artifactId>aaa-artifacts</artifactId>
- <version>0.12.0-SNAPSHOT</version>
+ <version>0.13.0-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>controller-artifacts</artifactId>
- <version>2.0.3</version>
+ <version>3.0.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-artifacts</artifactId>
- <version>6.0.4</version>
+ <version>7.0.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.opendaylight.netconf</groupId>
<artifactId>netconf-artifacts</artifactId>
- <version>1.9.0-SNAPSHOT</version>
+ <version>1.10.0-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.opendaylight.odlguice</groupId>
<artifactId>odlguice-artifacts</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>${odlguice.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>blueprint</artifactId>
- <version>2.0.3</version>
+ <version>3.0.1</version>
+ <scope>compile</scope>
+ </dependency>
+ <!-- fix build failures -->
+ <dependency>
+ <groupId>org.immutables</groupId>
+ <artifactId>value</artifactId>
+ <version>2.8.8</version>
<scope>compile</scope>
</dependency>
</dependencies>