Merge "Adding Pax-Exam infra with a basic IT for plugin"
[netvirt.git] / northbound / ovsdb / src / main / java / org / opendaylight / ovsdb / northbound / OVSDBRow.java
1 /*
2  * Copyright (C) 2013 Red Hat, Inc.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Authors : Madhu Venugopal, Brent Salisbury
9  */
10 package org.opendaylight.ovsdb.northbound;
11
12 import org.opendaylight.ovsdb.lib.table.Bridge;
13 import org.opendaylight.ovsdb.lib.table.Capability;
14 import org.opendaylight.ovsdb.lib.table.Controller;
15 import org.opendaylight.ovsdb.lib.table.IPFIX;
16 import org.opendaylight.ovsdb.lib.table.Interface;
17 import org.opendaylight.ovsdb.lib.table.Manager;
18 import org.opendaylight.ovsdb.lib.table.Mirror;
19 import org.opendaylight.ovsdb.lib.table.NetFlow;
20 import org.opendaylight.ovsdb.lib.table.Open_vSwitch;
21 import org.opendaylight.ovsdb.lib.table.Port;
22 import org.opendaylight.ovsdb.lib.table.Qos;
23 import org.opendaylight.ovsdb.lib.table.Queue;
24 import org.opendaylight.ovsdb.lib.table.SFlow;
25 import org.opendaylight.ovsdb.lib.table.SSL;
26 import org.opendaylight.ovsdb.lib.table.internal.Table;
27
28 import com.fasterxml.jackson.annotation.JsonSubTypes;
29 import com.fasterxml.jackson.annotation.JsonTypeInfo;
30 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
31
32 @JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL)
33 public class OVSDBRow {
34     String parent_uuid;
35     /*
36      * MINIMAL_CLASS Directive expects a leading "." character on the class name and is lame.
37      * Hence going with NAME directive even though it calls for SubTypes.
38      * Since we are using fixed table types for the Hydrogen release, this is acceptable.
39      * When we move towards Schema driven table definition, this is anyways not required.
40
41     @JsonTypeInfo(
42             use = JsonTypeInfo.Id.MINIMAL_CLASS,
43             include = JsonTypeInfo.As.PROPERTY,
44             property = "@class")
45     */
46
47     @JsonTypeInfo(
48             use = JsonTypeInfo.Id.NAME,
49             include = JsonTypeInfo.As.WRAPPER_OBJECT)
50     @JsonSubTypes({
51         @JsonSubTypes.Type(value=Bridge.class, name="Bridge"),
52         @JsonSubTypes.Type(value=Capability.class, name="Capbility"),
53         @JsonSubTypes.Type(value=Controller.class, name="Controller"),
54         @JsonSubTypes.Type(value=Interface.class, name="Interface"),
55         @JsonSubTypes.Type(value=Manager.class, name="Manager"),
56         @JsonSubTypes.Type(value=Mirror.class, name="Mirror"),
57         @JsonSubTypes.Type(value=NetFlow.class, name="NetFlow"),
58         @JsonSubTypes.Type(value=Open_vSwitch.class, name="Open_vSwitch"),
59         @JsonSubTypes.Type(value=Port.class, name="Port"),
60         @JsonSubTypes.Type(value=Qos.class, name="QoS"),
61         @JsonSubTypes.Type(value=Queue.class, name="Queue"),
62         @JsonSubTypes.Type(value=SFlow.class, name="sFlow"),
63         @JsonSubTypes.Type(value=SSL.class, name="SSL"),
64         @JsonSubTypes.Type(value=IPFIX.class, name="IPFIX")
65         })
66     Table row;
67
68     public OVSDBRow() {
69     }
70
71     public OVSDBRow(String parent_uuid, Table row) {
72         this.parent_uuid = parent_uuid;
73         this.row = row;
74     }
75
76     public String getParent_uuid() {
77         return parent_uuid;
78     }
79     public void setParent_uuid(String parent_uuid) {
80         this.parent_uuid = parent_uuid;
81     }
82     public Table getRow() {
83         return row;
84     }
85     public void setRow(Table row) {
86         this.row = row;
87     }
88 }