jiangrui | e3d60b1 | 2015-11-25 16:27:04 +0800 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Foundation |
jiangrui | e3d60b1 | 2015-11-25 16:27:04 +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.vtnrsc.routerinterface; |
| 17 | |
| 18 | import java.util.Collection; |
| 19 | |
| 20 | import org.onosproject.vtnrsc.RouterInterface; |
| 21 | import org.onosproject.vtnrsc.SubnetId; |
| 22 | |
| 23 | /** |
| 24 | * Service for interacting with the inventory of Router interface. |
| 25 | */ |
| 26 | public interface RouterInterfaceService { |
| 27 | /** |
| 28 | * Returns exists or not of specific subnet identifier. |
| 29 | * |
| 30 | * @param subnetId subnet identifier |
| 31 | * @return true or false |
| 32 | */ |
| 33 | boolean exists(SubnetId subnetId); |
| 34 | |
| 35 | /** |
| 36 | * Returns a collection of the currently known Router interface. |
| 37 | * |
| 38 | * @return collection of RouterInterface |
| 39 | */ |
| 40 | Collection<RouterInterface> getRouterInterfaces(); |
| 41 | |
| 42 | /** |
| 43 | * Returns the Router interface with the specified subnet identifier. |
| 44 | * |
| 45 | * @param subnetId subnet identifier |
| 46 | * @return RouterInterface or null if one with the given identifier is not |
| 47 | * known |
| 48 | */ |
| 49 | RouterInterface getRouterInterface(SubnetId subnetId); |
| 50 | |
| 51 | /** |
| 52 | * Adds the specified RouterInterface. |
| 53 | * |
| 54 | * @param routerInterface the interface add to router |
| 55 | * @return true if add router interface successfully |
| 56 | */ |
| 57 | boolean addRouterInterface(RouterInterface routerInterface); |
| 58 | |
| 59 | /** |
| 60 | * Removes the specified RouterInterface. |
| 61 | * |
| 62 | * @param routerInterface the interface remove from router |
| 63 | * @return true if remove router interface successfully |
| 64 | */ |
| 65 | boolean removeRouterInterface(RouterInterface routerInterface); |
| 66 | |
| 67 | /** |
| 68 | * Adds the specified listener to Router Interface manager. |
| 69 | * |
| 70 | * @param listener Router Interface listener |
| 71 | */ |
| 72 | void addListener(RouterInterfaceListener listener); |
| 73 | |
| 74 | /** |
| 75 | * Removes the specified listener to RouterInterface manager. |
| 76 | * |
| 77 | * @param listener Router Interface listener |
| 78 | */ |
| 79 | void removeListener(RouterInterfaceListener listener); |
| 80 | } |