diff options
author | Ashlee Young <ashlee@onosfw.com> | 2015-09-09 22:15:21 -0700 |
---|---|---|
committer | Ashlee Young <ashlee@onosfw.com> | 2015-09-09 22:15:21 -0700 |
commit | 13d05bc8458758ee39cb829098241e89616717ee (patch) | |
tree | 22a4d1ce65f15952f07a3df5af4b462b4697cb3a /framework/src/onos/ovsdb/api/src/main/java/org/onosproject/ovsdb/controller/OvsdbClientService.java | |
parent | 6139282e1e93c2322076de4b91b1c85d0bc4a8b3 (diff) |
ONOS checkin based on commit tag e796610b1f721d02f9b0e213cf6f7790c10ecd60
Change-Id: Ife8810491034fe7becdba75dda20de4267bd15cd
Diffstat (limited to 'framework/src/onos/ovsdb/api/src/main/java/org/onosproject/ovsdb/controller/OvsdbClientService.java')
-rw-r--r-- | framework/src/onos/ovsdb/api/src/main/java/org/onosproject/ovsdb/controller/OvsdbClientService.java | 231 |
1 files changed, 231 insertions, 0 deletions
diff --git a/framework/src/onos/ovsdb/api/src/main/java/org/onosproject/ovsdb/controller/OvsdbClientService.java b/framework/src/onos/ovsdb/api/src/main/java/org/onosproject/ovsdb/controller/OvsdbClientService.java new file mode 100644 index 00000000..ab88a24e --- /dev/null +++ b/framework/src/onos/ovsdb/api/src/main/java/org/onosproject/ovsdb/controller/OvsdbClientService.java @@ -0,0 +1,231 @@ +/* + * Copyright 2015 Open Networking Laboratory + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onosproject.ovsdb.controller; + +import java.util.List; +import java.util.Set; + +import org.onlab.packet.IpAddress; + +import org.onosproject.ovsdb.rfc.jsonrpc.OvsdbRPC; +import org.onosproject.ovsdb.rfc.message.OperationResult; +import org.onosproject.ovsdb.rfc.message.TableUpdates; +import org.onosproject.ovsdb.rfc.notation.Row; +import org.onosproject.ovsdb.rfc.operations.Operation; +import org.onosproject.ovsdb.rfc.schema.DatabaseSchema; + +import com.google.common.util.concurrent.ListenableFuture; + +/** + * Represents to provider facing side of a node. + */ +public interface OvsdbClientService extends OvsdbRPC { + /** + * Gets the node identifier. + * + * @return node identifier + */ + OvsdbNodeId nodeId(); + + /** + * Creates the configuration for the tunnel. + * + * @param srcIp source IP address + * @param dstIp destination IP address + */ + void createTunnel(IpAddress srcIp, IpAddress dstIp); + + /** + * Drops the configuration for the tunnel. + * + * @param srcIp source IP address + * @param dstIp destination IP address + */ + void dropTunnel(IpAddress srcIp, IpAddress dstIp); + + /** + * Gets tunnels of the node. + * + * @return set of tunnels; empty if no tunnel is find + */ + Set<OvsdbTunnel> getTunnels(); + + /** + * Creates a bridge. + * + * @param bridgeName bridge name + */ + void createBridge(String bridgeName); + + /** + * Drops a bridge. + * + * @param bridgeName bridge name + */ + void dropBridge(String bridgeName); + + /** + * Gets bridges of the node. + * + * @return set of bridges; empty if no bridge is find + */ + Set<OvsdbBridge> getBridges(); + + /** + * Creates a port. + * + * @param bridgeName bridge name + * @param portName port name + */ + void createPort(String bridgeName, String portName); + + /** + * Drops a port. + * + * @param bridgeName bridge name + * @param portName port name + */ + void dropPort(String bridgeName, String portName); + + /** + * Gets ports of the bridge. + * + * @return set of ports; empty if no ports is find + */ + Set<OvsdbPort> getPorts(); + + /** + * Checks if the node is still connected. + * + * @return true if the node is still connected + */ + boolean isConnected(); + + /** + * Gets the Bridge uuid. + * + * @param bridgeName bridge name + * @return bridge uuid, empty if no uuid is find + */ + String getBridgeUuid(String bridgeName); + + /** + * Gets the Port uuid. + * + * @param portName port name + * @param bridgeUuid bridge uuid + * @return port uuid, empty if no uuid is find + */ + String getPortUuid(String portName, String bridgeUuid); + + /** + * Gets the Interface uuid. + * + * @param portUuid port uuid + * @param portName port name + * @return interface uuid, empty if no uuid is find + */ + String getInterfaceUuid(String portUuid, String portName); + + /** + * Gets the Controller uuid. + * + * @param controllerName controller name + * @param controllerTarget controller target + * @return controller uuid, empty if no uuid is find + */ + String getControllerUuid(String controllerName, String controllerTarget); + + /** + * Gets the Ovs uuid. + * + * @param dbName database name + * @return ovs uuid, empty if no uuid is find + */ + String getOvsUuid(String dbName); + + /** + * Gets the ovsdb database schema. + * + * @param dbName database name + * @return database schema + */ + ListenableFuture<DatabaseSchema> getOvsdbSchema(String dbName); + + /** + * Gets the ovsdb table updates. + * + * @param dbName database name + * @param id random uuid + * @return table updates + */ + ListenableFuture<TableUpdates> monitorTables(String dbName, String id); + + /** + * Gets the ovsdb config operation result. + * + * @param dbName database name + * @param operations the list of operations + * @return operation results + */ + ListenableFuture<List<OperationResult>> transactConfig(String dbName, + List<Operation> operations); + + /** + * Gets the ovsdb database schema from local. + * + * @param dbName database name + * @return database schema + */ + DatabaseSchema getDatabaseSchema(String dbName); + + /** + * Gets the ovsdb row from the local ovsdb store. + * + * @param dbName database name + * @param tableName table name + * @param uuid row uuid + * @return row ovsdb row + */ + Row getRow(String dbName, String tableName, String uuid); + + /** + * Removes the ovsdb row from the local ovsdb store. + * + * @param dbName database name + * @param tableName table name + * @param uuid row uuid + */ + void removeRow(String dbName, String tableName, String uuid); + + /** + * Updates the local ovsdb store. + * + * @param dbName database name + * @param tableName table name + * @param uuid row uuid + * @param row ovsdb row + */ + void updateOvsdbStore(String dbName, String tableName, String uuid, Row row); + + /** + * Gets ovsdb local ports. + * + * @param ifaceids the ifaceid that needed + * @return ovsdb ports + */ + Set<OvsdbPort> getLocalPorts(Iterable<String> ifaceids); +} |