blob: e3d6993cb7c807b7ee32706f408143d996b5cd81 [file] [log] [blame]
CNluciusa66c3972015-09-06 20:31:29 +08001/*
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 */
16package org.onosproject.net.behaviour;
17
18import java.util.Collection;
19import java.util.List;
20import java.util.Set;
21
22import org.onosproject.net.PortNumber;
23import org.onosproject.net.device.PortDescription;
24import org.onosproject.net.driver.HandlerBehaviour;
25
26/**
27 * Behaviour for handling various drivers for bridge configurations.
28 */
29public interface BridgeConfig extends HandlerBehaviour {
30
31 /**
32 * Add a bridge.
33 *
34 * @param bridgeName bridge name
35 */
36 void addBridge(BridgeName bridgeName);
37
38 /**
Hyunsun Moonaab8c672015-10-27 19:42:12 -070039 * Adds a bridge with given bridge name and dpid, and sets the controller
40 * of the bridge with given controllers.
41 *
42 * @param bridgeName bridge name
43 * @param dpid dpid
44 * @param controllers list of controller
45 * @return true if succeeds, fail otherwise
46 */
47 boolean addBridge(BridgeName bridgeName, String dpid, List<ControllerInfo> controllers);
48
49 /**
CNluciusa66c3972015-09-06 20:31:29 +080050 * Remove a bridge.
51 *
52 * @param bridgeName bridge name
53 */
54 void deleteBridge(BridgeName bridgeName);
55
56 /**
57 * Remove a bridge.
58 *
59 * @return bridge collection
60 */
61 Collection<BridgeDescription> getBridges();
62
63 /**
64 * Add a logical/virtual port.
65 *
66 * @param port port number
67 */
68 void addPort(PortDescription port);
69
70 /**
71 * Delete a logical/virtual port.
72 *
73 * @param port port number
74 */
75 void deletePort(PortDescription port);
76
77 /**
78 * Delete a logical/virtual port.
79 *
80 * @return collection of port
81 */
82 Collection<PortDescription> getPorts();
83
84 /**
85 * Get a collection of port.
86 *
87 * @return portNumbers set of PortNumber
88 */
89 Set<PortNumber> getPortNumbers();
90
91 /**
92 * Get logical/virtual ports by ifaceIds.
93 *
94 * @param ifaceIds the ifaceid that needed
95 * @return list of PortNumber
96 */
97 List<PortNumber> getLocalPorts(Iterable<String> ifaceIds);
98}