Due to this change, the ovsdb.northbound bundle will start to accept and respond OVSDB JSON messages in the same format as
expected by the ovsdb-server. (i.e) a set will be represented as ["set",[]] instead of the common sense [].
This is due to the ovsdb requirement as specified in the RFC / Draft.
Change-Id: I3a1a2548f1b8c87d1d4b63f5952d6fabaa6f3d33
Signed-off-by: Madhu Venugopal <mavenugo@gmail.com>
<properties>
<nexusproxy>http://nexus.opendaylight.org/content</nexusproxy>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <jackson.new.version>2.3.0</jackson.new.version>
</properties>
<!-- modules should go once the jenkins job is updated to use the root pom -->
<modules>
<url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
<tag>HEAD</tag>
</scm>
-
<artifactId>ovsdb.northbound</artifactId>
<version>0.5.0-SNAPSHOT</version>
<packaging>bundle</packaging>
javax.xml.bind.annotation,
org.slf4j,
org.apache.catalina.filters,
- org.codehaus.jackson.jaxrs,
- org.codehaus.jackson.annotate,
- org.codehaus.jackson.map.annotate,
+ com.fasterxml.jackson.databind.annotation,
+ com.fasterxml.jackson.annotation,
!org.codehaus.enunciate.jaxrs
</Import-Package>
<Export-Package>
<artifactId>enunciate-core-annotations</artifactId>
<version>${enunciate.version}</version>
</dependency>
+
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-annotations</artifactId>
+ <version>${jackson.new.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-core</artifactId>
+ <version>${jackson.new.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ <version>${jackson.new.version}</version>
+ </dependency>
+
</dependencies>
</project>
package org.opendaylight.ovsdb.northbound;
import java.util.List;
+import java.util.Map;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
@ResponseCode(code = 400, condition = "Invalid data passed"),
@ResponseCode(code = 401, condition = "User not authorized to perform this operation")})
@Consumes({ MediaType.APPLICATION_JSON})
- @TypeHint(String.class)
- public String getRow(@PathParam("nodeType") String nodeType, @PathParam("nodeId") String nodeId,
+ @TypeHint(OVSDBRow.class)
+ public OVSDBRow getRow(@PathParam("nodeType") String nodeType, @PathParam("nodeId") String nodeId,
@PathParam("tableName") String tableName, @PathParam("rowUuid") String rowUuid) {
if (!NorthboundUtils.isAuthorized(getUserName(), "default", Privilege.WRITE, this)) {
}
Node node = Node.fromString(nodeType, nodeId);
- //Table<?> row = null;
- String row = null;
+ Table<?> row = null;
try {
- row = ovsdbTable.getSerializedRow(node, ovsTableName, rowUuid);
+ row = ovsdbTable.getRow(node, ovsTableName, rowUuid);
} catch (Exception e) {
throw new BadRequestException(e.getMessage());
}
- //return new OVSDBRow(null, row);
- return row;
+ return new OVSDBRow(null, row);
}
/**
@ResponseCode(code = 400, condition = "Invalid data passed"),
@ResponseCode(code = 401, condition = "User not authorized to perform this operation")})
@Consumes({ MediaType.APPLICATION_JSON})
- @TypeHint(String.class)
- public String getAllRows(@PathParam("nodeType") String nodeType, @PathParam("nodeId") String nodeId,
+ @TypeHint(OVSDBRows.class)
+ public OVSDBRows getAllRows(@PathParam("nodeType") String nodeType, @PathParam("nodeId") String nodeId,
@PathParam("tableName") String tableName) {
if (!NorthboundUtils.isAuthorized(getUserName(), "default", Privilege.WRITE, this)) {
throw new UnauthorizedException("User is not authorized to perform this operation");
}
Node node = Node.fromString(nodeType, nodeId);
- //Map<String, Table<?>> rows = null;
- String rows = null;
+ Map<String, Table<?>> rows = null;
try {
- rows = ovsdbTable.getSerializedRows(node, ovsTableName);
+ rows = ovsdbTable.getRows(node, ovsTableName);
} catch (Exception e) {
throw new BadRequestException(e.getMessage());
}
- //return new OVSDBRows(rows);
- return rows;
+ return new OVSDBRows(rows);
}
/**
*/
package org.opendaylight.ovsdb.northbound;
-import org.codehaus.jackson.annotate.JsonSubTypes;
-import org.codehaus.jackson.annotate.JsonTypeInfo;
-import org.codehaus.jackson.map.annotate.JsonSerialize;
import org.opendaylight.ovsdb.lib.table.Bridge;
import org.opendaylight.ovsdb.lib.table.Capability;
import org.opendaylight.ovsdb.lib.table.Controller;
import org.opendaylight.ovsdb.lib.table.SSL;
import org.opendaylight.ovsdb.lib.table.internal.Table;
+import com.fasterxml.jackson.annotation.JsonSubTypes;
+import com.fasterxml.jackson.annotation.JsonTypeInfo;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+
@JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL)
public class OVSDBRow {
String parent_uuid;
javax.net.ssl,
*
</Import-Package>
- <Embed-Dependency>httpclient,commons-codec,httpcore-nio,javax.servlet-api,jackson-annotations,jackson-core,jackson-databind,portlet-api,commons-collections;type=!pom;inline=false</Embed-Dependency>
+ <Embed-Dependency>httpclient,commons-codec,httpcore-nio,javax.servlet-api,portlet-api,commons-collections;type=!pom;inline=false</Embed-Dependency>
<Embed-Transitive>
true
</Embed-Transitive>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
- <version>2.2.2</version>
+ <version>${jackson.new.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
- <version>2.2.2</version>
+ <version>${jackson.new.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
- <version>2.2.2</version>
+ <version>${jackson.new.version}</version>
</dependency>
<dependency>
<groupId>javax.portlet</groupId>
import io.netty.handler.logging.LoggingHandler;
import junit.framework.TestCase;
-import org.codehaus.jackson.map.ObjectMapper;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;