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.router; |
| 17 | |
| 18 | import java.util.Collection; |
| 19 | |
| 20 | import org.onosproject.vtnrsc.Router; |
| 21 | import org.onosproject.vtnrsc.RouterId; |
| 22 | |
| 23 | /** |
| 24 | * Service for interacting with the inventory of Routers. |
| 25 | */ |
| 26 | public interface RouterService { |
| 27 | /** |
| 28 | * Returns exists or not of specific router identifier. |
| 29 | * |
| 30 | * @param routerId router identifier |
| 31 | * @return true or false |
| 32 | */ |
| 33 | boolean exists(RouterId routerId); |
| 34 | |
| 35 | /** |
| 36 | * Returns a collection of the currently known Routers. |
| 37 | * |
| 38 | * @return collection of Routers |
| 39 | */ |
| 40 | Collection<Router> getRouters(); |
| 41 | |
| 42 | /** |
| 43 | * Returns the Router with the specified identifier. |
| 44 | * |
| 45 | * @param routerId Router identifier |
| 46 | * @return Router or null if one with the given identifier is not known |
| 47 | */ |
| 48 | Router getRouter(RouterId routerId); |
| 49 | |
| 50 | /** |
| 51 | * Creates new Routers. |
| 52 | * |
| 53 | * @param routers the collection of Routers |
| 54 | * @return true if the identifier Router has been created right. |
| 55 | * false if the identifier Router is failed to store |
| 56 | */ |
| 57 | boolean createRouters(Collection<Router> routers); |
| 58 | |
| 59 | /** |
| 60 | * Updates existing Routers. |
| 61 | * |
| 62 | * @param routers the collection of Routers |
| 63 | * @return true if Routers were updated successfully. |
| 64 | * false if Routers were updated failed |
| 65 | */ |
| 66 | boolean updateRouters(Collection<Router> routers); |
| 67 | |
| 68 | /** |
| 69 | * Removes the specified Routers from the store. |
| 70 | * |
| 71 | * @param routerIds the collection of Routers identifier |
| 72 | * @return true if remove identifier Routers successfully. false if remove |
| 73 | * identifier Routers failed |
| 74 | */ |
| 75 | boolean removeRouters(Collection<RouterId> routerIds); |
| 76 | |
| 77 | /** |
| 78 | * Adds the specified listener to Router manager. |
| 79 | * |
| 80 | * @param listener Router listener |
| 81 | */ |
| 82 | void addListener(RouterListener listener); |
| 83 | |
| 84 | /** |
| 85 | * Removes the specified listener to Router manager. |
| 86 | * |
| 87 | * @param listener Router listener |
| 88 | */ |
| 89 | void removeListener(RouterListener listener); |
| 90 | } |