Hyunsun Moon | 5c14395 | 2016-10-19 18:34:46 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016-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 | */ |
Hyunsun Moon | 187bf53 | 2017-01-19 10:57:40 +0900 | [diff] [blame] | 16 | package org.opencord.cordvtn.api.core; |
| 17 | |
| 18 | import org.onosproject.event.ListenerService; |
| 19 | import org.opencord.cordvtn.api.net.NetworkId; |
| 20 | import org.opencord.cordvtn.api.net.PortId; |
| 21 | import org.opencord.cordvtn.api.net.ServiceNetwork; |
| 22 | import org.opencord.cordvtn.api.net.ServicePort; |
Hyunsun Moon | 5c14395 | 2016-10-19 18:34:46 -0700 | [diff] [blame] | 23 | |
| 24 | import java.util.Set; |
| 25 | |
| 26 | /** |
| 27 | * Service for interacting with the inventory of {@link ServiceNetwork} and |
| 28 | * {@link ServicePort}. |
| 29 | */ |
Hyunsun Moon | 187bf53 | 2017-01-19 10:57:40 +0900 | [diff] [blame] | 30 | public interface ServiceNetworkService |
| 31 | extends ListenerService<ServiceNetworkEvent, ServiceNetworkListener> { |
Hyunsun Moon | 5c14395 | 2016-10-19 18:34:46 -0700 | [diff] [blame] | 32 | |
| 33 | /** |
| 34 | * Returns the service network with the supplied network ID. |
| 35 | * |
Hyunsun Moon | 187bf53 | 2017-01-19 10:57:40 +0900 | [diff] [blame] | 36 | * @param networkId network id |
Hyunsun Moon | 5c14395 | 2016-10-19 18:34:46 -0700 | [diff] [blame] | 37 | * @return service network |
| 38 | */ |
Hyunsun Moon | 187bf53 | 2017-01-19 10:57:40 +0900 | [diff] [blame] | 39 | ServiceNetwork serviceNetwork(NetworkId networkId); |
Hyunsun Moon | 5c14395 | 2016-10-19 18:34:46 -0700 | [diff] [blame] | 40 | |
| 41 | /** |
| 42 | * Returns all service networks registered in the service. |
| 43 | * |
| 44 | * @return set of service networks |
| 45 | */ |
| 46 | Set<ServiceNetwork> serviceNetworks(); |
| 47 | |
| 48 | /** |
| 49 | * Returns the service port with the supplied port ID. |
| 50 | * |
| 51 | * @param portId port id |
| 52 | * @return service port |
| 53 | */ |
| 54 | ServicePort servicePort(PortId portId); |
| 55 | |
| 56 | /** |
| 57 | * Returns all service ports registered in the service. |
| 58 | * |
| 59 | * @return set of service ports |
| 60 | */ |
| 61 | Set<ServicePort> servicePorts(); |
Hyunsun Moon | 187bf53 | 2017-01-19 10:57:40 +0900 | [diff] [blame] | 62 | |
| 63 | /** |
| 64 | * Returns all service ports associated with the supplied network. |
| 65 | * @param networkId network id |
| 66 | * @return set of service ports |
| 67 | */ |
| 68 | Set<ServicePort> servicePorts(NetworkId networkId); |
Hyunsun Moon | 5c14395 | 2016-10-19 18:34:46 -0700 | [diff] [blame] | 69 | } |