Jian Li | fc55e42 | 2019-01-21 14:39:34 +0900 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2019-present Open Networking Foundation |
| 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.k8snetworking.api; |
| 17 | |
| 18 | import org.onosproject.store.Store; |
| 19 | |
| 20 | import java.util.Set; |
| 21 | |
| 22 | /** |
| 23 | * Manages inventory of kubernetes network states; not intended for direct use. |
| 24 | */ |
| 25 | public interface K8sNetworkStore extends Store<K8sNetworkEvent, K8sNetworkStoreDelegate> { |
| 26 | |
| 27 | /** |
| 28 | * Creates the new kubernetes network. |
| 29 | * |
| 30 | * @param network kubernetes network |
| 31 | */ |
| 32 | void createNetwork(K8sNetwork network); |
| 33 | |
| 34 | /** |
| 35 | * Update the kubernetes network. |
| 36 | * |
| 37 | * @param network kubernetes network |
| 38 | */ |
| 39 | void updateNetwork(K8sNetwork network); |
| 40 | |
| 41 | /** |
| 42 | * Removes the kubernetes network with the given network identifier. |
| 43 | * |
| 44 | * @param networkId network identifier |
| 45 | * @return removed kubernetes network; null if failed |
| 46 | */ |
| 47 | K8sNetwork removeNetwork(String networkId); |
| 48 | |
| 49 | /** |
| 50 | * Returns the kubernetes network with the given network identifier. |
| 51 | * |
| 52 | * @param networkId network identifier |
| 53 | * @return network; null if not found |
| 54 | */ |
| 55 | K8sNetwork network(String networkId); |
| 56 | |
| 57 | /** |
| 58 | * Returns all kubernetes networks. |
| 59 | * |
| 60 | * @return set of kubernetes networks |
| 61 | */ |
| 62 | Set<K8sNetwork> networks(); |
| 63 | |
| 64 | /** |
Jian Li | 7e8f57e | 2019-01-24 18:31:03 +0900 | [diff] [blame] | 65 | * Creates a new kubernetes port. |
| 66 | * |
| 67 | * @param port kubernetes port |
| 68 | */ |
| 69 | void createPort(K8sPort port); |
| 70 | |
| 71 | /** |
| 72 | * Update the kubernetes port. |
| 73 | * |
| 74 | * @param port kubernetes port |
| 75 | */ |
| 76 | void updatePort(K8sPort port); |
| 77 | |
| 78 | /** |
| 79 | * Removes the kubernetes port with the given port identifier. |
| 80 | * |
| 81 | * @param portId port identifier |
| 82 | * @return port; null if not found |
| 83 | */ |
| 84 | K8sPort removePort(String portId); |
| 85 | |
| 86 | /** |
| 87 | * Returns all kubernetes ports. |
| 88 | * |
| 89 | * @return set of kubernetes ports |
| 90 | */ |
| 91 | Set<K8sPort> ports(); |
| 92 | |
| 93 | /** |
| 94 | * Return the kubernetes port with the given port identifier. |
| 95 | * |
| 96 | * @param portId port identifier |
| 97 | * @return kubernetes port |
| 98 | */ |
| 99 | K8sPort port(String portId); |
| 100 | |
| 101 | /** |
| 102 | * Removes all kubernetes networks and ports. |
Jian Li | fc55e42 | 2019-01-21 14:39:34 +0900 | [diff] [blame] | 103 | */ |
| 104 | void clear(); |
| 105 | } |