CNlucius | a66c397 | 2015-09-06 20:31:29 +0800 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Laboratory |
CNlucius | a66c397 | 2015-09-06 20:31:29 +0800 | [diff] [blame] | 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 | */ |
| 16 | package org.onosproject.net.behaviour; |
| 17 | |
| 18 | import java.util.Collection; |
| 19 | import java.util.List; |
| 20 | import java.util.Set; |
| 21 | |
| 22 | import org.onosproject.net.PortNumber; |
| 23 | import org.onosproject.net.device.PortDescription; |
| 24 | import org.onosproject.net.driver.HandlerBehaviour; |
| 25 | |
| 26 | /** |
| 27 | * Behaviour for handling various drivers for bridge configurations. |
| 28 | */ |
| 29 | public interface BridgeConfig extends HandlerBehaviour { |
| 30 | |
| 31 | /** |
| 32 | * Add a bridge. |
| 33 | * |
Hyunsun Moon | 1251e19 | 2016-06-07 16:57:05 -0700 | [diff] [blame] | 34 | * @deprecated version 1.7.0 - Hummingbird |
CNlucius | a66c397 | 2015-09-06 20:31:29 +0800 | [diff] [blame] | 35 | * @param bridgeName bridge name |
| 36 | */ |
Hyunsun Moon | 1251e19 | 2016-06-07 16:57:05 -0700 | [diff] [blame] | 37 | @Deprecated |
CNlucius | a66c397 | 2015-09-06 20:31:29 +0800 | [diff] [blame] | 38 | void addBridge(BridgeName bridgeName); |
| 39 | |
| 40 | /** |
lishuai | 6c56f5e | 2015-11-17 16:38:19 +0800 | [diff] [blame] | 41 | * Adds a bridge with given bridge name, dpid and exPortName. |
| 42 | * |
Hyunsun Moon | 1251e19 | 2016-06-07 16:57:05 -0700 | [diff] [blame] | 43 | * @deprecated version 1.7.0 - Hummingbird |
lishuai | 6c56f5e | 2015-11-17 16:38:19 +0800 | [diff] [blame] | 44 | * @param bridgeName bridge name |
| 45 | * @param dpid dpid |
| 46 | * @param exPortName external port name |
| 47 | */ |
Hyunsun Moon | 1251e19 | 2016-06-07 16:57:05 -0700 | [diff] [blame] | 48 | @Deprecated |
lishuai | 6c56f5e | 2015-11-17 16:38:19 +0800 | [diff] [blame] | 49 | void addBridge(BridgeName bridgeName, String dpid, String exPortName); |
| 50 | |
| 51 | /** |
Hyunsun Moon | aab8c67 | 2015-10-27 19:42:12 -0700 | [diff] [blame] | 52 | * Adds a bridge with given bridge name and dpid, and sets the controller |
| 53 | * of the bridge with given controllers. |
| 54 | * |
Hyunsun Moon | 1251e19 | 2016-06-07 16:57:05 -0700 | [diff] [blame] | 55 | * @deprecated version 1.7.0 - Hummingbird |
Hyunsun Moon | aab8c67 | 2015-10-27 19:42:12 -0700 | [diff] [blame] | 56 | * @param bridgeName bridge name |
| 57 | * @param dpid dpid |
| 58 | * @param controllers list of controller |
| 59 | * @return true if succeeds, fail otherwise |
| 60 | */ |
Hyunsun Moon | 1251e19 | 2016-06-07 16:57:05 -0700 | [diff] [blame] | 61 | @Deprecated |
Hyunsun Moon | aab8c67 | 2015-10-27 19:42:12 -0700 | [diff] [blame] | 62 | boolean addBridge(BridgeName bridgeName, String dpid, List<ControllerInfo> controllers); |
| 63 | |
| 64 | /** |
Hyunsun Moon | 1251e19 | 2016-06-07 16:57:05 -0700 | [diff] [blame] | 65 | * Adds a bridge with a given description. |
| 66 | * |
| 67 | * @param bridgeDescription bridge description |
| 68 | * @return true if succeeds, or false |
| 69 | */ |
| 70 | boolean addBridge(BridgeDescription bridgeDescription); |
| 71 | |
| 72 | /** |
CNlucius | a66c397 | 2015-09-06 20:31:29 +0800 | [diff] [blame] | 73 | * Remove a bridge. |
| 74 | * |
| 75 | * @param bridgeName bridge name |
| 76 | */ |
| 77 | void deleteBridge(BridgeName bridgeName); |
| 78 | |
| 79 | /** |
| 80 | * Remove a bridge. |
| 81 | * |
| 82 | * @return bridge collection |
| 83 | */ |
| 84 | Collection<BridgeDescription> getBridges(); |
| 85 | |
| 86 | /** |
Hyunsun Moon | 52b9336 | 2016-01-19 11:53:57 -0800 | [diff] [blame] | 87 | * Adds a port to a given bridge. |
| 88 | * |
| 89 | * @param bridgeName bridge name |
| 90 | * @param portName port name |
| 91 | */ |
| 92 | void addPort(BridgeName bridgeName, String portName); |
| 93 | |
| 94 | /** |
Andrea Campanella | 65ece15 | 2016-01-21 13:33:43 -0800 | [diff] [blame] | 95 | * Removes a port from a given bridge. |
| 96 | * |
| 97 | * @param bridgeName bridge name |
| 98 | * @param portName port name |
| 99 | */ |
| 100 | void deletePort(BridgeName bridgeName, String portName); |
| 101 | |
| 102 | /** |
CNlucius | a66c397 | 2015-09-06 20:31:29 +0800 | [diff] [blame] | 103 | * Delete a logical/virtual port. |
| 104 | * |
| 105 | * @return collection of port |
| 106 | */ |
| 107 | Collection<PortDescription> getPorts(); |
| 108 | |
| 109 | /** |
| 110 | * Get a collection of port. |
| 111 | * |
| 112 | * @return portNumbers set of PortNumber |
| 113 | */ |
| 114 | Set<PortNumber> getPortNumbers(); |
| 115 | |
| 116 | /** |
| 117 | * Get logical/virtual ports by ifaceIds. |
| 118 | * |
| 119 | * @param ifaceIds the ifaceid that needed |
| 120 | * @return list of PortNumber |
| 121 | */ |
| 122 | List<PortNumber> getLocalPorts(Iterable<String> ifaceIds); |
| 123 | } |