Hyunsun Moon | 44aac66 | 2017-02-18 02:07:01 +0900 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2017-present 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.openstacknetworking.api; |
| 17 | |
| 18 | import org.onosproject.store.Store; |
| 19 | import org.openstack4j.model.network.NetFloatingIP; |
| 20 | import org.openstack4j.model.network.Router; |
| 21 | import org.openstack4j.model.network.RouterInterface; |
| 22 | |
| 23 | import java.util.Set; |
| 24 | |
| 25 | /** |
| 26 | * Manages inventory of OpenStack router states; not intended for direct use. |
| 27 | */ |
| 28 | public interface OpenstackRouterStore |
| 29 | extends Store<OpenstackRouterEvent, OpenstackRouterStoreDelegate> { |
| 30 | |
| 31 | /** |
| 32 | * Creates a new router. |
| 33 | * |
| 34 | * @param osRouter openstack router |
| 35 | */ |
| 36 | void createRouter(Router osRouter); |
| 37 | |
| 38 | /** |
| 39 | * Updates the router. |
| 40 | * |
| 41 | * @param osRouter updated openstack router |
| 42 | */ |
| 43 | void updateRouter(Router osRouter); |
| 44 | |
| 45 | /** |
| 46 | * Removes the router with the supplied ID. |
| 47 | * |
| 48 | * @param osRouterId openstack router id |
| 49 | * @return removed router; null if failed |
| 50 | */ |
| 51 | Router removeRouter(String osRouterId); |
| 52 | |
| 53 | /** |
| 54 | * Returns the router with the supplied router ID. |
| 55 | * |
| 56 | * @param osRouterId openstack router id |
| 57 | * @return openstack router; null if not found |
| 58 | */ |
| 59 | Router router(String osRouterId); |
| 60 | |
| 61 | /** |
| 62 | * Returns all routers. |
| 63 | * |
| 64 | * @return set of openstack router |
| 65 | */ |
| 66 | Set<Router> routers(); |
| 67 | |
| 68 | /** |
| 69 | * Adds a new interface to the router. |
| 70 | * |
| 71 | * @param osRouterIface openstack router interface |
| 72 | */ |
| 73 | void addRouterInterface(RouterInterface osRouterIface); |
| 74 | |
| 75 | /** |
| 76 | * Updates the router interface. |
| 77 | * |
| 78 | * @param osRouterIface openstack router interface |
| 79 | */ |
| 80 | void updateRouterInterface(RouterInterface osRouterIface); |
| 81 | |
| 82 | /** |
| 83 | * Removes the router interface. |
| 84 | * |
| 85 | * @param osRouterIfaceId openstack router interface id |
| 86 | * @return removed router interface; null if failed |
| 87 | */ |
| 88 | RouterInterface removeRouterInterface(String osRouterIfaceId); |
| 89 | |
| 90 | /** |
| 91 | * Returns the router interface with the given ID. |
| 92 | * |
| 93 | * @param osRouterIfaceId openstack router interface port id |
| 94 | * @return openstack router interface |
| 95 | */ |
| 96 | RouterInterface routerInterface(String osRouterIfaceId); |
| 97 | |
| 98 | /** |
| 99 | * Returns all router interfaces. |
| 100 | * |
| 101 | * @return set of openstack router interfaces |
| 102 | */ |
| 103 | Set<RouterInterface> routerInterfaces(); |
| 104 | |
| 105 | /** |
| 106 | * Creates a new floating IP address. |
| 107 | * |
| 108 | * @param floatingIp openstack floating ip |
| 109 | */ |
| 110 | void createFloatingIp(NetFloatingIP floatingIp); |
| 111 | |
| 112 | /** |
| 113 | * Updates the floating IP address. |
| 114 | * |
| 115 | * @param floatingIp updated openstack floating ip |
| 116 | */ |
| 117 | void updateFloatingIp(NetFloatingIP floatingIp); |
| 118 | |
| 119 | /** |
| 120 | * Removes the floating IP with the supplied ID. |
| 121 | * |
| 122 | * @param floatingIpId floating ip id |
| 123 | * @return removed floating ip; null if failed |
| 124 | */ |
| 125 | NetFloatingIP removeFloatingIp(String floatingIpId); |
| 126 | |
| 127 | /** |
| 128 | * Returns the floating IP with the supplied ID. |
| 129 | * |
| 130 | * @param floatingIpId floating ip id |
| 131 | * @return openstack floating ip; null if not found |
| 132 | */ |
| 133 | NetFloatingIP floatingIp(String floatingIpId); |
| 134 | |
| 135 | /** |
| 136 | * Returns all floating IP addresses. |
| 137 | * |
| 138 | * @return openstack floating ip; empty set if no floating ip exists |
| 139 | */ |
| 140 | Set<NetFloatingIP> floatingIps(); |
| 141 | } |