aboutsummaryrefslogtreecommitdiffstats
path: root/framework/src/onos/ovsdb/api/src/main/java/org/onosproject/ovsdb/controller/OvsdbClientService.java
blob: ab88a24ed7e0ac0d62a6104449516b382e594b4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
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);
}