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.event.AbstractEvent; |
| 20 | |
| 21 | /** |
| 22 | * Describes kubernetes network policy event. |
| 23 | */ |
| 24 | public class K8sNetworkPolicyEvent extends |
| 25 | AbstractEvent<K8sNetworkPolicyEvent.Type, NetworkPolicy> { |
| 26 | |
| 27 | /** |
| 28 | * Creates an event of a given type for the specified kubernetes network policy. |
| 29 | * |
| 30 | * @param type kubernetes network policy event type |
| 31 | * @param subject kubernetes network policy |
| 32 | */ |
| 33 | public K8sNetworkPolicyEvent(Type type, NetworkPolicy subject) { |
| 34 | super(type, subject); |
| 35 | } |
| 36 | |
| 37 | /** |
| 38 | * Kubernetes network policy events. |
| 39 | */ |
| 40 | public enum Type { |
| 41 | |
| 42 | /** |
| 43 | * Signifies that a new kubernetes network policy is created. |
| 44 | */ |
| 45 | K8S_NETWORK_POLICY_CREATED, |
| 46 | |
| 47 | /** |
| 48 | * Signifies that a new kubernetes network policy is updated. |
| 49 | */ |
| 50 | K8S_NETWORK_POLICY_UPDATED, |
| 51 | |
| 52 | /** |
| 53 | * Signifies that a new kubernetes network policy is removed. |
| 54 | */ |
| 55 | K8S_NETWORK_POLICY_REMOVED, |
| 56 | |
| 57 | } |
| 58 | } |