ff0d553afac63519c3570b69df2be93599484423
[policy/clamp.git] /
1 /*-
2  * ============LICENSE_START=======================================================
3  * Copyright (C) 2021 Nordix Foundation.
4  * ================================================================================
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  * SPDX-License-Identifier: Apache-2.0
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.policy.clamp.controlloop.models.controlloop.concepts;
22
23 public enum ControlLoopState {
24     /**
25      * The control loop or control loop element is not initialised on participants, it does not exist on participants.
26      */
27     UNINITIALISED,
28     /**
29      * The control loop or control loop element is changing from unitialised to passive, it is being initialised onto
30      * participants.
31      */
32     UNINITIALISED2PASSIVE,
33     /**
34      * The control loop or control loop element is initialised on the participants but is passive, that is, it is not
35      * handling control loop messages yet.
36      */
37     PASSIVE,
38     /**
39      * The control loop or control loop element is changing from passive to running, the participants are preparing to
40      * execute control loops.
41      */
42     PASSIVE2RUNNING,
43     /** The control loop or control loop element is running and is executing control loops. */
44     RUNNING,
45     /**
46      * The control loop or control loop element is completing execution of current control loops but will not start
47      * running any more control loops and will become passive.
48      */
49     RUNNING2PASSIVE,
50     /**
51      * The control loop or control loop element is changing from passive to unitialised, the control loop is being
52      * removed from participants.
53      */
54     PASSIVE2UNINITIALISED;
55
56     public boolean equalsControlLoopOrderedState(final ControlLoopOrderedState controlLoopOrderedState)  {
57         return this.name().equals(controlLoopOrderedState.name());
58     }
59
60     public ControlLoopOrderedState asOrderedState() {
61         return ControlLoopOrderedState.valueOf(this.name());
62     }
63 }