Hyunsun Moon | 44aac66 | 2017-02-18 02:07:01 +0900 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2017-present Open Networking Foundation |
Hyunsun Moon | 44aac66 | 2017-02-18 02:07:01 +0900 | [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.openstacknetworking.api; |
| 17 | |
| 18 | import org.onosproject.event.ListenerService; |
| 19 | import org.openstack4j.model.network.Network; |
| 20 | import org.openstack4j.model.network.Port; |
| 21 | import org.openstack4j.model.network.Subnet; |
| 22 | |
| 23 | import java.util.Set; |
| 24 | |
| 25 | /** |
| 26 | * Service for interacting with the inventory of OpenStack network and port. |
| 27 | */ |
| 28 | public interface OpenstackNetworkService |
| 29 | extends ListenerService<OpenstackNetworkEvent, OpenstackNetworkListener> { |
| 30 | /** |
| 31 | * Returns the network with the supplied network ID. |
| 32 | * |
| 33 | * @param networkId network id |
| 34 | * @return openstack network |
| 35 | */ |
| 36 | Network network(String networkId); |
| 37 | |
| 38 | /** |
| 39 | * Returns all networks registered in the service. |
| 40 | * |
| 41 | * @return set of networks |
| 42 | */ |
| 43 | Set<Network> networks(); |
| 44 | |
| 45 | /** |
| 46 | * Returns the subnet with the supplied subnet ID. |
| 47 | * |
| 48 | * @param subnetId subnet id |
| 49 | * @return subnet |
| 50 | */ |
| 51 | Subnet subnet(String subnetId); |
| 52 | |
| 53 | /** |
| 54 | * Returns all subnets registered in the service. |
| 55 | * |
| 56 | * @return set of subnet |
| 57 | */ |
| 58 | Set<Subnet> subnets(); |
| 59 | |
| 60 | /** |
| 61 | * Returns all subnets associated with the supplied network. |
| 62 | * |
| 63 | * @param networkId network id |
| 64 | * @return set of subnet |
| 65 | */ |
| 66 | Set<Subnet> subnets(String networkId); |
| 67 | |
| 68 | /** |
| 69 | * Returns the OpenStack port with the supplied port ID. |
| 70 | * |
| 71 | * @param portId openstack port id |
| 72 | * @return openstack port |
| 73 | */ |
| 74 | Port port(String portId); |
| 75 | |
| 76 | /** |
| 77 | * Returns the OpenStack port with the supplied ONOS port. |
| 78 | * |
| 79 | * @param port onos port |
| 80 | * @return openstack port |
| 81 | */ |
| 82 | Port port(org.onosproject.net.Port port); |
| 83 | |
| 84 | /** |
| 85 | * Returns all OpenStack ports registered in the service. |
| 86 | * |
| 87 | * @return set of ports |
| 88 | */ |
| 89 | Set<Port> ports(); |
| 90 | |
| 91 | /** |
| 92 | * Returns all OpenStack ports associated with the supplied network. |
| 93 | * @param networkId network id |
| 94 | * @return set of ports |
| 95 | */ |
| 96 | Set<Port> ports(String networkId); |
| 97 | } |