blob: a0d1c4dd07a53fc8fb2af4ee070839b59b8b5bae [file] [log] [blame]
CNlucius74fd4942015-07-20 14:28:04 +08001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
CNlucius74fd4942015-07-20 14:28:04 +08003 *
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.ovsdb.controller;
17
Hyunsun Moon5fb20a52015-09-25 17:02:33 -070018import org.onlab.packet.IpAddress;
19import org.onlab.packet.TpPort;
20
CNlucius74fd4942015-07-20 14:28:04 +080021import java.util.List;
22
23/**
BitOhenry264f35a2015-11-03 20:58:39 +080024 * Abstraction of an ovsdb controller. Serves as an one stop shop for obtaining
CNlucius74fd4942015-07-20 14:28:04 +080025 * OvsdbNode and (un)register listeners on ovsdb events and ovsdb node events.
26 */
27public interface OvsdbController {
28
29 /**
30 * Adds Node Event Listener.
31 *
32 * @param listener node listener
33 */
34 void addNodeListener(OvsdbNodeListener listener);
35
36 /**
37 * Removes Node Event Listener.
38 *
39 * @param listener node listener
40 */
41 void removeNodeListener(OvsdbNodeListener listener);
42
43 /**
44 * Adds ovsdb event listener.
45 *
46 * @param listener event listener
47 */
48 void addOvsdbEventListener(OvsdbEventListener listener);
49
50 /**
51 * Removes ovsdb event listener.
52 *
53 * @param listener event listener
54 */
55 void removeOvsdbEventListener(OvsdbEventListener listener);
56
57 /**
58 * Gets all the nodes information.
59 *
60 * @return the list of node id
61 */
62 List<OvsdbNodeId> getNodeIds();
63
64 /**
BitOhenry264f35a2015-11-03 20:58:39 +080065 * Gets an ovsdb client by node identifier.
CNlucius74fd4942015-07-20 14:28:04 +080066 *
67 * @param nodeId node identifier
68 * @return OvsdbClient ovsdb node information
69 */
70 OvsdbClientService getOvsdbClient(OvsdbNodeId nodeId);
Hyunsun Moon5fb20a52015-09-25 17:02:33 -070071
72 /**
73 * Connect to the ovsdb server with given ip address and port number.
74 *
75 * @param ip ip address
76 * @param port port number
77 */
78 void connect(IpAddress ip, TpPort port);
CNlucius74fd4942015-07-20 14:28:04 +080079}