Plugin migration to use the new Schema independent Library.
[ovsdb.git] / plugin / src / main / java / org / opendaylight / ovsdb / plugin / OVSDBConfigService.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.plugin;
11
12 import java.util.List;
13 import java.util.concurrent.ConcurrentMap;
14 import java.util.concurrent.ExecutionException;
15
16 import org.opendaylight.controller.sal.core.Node;
17 import org.opendaylight.controller.sal.utils.Status;
18 import org.opendaylight.ovsdb.lib.notation.Row;
19 import org.opendaylight.ovsdb.lib.schema.GenericTableSchema;
20
21 public interface OVSDBConfigService {
22
23     /**
24      * This version of insertRow is a short-term replacement for the older & now deprecated method of the same name.
25      * This API assumes an Open_vSwitch database Schema.
26      *
27      * @param node OVSDB Node
28      * @param tableName Table on which the row is inserted
29      * @param parentUuid UUID of the parent table to which this operation will result in attaching/mutating.
30      * @param row Row of table Content to be inserted
31      * @return UUID of the inserted Row
32      */
33     public StatusWithUuid insertRow(Node node, String tableName, String parentUuid, Row<GenericTableSchema> row);
34
35     /**
36      * This version of updateRow is a short-term replacement for the older & now deprecated method of the same name.
37      * This API assumes an Open_vSwitch database Schema.
38      *
39      * @param node OVSDB Node
40      * @param tableName Table on which the row is Updated
41      * @param parentUuid UUID of the parent row on which this operation might result in mutating.
42      * @param rowUuid UUID of the row that is being updated
43      * @param row Row of table Content to be Updated. Include just those columns that needs to be updated.
44      */
45     public Status updateRow (Node node, String tableName, String parentUuid, String rowUuid, Row row);
46
47     /**
48      * This version of deleteRow is a short-term replacement for the older & now deprecated method of the same name.
49      * This API assumes an Open_vSwitch database Schema.
50      *
51      * @param node OVSDB Node
52      * @param tableName Table on which the row is Updated
53      * @param rowUuid UUID of the row that is being deleted
54      */
55
56     public Status deleteRow (Node node, String tableName, String rowUUID);
57
58     /**
59      * This version of getRow is a short-term replacement for the older & now deprecated method of the same name.
60      * This API assumes an Open_vSwitch database Schema.
61      *
62      * @param node OVSDB Node
63      * @param tableName Table Name
64      * @param rowUuid UUID of the row being queried
65      * @return a row with a list of Column data that corresponds to an unique Row-identifier called uuid in a given table.
66      */
67
68     public Row getRow(Node node, String tableName, String uuid);
69
70     /**
71      * This version of getRows is a short-term replacement for the older & now deprecated method of the same name.
72      * This API assumes an Open_vSwitch database Schema.
73      *
74      * @param node OVSDB Node
75      * @param tableName Table Name
76      * @return List of rows that makes the entire Table.
77      */
78
79     public ConcurrentMap<String, Row> getRows(Node node, String tableName);
80
81     /**
82      * Returns all the Tables in a given Ndoe.
83      * This API assumes an Open_vSwitch database Schema.
84      *
85      * @param node OVSDB node
86      * @return List of Table Names that make up Open_vSwitch schema.
87      */
88     public List<String> getTables(Node node);
89
90     /**
91      * setOFController is a convenience method used by existing applications to setup Openflow Controller on
92      * a Open_vSwitch Bridge.
93      * This API assumes an Open_vSwitch database Schema.
94      *
95      * @param node Node
96      * @param bridgeUUID uuid of the Bridge for which the ip-address of Openflow Controller should be programmed.
97      * @return Boolean representing success or failure of the operation.
98      *
99      * @throws InterruptedException
100      * @throws ExecutionException
101      */
102     Boolean setOFController(Node node, String bridgeUUID) throws InterruptedException, ExecutionException;
103 }