lishuai | 2ddc469 | 2015-07-31 15:15:16 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015 Open Networking Laboratory |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | package org.onosproject.ovsdb.rfc.jsonrpc; |
| 17 | |
Jonathan Hart | 51539b8 | 2015-10-29 09:53:04 -0700 | [diff] [blame] | 18 | import com.fasterxml.jackson.databind.JsonNode; |
| 19 | import com.google.common.util.concurrent.ListenableFuture; |
lishuai | 2ddc469 | 2015-07-31 15:15:16 +0800 | [diff] [blame] | 20 | import org.onosproject.ovsdb.rfc.operations.Operation; |
| 21 | import org.onosproject.ovsdb.rfc.schema.DatabaseSchema; |
| 22 | |
Jonathan Hart | 51539b8 | 2015-10-29 09:53:04 -0700 | [diff] [blame] | 23 | import java.util.List; |
lishuai | 2ddc469 | 2015-07-31 15:15:16 +0800 | [diff] [blame] | 24 | |
| 25 | /** |
| 26 | * The following interface describe the RPC7047's methods that are supported. |
| 27 | */ |
Jonathan Hart | 51539b8 | 2015-10-29 09:53:04 -0700 | [diff] [blame] | 28 | public interface OvsdbRpc { |
lishuai | 2ddc469 | 2015-07-31 15:15:16 +0800 | [diff] [blame] | 29 | |
| 30 | /** |
| 31 | * This operation retrieves a database-schema that describes hosted database |
| 32 | * db-name. |
| 33 | * @param dbnames database name |
| 34 | * @return ListenableFuture of JsonNode |
| 35 | */ |
| 36 | ListenableFuture<JsonNode> getSchema(List<String> dbnames); |
| 37 | |
| 38 | /** |
| 39 | * The "echo" method can be used by both clients and servers to verify the |
| 40 | * liveness of a database connection. |
| 41 | * @return return info |
| 42 | */ |
| 43 | ListenableFuture<List<String>> echo(); |
| 44 | |
| 45 | /** |
| 46 | * The "monitor" request enables a client to replicate tables or subsets of |
| 47 | * tables within an OVSDB database by requesting notifications of changes to |
| 48 | * those tables and by receiving the complete initial state of a table or a |
| 49 | * subset of a table. |
| 50 | * @param dbSchema databse schema |
| 51 | * @param monitorId a id for monitor |
| 52 | * @return ListenableFuture of JsonNode |
| 53 | */ |
| 54 | ListenableFuture<JsonNode> monitor(DatabaseSchema dbSchema, String monitorId); |
| 55 | |
| 56 | /** |
| 57 | * This operation retrieves an array whose elements are the names of the |
| 58 | * databases that can be accessed over this management protocol connection. |
| 59 | * @return database names |
| 60 | */ |
| 61 | ListenableFuture<List<String>> listDbs(); |
| 62 | |
| 63 | /** |
| 64 | * This RPC method causes the database server to execute a series of |
| 65 | * operations in the specified order on a given database. |
| 66 | * @param dbSchema database schema |
| 67 | * @param operations the operations to execute |
| 68 | * @return result the transact result |
| 69 | */ |
| 70 | ListenableFuture<List<JsonNode>> transact(DatabaseSchema dbSchema, |
| 71 | List<Operation> operations); |
| 72 | |
| 73 | } |