blob: f1e050c84ccde5bcd18ae951d5ab2ae43ba475b6 [file] [log] [blame]
Jian Libc4dd932019-07-10 10:06:58 +09001/*
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 */
16package org.onosproject.k8snetworking.api;
17
18import io.fabric8.kubernetes.api.model.Namespace;
19import org.onosproject.event.AbstractEvent;
20
21/**
22 * Describes kubernetes namespace event.
23 */
24public class K8sNamespaceEvent extends AbstractEvent<K8sNamespaceEvent.Type, Namespace> {
25
26 /**
27 * Creates an event of a given type for the specified kubernetes namespace policy.
28 *
29 * @param type kubernetes namespace event type
30 * @param subject kubernetes namespace
31 */
32 public K8sNamespaceEvent(Type type, Namespace subject) {
33 super(type, subject);
34 }
35
36 /**
37 * Kubernetes namespace events.
38 */
39 public enum Type {
40
41 /**
42 * Signifies that a new kubernetes namespace is created.
43 */
44 K8S_NAMESPACE_CREATED,
45
46 /**
47 * Signifies that a new kubernetes namespace is updated.
48 */
49 K8S_NAMESPACE_UPDATED,
50
51 /**
52 * Signifies that a new kubernetes namespace is removed.
53 */
54 K8S_NAMESPACE_REMOVED,
55 }
56}