Removed the ovsdb subdirectory properly in lieu of the upcoming rebase with master
[netvirt.git] / northbound / 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.Interface;
16 import org.opendaylight.ovsdb.lib.table.Manager;
17 import org.opendaylight.ovsdb.lib.table.Mirror;
18 import org.opendaylight.ovsdb.lib.table.NetFlow;
19 import org.opendaylight.ovsdb.lib.table.Open_vSwitch;
20 import org.opendaylight.ovsdb.lib.table.Port;
21 import org.opendaylight.ovsdb.lib.table.Qos;
22 import org.opendaylight.ovsdb.lib.table.Queue;
23 import org.opendaylight.ovsdb.lib.table.SFlow;
24 import org.opendaylight.ovsdb.lib.table.SSL;
25 import org.opendaylight.ovsdb.lib.table.Table;
26
27 import com.fasterxml.jackson.annotation.JsonSubTypes;
28 import com.fasterxml.jackson.annotation.JsonTypeInfo;
29 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
30
31 @JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL)
32 public class OVSDBRow {
33     String parent_uuid;
34     /*
35      * MINIMAL_CLASS Directive expects a leading "." character on the class name and is lame.
36      * Hence going with NAME directive even though it calls for SubTypes.
37      * Since we are using fixed table types for the Hydrogen release, this is acceptable.
38      * When we move towards Schema driven table definition, this is anyways not required.
39
40     @JsonTypeInfo(
41             use = JsonTypeInfo.Id.MINIMAL_CLASS,
42             include = JsonTypeInfo.As.PROPERTY,
43             property = "@class")
44     */
45
46     @JsonTypeInfo(
47             use = JsonTypeInfo.Id.NAME,
48             include = JsonTypeInfo.As.WRAPPER_OBJECT)
49     @JsonSubTypes({
50         @JsonSubTypes.Type(value=Bridge.class, name="Bridge"),
51         @JsonSubTypes.Type(value=Capability.class, name="Capbility"),
52         @JsonSubTypes.Type(value=Controller.class, name="Controller"),
53         @JsonSubTypes.Type(value=Interface.class, name="Interface"),
54         @JsonSubTypes.Type(value=Manager.class, name="Manager"),
55         @JsonSubTypes.Type(value=Mirror.class, name="Mirror"),
56         @JsonSubTypes.Type(value=NetFlow.class, name="NetFlow"),
57         @JsonSubTypes.Type(value=Open_vSwitch.class, name="Open_vSwitch"),
58         @JsonSubTypes.Type(value=Port.class, name="Port"),
59         @JsonSubTypes.Type(value=Qos.class, name="QoS"),
60         @JsonSubTypes.Type(value=Queue.class, name="Queue"),
61         @JsonSubTypes.Type(value=SFlow.class, name="sFlow"),
62         @JsonSubTypes.Type(value=SSL.class, name="SSL")
63         })
64     Table row;
65
66     public OVSDBRow() {
67     }
68
69     public OVSDBRow(String parent_uuid, Table row) {
70         this.parent_uuid = parent_uuid;
71         this.row = row;
72     }
73
74     public String getParent_uuid() {
75         return parent_uuid;
76     }
77     public void setParent_uuid(String parent_uuid) {
78         this.parent_uuid = parent_uuid;
79     }
80     public Table getRow() {
81         return row;
82     }
83     public void setRow(Table row) {
84         this.row = row;
85     }
86 }