Jian Li | af1af44 | 2019-07-07 00:36:45 +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 | |
Jian Li | 00418d1 | 2021-01-15 14:53:22 +0900 | [diff] [blame^] | 18 | import io.fabric8.kubernetes.api.model.networking.v1.NetworkPolicy; |
Jian Li | af1af44 | 2019-07-07 00:36:45 +0900 | [diff] [blame] | 19 | import org.onosproject.store.Store; |
| 20 | |
| 21 | import java.util.Set; |
| 22 | |
| 23 | /** |
| 24 | * Manages inventory of kubernetes network policy; not intended for direct use. |
| 25 | */ |
| 26 | public interface K8sNetworkPolicyStore |
| 27 | extends Store<K8sNetworkPolicyEvent, K8sNetworkPolicyStoreDelegate> { |
| 28 | |
| 29 | /** |
| 30 | * Creates the new kubernetes network policy. |
| 31 | * |
| 32 | * @param networkPolicy kubernetes network policy |
| 33 | */ |
| 34 | void createNetworkPolicy(NetworkPolicy networkPolicy); |
| 35 | |
| 36 | /** |
| 37 | * Updates the new kubernetes network policy. |
| 38 | * |
| 39 | * @param networkPolicy kubernetes network policy |
| 40 | */ |
| 41 | void updateNetworkPolicy(NetworkPolicy networkPolicy); |
| 42 | |
| 43 | /** |
| 44 | * Removes the kubernetes network policy with the given network policy UID. |
| 45 | * |
| 46 | * @param uid kubernetes network policy UID |
| 47 | * @return removed kubernetes network policy; null if failed |
| 48 | */ |
| 49 | NetworkPolicy removeNetworkPolicy(String uid); |
| 50 | |
| 51 | /** |
| 52 | * Returns the kubernetes network policy with the given network policy UID. |
| 53 | * |
| 54 | * @param uid kubernetes network policy UID |
| 55 | * @return kubernetes network policy; null if not found |
| 56 | */ |
| 57 | NetworkPolicy networkPolicy(String uid); |
| 58 | |
| 59 | /** |
| 60 | * Returns all kubernetes network policies. |
| 61 | * |
| 62 | * @return set of kubernetes network policies |
| 63 | */ |
| 64 | Set<NetworkPolicy> networkPolicies(); |
| 65 | |
| 66 | /** |
| 67 | * Removes all kubernetes network policies. |
| 68 | */ |
| 69 | void clear(); |
| 70 | } |