Hyunsun Moon | 187bf53 | 2017-01-19 10:57:40 +0900 | [diff] [blame] | 1 | /* |
Brian O'Connor | 80dff97 | 2017-08-03 22:46:30 -0700 | [diff] [blame^] | 2 | * Copyright 2017-present Open Networking Foundation |
Hyunsun Moon | 187bf53 | 2017-01-19 10:57:40 +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.opencord.cordvtn.api.core; |
| 17 | |
| 18 | import org.onosproject.store.Store; |
| 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; |
| 23 | |
| 24 | import java.util.Set; |
| 25 | |
| 26 | /** |
| 27 | * Manages inventory of service networks; not intended for direct use. |
| 28 | */ |
| 29 | public interface ServiceNetworkStore extends Store<ServiceNetworkEvent, ServiceNetworkStoreDelegate> { |
| 30 | |
| 31 | /** |
| 32 | * Purges the service network store. |
| 33 | */ |
| 34 | void clear(); |
| 35 | |
| 36 | /** |
| 37 | * Creates new service network. |
| 38 | * |
| 39 | * @param serviceNetwork service network |
| 40 | */ |
| 41 | void createServiceNetwork(ServiceNetwork serviceNetwork); |
| 42 | |
| 43 | /** |
| 44 | * Updates the service network. |
| 45 | * |
| 46 | * @param serviceNetwork service network |
| 47 | */ |
| 48 | void updateServiceNetwork(ServiceNetwork serviceNetwork); |
| 49 | |
| 50 | /** |
| 51 | * Returns the service network with the given network id. |
| 52 | * |
| 53 | * @param networkId network id |
| 54 | * @return service network |
| 55 | */ |
| 56 | ServiceNetwork serviceNetwork(NetworkId networkId); |
| 57 | |
| 58 | /** |
| 59 | * Returns all service networks. |
| 60 | * |
| 61 | * @return set of service networks |
| 62 | */ |
| 63 | Set<ServiceNetwork> serviceNetworks(); |
| 64 | |
| 65 | /** |
| 66 | * Removes the service network with the given network id. |
| 67 | * |
| 68 | * @param networkId network id |
| 69 | * @return service network removed; null if failed |
| 70 | */ |
| 71 | ServiceNetwork removeServiceNetwork(NetworkId networkId); |
| 72 | |
| 73 | /** |
| 74 | * Creates service port. |
| 75 | * |
| 76 | * @param servicePort the new service port |
| 77 | */ |
| 78 | void createServicePort(ServicePort servicePort); |
| 79 | |
| 80 | /** |
| 81 | * Updates the service port. |
| 82 | * |
| 83 | * @param servicePort service port |
| 84 | */ |
| 85 | void updateServicePort(ServicePort servicePort); |
| 86 | |
| 87 | /** |
| 88 | * Returns the service port with the given port id. |
| 89 | * |
| 90 | * @param portId port id |
| 91 | * @return service port |
| 92 | */ |
| 93 | ServicePort servicePort(PortId portId); |
| 94 | |
| 95 | /** |
| 96 | * Returns all service ports. |
| 97 | * |
| 98 | * @return set of service ports |
| 99 | */ |
| 100 | Set<ServicePort> servicePorts(); |
| 101 | |
| 102 | /** |
| 103 | * Removes service port. |
| 104 | * |
| 105 | * @param portId port id |
| 106 | */ |
| 107 | ServicePort removeServicePort(PortId portId); |
| 108 | } |