blob: 7e01a452fc6597b630e8bff0dbea870cfa161801 [file] [log] [blame]
Hyunsun Moonab2cf252015-09-10 17:54:10 -07001/*
2 * Copyright 2014-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 */
16package org.onosproject.cordvtn;
17
Hyunsun Moon2b530322015-09-23 13:24:35 -070018import org.onosproject.net.DeviceId;
Hyunsun Moond0e932a2015-09-15 22:39:16 -070019
Hyunsun Moonab2cf252015-09-10 17:54:10 -070020import java.util.List;
21
22/**
23 * Service for provisioning overlay virtual networks on compute nodes.
24 */
25public interface CordVtnService {
Hyunsun Moon2b530322015-09-23 13:24:35 -070026
27 String CORDVTN_APP_ID = "org.onosproject.cordvtn";
Hyunsun Moonab2cf252015-09-10 17:54:10 -070028 /**
Hyunsun Moond0e932a2015-09-15 22:39:16 -070029 * Adds a new node to the service.
Hyunsun Moonab2cf252015-09-10 17:54:10 -070030 *
Hyunsun Moon1f145552015-10-08 22:25:30 -070031 * @param ovsdb ovsdb node
Hyunsun Moonab2cf252015-09-10 17:54:10 -070032 */
Hyunsun Moon1f145552015-10-08 22:25:30 -070033 void addNode(OvsdbNode ovsdb);
Hyunsun Moonab2cf252015-09-10 17:54:10 -070034
35 /**
Hyunsun Moon2b530322015-09-23 13:24:35 -070036 * Deletes a node from the service.
Hyunsun Moonab2cf252015-09-10 17:54:10 -070037 *
Hyunsun Moon1f145552015-10-08 22:25:30 -070038 * @param ovsdb ovsdb node
Hyunsun Moonab2cf252015-09-10 17:54:10 -070039 */
Hyunsun Moon1f145552015-10-08 22:25:30 -070040 void deleteNode(OvsdbNode ovsdb);
Hyunsun Moon2b530322015-09-23 13:24:35 -070041
42 /**
Hyunsun Moon1f145552015-10-08 22:25:30 -070043 * Connect to a node.
Hyunsun Moon2b530322015-09-23 13:24:35 -070044 *
Hyunsun Moon1f145552015-10-08 22:25:30 -070045 * @param ovsdb ovsdb node
Hyunsun Moon2b530322015-09-23 13:24:35 -070046 */
Hyunsun Moon1f145552015-10-08 22:25:30 -070047 void connect(OvsdbNode ovsdb);
48
49 /**
50 * Disconnect a node.
51 *
52 * @param ovsdb ovsdb node
53 */
54 void disconnect(OvsdbNode ovsdb);
Hyunsun Moonab2cf252015-09-10 17:54:10 -070055
56 /**
57 * Returns the number of the nodes known to the service.
58 *
59 * @return number of nodes
60 */
61 int getNodeCount();
62
63 /**
Hyunsun Moon2b530322015-09-23 13:24:35 -070064 * Returns OvsdbNode with given device id.
65 *
66 * @param deviceId device id
67 * @return ovsdb node
68 */
69 OvsdbNode getNode(DeviceId deviceId);
70
71 /**
Hyunsun Moon1f145552015-10-08 22:25:30 -070072 * Returns connection state of the node.
73 *
74 * @param ovsdb ovsdb node
75 * @return true if the node is connected, false otherwise
76 */
77 boolean isNodeConnected(OvsdbNode ovsdb);
78
79 /**
Hyunsun Moonab2cf252015-09-10 17:54:10 -070080 * Returns all nodes known to the service.
81 *
82 * @return list of nodes
83 */
84 List<OvsdbNode> getNodes();
85}