<dependencyManagement>
<dependencies>
<dependency>
- <groupId>org.codehaus.sonar-plugins.java</groupId>
+ <groupId>org.sonarsource.java</groupId>
<artifactId>sonar-jacoco-listeners</artifactId>
<version>${sonar-jacoco-listeners.version}</version>
<scope>test</scope>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>2.0.5</version>
+ <version>3.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>2.0.5</version>
+ <version>3.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>feature-repo-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>2.0.5</version>
+ <version>3.0.2</version>
<relativePath/>
</parent>
<groupId>org.opendaylight.ovsdb</groupId>
import java.net.URI;
+import java.util.Optional;
import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer;
import org.opendaylight.mdsal.dom.api.DOMSchemaService;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
@Override
protected Module moduleForPrefix(final String prefix) {
- return context.findModuleByName(prefix, null);
+ return context.findModule(prefix, Optional.empty()).orElse(null);
}
@Override
protected String prefixForNamespace(final URI namespace) {
- final Module module = context.findModuleByNamespaceAndRevision(namespace, null);
- return module == null ? null : module.getName();
+ return context.findModule(namespace, Optional.empty()).map(Module::getName).orElse(null);
}
@Override
public ReconciliationManager(final DataBroker db) {
this.db = db;
- reconcilers = SpecialExecutors.newBoundedCachedThreadPool(NO_OF_RECONCILER, RECON_TASK_QUEUE_SIZE, "ovsdb-reconciler");
+ reconcilers =
+ SpecialExecutors.newBoundedCachedThreadPool(NO_OF_RECONCILER, RECON_TASK_QUEUE_SIZE, "ovsdb-reconciler",
+ getClass());
ThreadFactory threadFact = new ThreadFactoryBuilder()
.setNameFormat("ovsdb-recon-task-triager-%d").build();
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.codehaus.sonar-plugins.java</groupId>
+ <groupId>org.sonarsource.java</groupId>
<artifactId>sonar-jacoco-listeners</artifactId>
<scope>test</scope>
</dependency>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>karaf4-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.2</version>
<relativePath/>
</parent>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>2.0.5</version>
+ <version>3.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>2.0.5</version>
+ <version>3.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>feature-repo-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>2.0.5</version>
+ <version>3.0.2</version>
<relativePath/>
</parent>
<groupId>org.opendaylight.ovsdb</groupId>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.codehaus.sonar-plugins.java</groupId>
+ <groupId>org.sonarsource.java</groupId>
<artifactId>sonar-jacoco-listeners</artifactId>
<version>${sonar-jacoco-listeners.version}</version>
<scope>test</scope>
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.ByteToMessageDecoder;
import java.io.IOException;
+import java.io.InputStream;
import java.util.List;
import org.opendaylight.ovsdb.lib.error.InvalidEncodingException;
import org.slf4j.Logger;
if (leftCurlies != 0 && leftCurlies == rightCurlies && !inS) {
ByteBuf slice = buf.readSlice(1 + index - buf.readerIndex());
- JsonParser jp = jacksonJsonFactory.createParser(new ByteBufInputStream(slice));
+ JsonParser jp = jacksonJsonFactory.createParser((InputStream) new ByteBufInputStream(slice));
JsonNode root = jp.readValueAsTree();
out.add(root);
leftCurlies = 0;
package org.opendaylight.ovsdb.lib.notation.json;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
+import com.fasterxml.jackson.databind.DatabindContext;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.jsontype.impl.TypeIdResolverBase;
-import com.fasterxml.jackson.databind.type.TypeFactory;
import org.opendaylight.ovsdb.lib.notation.OvsdbSet;
import org.opendaylight.ovsdb.lib.notation.UUID;
}
@Override
- public JavaType typeFromId(String id) {
+ public JavaType typeFromId(DatabindContext context, String id) {
if ("set".equals(id)) {
- return TypeFactory.defaultInstance().constructCollectionType(OvsdbSet.class, Object.class);
+ return context.getTypeFactory().constructCollectionType(OvsdbSet.class, Object.class);
} else if ("uuid".equals(id) || "named-uuid".equals(id)) {
- return TypeFactory.defaultInstance().constructType(UUID.class);
+ return context.constructType(UUID.class);
}
return null;
}
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.codehaus.sonar-plugins.java</groupId>
+ <groupId>org.sonarsource.java</groupId>
<artifactId>sonar-jacoco-listeners</artifactId>
<scope>test</scope>
</dependency>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>karaf4-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.2</version>
<relativePath/>
</parent>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>2.0.5</version>
+ <version>3.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>2.0.5</version>
+ <version>3.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>2.0.5</version>
+ <version>3.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>2.0.5</version>
+ <version>3.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>2.0.5</version>
+ <version>3.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>feature-repo-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>2.0.5</version>
+ <version>3.0.2</version>
<relativePath/>
</parent>
</dependency>
<!-- external dependencies -->
<dependency>
- <groupId>org.codehaus.sonar-plugins.java</groupId>
+ <groupId>org.sonarsource.java</groupId>
<artifactId>sonar-jacoco-listeners</artifactId>
<version>${sonar-jacoco-listeners.version}</version>
<scope>test</scope>
import java.net.URI;
+import java.util.Optional;
import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer;
import org.opendaylight.mdsal.dom.api.DOMSchemaService;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
@Override
protected Module moduleForPrefix(final String prefix) {
- return context.findModuleByName(prefix, null);
+ return context.findModule(prefix, Optional.empty()).orElse(null);
}
@Override
protected String prefixForNamespace(final URI namespace) {
- final Module module = context.findModuleByNamespaceAndRevision(namespace, null);
- return module == null ? null : module.getName();
+ return context.findModule(namespace, Optional.empty()).map(Module::getName).orElse(null);
}
@Override
this.db = db;
this.instanceIdentifierCodec = instanceIdentifierCodec;
reconcilers = SpecialExecutors.newBoundedCachedThreadPool(NO_OF_RECONCILER, RECON_TASK_QUEUE_SIZE,
- "ovsdb-reconciler");
+ "ovsdb-reconciler", getClass());
ThreadFactory threadFact = new ThreadFactoryBuilder()
.setNameFormat("ovsdb-recon-task-triager-%d").build();
import java.net.URI;
import java.net.URISyntaxException;
-import java.util.Date;
+import java.util.Optional;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@Test
public void testModuleForPrefix() {
Module module = mock(Module.class);
- when(context.findModuleByName(anyString(), any(Date.class))).thenReturn(module);
+ when(context.findModule(anyString(), any(Optional.class))).thenReturn(Optional.of(module));
assertEquals("Error, did not return correct Module object", module, instanceIdCodec.moduleForPrefix(""));
}
public void testPrefixForNamespace() throws URISyntaxException {
Module module = mock(Module.class);
URI namespace = new URI("");
- when(context.findModuleByNamespaceAndRevision(any(URI.class), any(Date.class))).thenReturn(null)
- .thenReturn(module);
+ when(context.findModule(any(URI.class), any(Optional.class))).thenReturn(Optional.empty()).thenReturn(
+ Optional.of(module));
when(module.getName()).thenReturn("");
assertEquals("Error, null should have been returned", null, instanceIdCodec.prefixForNamespace(namespace));
assertEquals("Error, did not return the correct module name", anyString(),
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.codehaus.sonar-plugins.java</groupId>
+ <groupId>org.sonarsource.java</groupId>
<artifactId>sonar-jacoco-listeners</artifactId>
<scope>test</scope>
</dependency>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>karaf4-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.2</version>
<relativePath/>
</parent>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>2.0.5</version>
+ <version>3.0.2</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.2</version>
<relativePath/>
</parent>