Replacing the older version of insertRow with a Schema-independent version.
[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.io.IOException;
13 import java.util.List;
14 import java.util.concurrent.ConcurrentMap;
15 import java.util.concurrent.ExecutionException;
16
17 import org.opendaylight.controller.sal.core.Node;
18 import org.opendaylight.controller.sal.utils.Status;
19 import org.opendaylight.ovsdb.lib.notation.Row;
20 import org.opendaylight.ovsdb.lib.schema.GenericTableSchema;
21 import org.opendaylight.ovsdb.lib.table.Table;
22
23 import com.fasterxml.jackson.core.JsonParseException;
24
25 public interface OVSDBConfigService {
26     public StatusWithUuid insertRow (Node node, String tableName, String parentUUID, Table<?> row);
27     public Status deleteRow (Node node, String tableName, String rowUUID);
28     public Status updateRow (Node node, String tableName, String parentUUID, String rowUUID, Table<?> row);
29     public String getSerializedRow(Node node, String tableName, String uuid) throws Exception;
30     public String getSerializedRows(Node node, String tableName) throws Exception;
31     public Table<?> getRow(Node node, String tableName, String uuid) throws Exception;
32     public ConcurrentMap<String, Table<?>> getRows(Node node, String tableName) throws Exception;
33     public List<String> getTables(Node node) throws Exception;
34
35
36     /**
37      * This version of insertRow is a short-term replacement for the older & now deprecated version.
38      * This API assumes an Open_vSwitch database Schema.
39      *
40      * @param node OVSDB Node
41      * @param tableName Table on which the row is inserted
42      * @param parentUuid UUID of the parent table to which this operation will result in attaching/mutating.
43      * @param row Row of table Content to be inserted
44      * @return UUID of the inserted Row
45      * @throws InterruptedException
46      * @throws ExecutionException
47      * @throws JsonParseException
48      * @throws IOException
49      */
50     public StatusWithUuid insertRow(Node node, String tableName, String parentUuid,
51                                     Row<GenericTableSchema> row) throws InterruptedException, ExecutionException, JsonParseException, IOException;
52 }