blob: 87d921e49b0ddbc58cd0c36ab8ca386771c57e6e [file] [log] [blame]
Jian Li4eb0cf42020-12-19 04:01:49 +09001/*
2 * Copyright 2020-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.kubevirtnode.api;
17
18/**
19 * Defines the initialization stats of KubeVirt node.
20 */
21public enum KubevirtNodeState {
22
23 /**
24 * Indicates the node is in pre-on-board.
25 */
26 PRE_ON_BOARD {
27 @Override
28 public void process(KubevirtNodeHandler handler, KubevirtNode node) {
29
30 }
31
32 @Override
33 public KubevirtNodeState nodeState() {
34 return null;
35 }
36 },
37 /**
38 * Indicates the node is on-boarded.
39 */
40 ON_BOARDED {
41 @Override
42 public void process(KubevirtNodeHandler handler, KubevirtNode node) {
43
44 }
45
46 @Override
47 public KubevirtNodeState nodeState() {
48 return null;
49 }
50 },
51 /**
52 * Indicates the node is newly added.
53 */
54 INIT {
55 @Override
56 public void process(KubevirtNodeHandler handler, KubevirtNode node) {
57
58 }
59
60 @Override
61 public KubevirtNodeState nodeState() {
62 return null;
63 }
64 },
65 /**
66 * Indicates bridge devices are added according to the node state.
67 */
68 DEVICE_CREATED {
69 @Override
70 public void process(KubevirtNodeHandler handler, KubevirtNode node) {
71
72 }
73
74 @Override
75 public KubevirtNodeState nodeState() {
76 return null;
77 }
78 },
79 /**
80 * Indicates node initialization is done.
81 */
82 COMPLETE {
83 @Override
84 public void process(KubevirtNodeHandler handler, KubevirtNode node) {
85
86 }
87
88 @Override
89 public KubevirtNodeState nodeState() {
90 return null;
91 }
92 },
93 /**
94 * Indicates node is broken.
95 */
96 INCOMPLETE {
97 @Override
98 public void process(KubevirtNodeHandler handler, KubevirtNode node) {
99
100 }
101
102 @Override
103 public KubevirtNodeState nodeState() {
104 return null;
105 }
106 };
107
108 /**
109 * Processes the given kubevirt node which is under a certain state.
110 *
111 * @param handler kubevirt node handler
112 * @param node kubevirt node
113 */
114 public abstract void process(KubevirtNodeHandler handler, KubevirtNode node);
115
116 /**
117 * Transits to the next state.
118 *
119 * @return the next kubevirt node state
120 */
121 public abstract KubevirtNodeState nodeState();
122}