CNlucius | a66c397 | 2015-09-06 20:31:29 +0800 | [diff] [blame] | 1 | /* |
| 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 | */ |
| 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 | * |
| 34 | * @param bridgeName bridge name |
| 35 | */ |
| 36 | void addBridge(BridgeName bridgeName); |
| 37 | |
| 38 | /** |
| 39 | * Remove a bridge. |
| 40 | * |
| 41 | * @param bridgeName bridge name |
| 42 | */ |
| 43 | void deleteBridge(BridgeName bridgeName); |
| 44 | |
| 45 | /** |
| 46 | * Remove a bridge. |
| 47 | * |
| 48 | * @return bridge collection |
| 49 | */ |
| 50 | Collection<BridgeDescription> getBridges(); |
| 51 | |
| 52 | /** |
| 53 | * Add a logical/virtual port. |
| 54 | * |
| 55 | * @param port port number |
| 56 | */ |
| 57 | void addPort(PortDescription port); |
| 58 | |
| 59 | /** |
| 60 | * Delete a logical/virtual port. |
| 61 | * |
| 62 | * @param port port number |
| 63 | */ |
| 64 | void deletePort(PortDescription port); |
| 65 | |
| 66 | /** |
| 67 | * Delete a logical/virtual port. |
| 68 | * |
| 69 | * @return collection of port |
| 70 | */ |
| 71 | Collection<PortDescription> getPorts(); |
| 72 | |
| 73 | /** |
| 74 | * Get a collection of port. |
| 75 | * |
| 76 | * @return portNumbers set of PortNumber |
| 77 | */ |
| 78 | Set<PortNumber> getPortNumbers(); |
| 79 | |
| 80 | /** |
| 81 | * Get logical/virtual ports by ifaceIds. |
| 82 | * |
| 83 | * @param ifaceIds the ifaceid that needed |
| 84 | * @return list of PortNumber |
| 85 | */ |
| 86 | List<PortNumber> getLocalPorts(Iterable<String> ifaceIds); |
| 87 | } |