025c7698d7be103699e6e23196dca598b23a01d3
[appc.git] /
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP : APPC
4  * ================================================================================
5  * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Copyright (C) 2017 Amdocs
8  * =============================================================================
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  *      http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  *
21  * ============LICENSE_END=========================================================
22  */
23
24 package org.onap.appc.seqgen.objects;
25
26 public class Constants {
27     public static final String RETRY_COUNT = "retry-count";
28     public static final String WAIT_TIME = "wait-time";
29     public static final Integer WAIT_TIME_VALUE = 60;
30     public static final Integer RETRY_COUNT_VALUE = 4;
31     public static final String STRATEGY = "strategy";
32     public static final String VNFC_TYPE = "vnfc-type";
33
34     public enum CapabilityLevel{
35         VNF("vnf"),VNFC("vnfc"),VM("vm");
36         private String level;
37         CapabilityLevel(String level) {
38             this.level=level;
39         }
40
41         public String getLevel() {
42             return level;
43         }
44     }
45
46     public enum Capabilties{
47         START_APPLICATION("StartApplication"),HEALTH_CHECK("HealthCheck"),STOP_APPLICATION("StopApplication");
48         private String capability;
49
50         Capabilties(String capability) {
51             this.capability=capability;
52         }
53         public String getCapability(){
54             return capability;
55         }
56     }
57
58     public enum ResponseMessage{
59         HEALTHY("healthy"),UNHEALTHY("unhealthy"),SUCCESS("success"),FAILURE("failure");
60
61         public String getResponse() {
62             return response;
63         }
64
65         private String response;
66         ResponseMessage(String response){
67             this.response=response;
68         }
69
70     }
71
72     public enum ResponseAction{
73         STOP("stop"),RETRY("retry"),IGNORE("ignore"),WAIT("wait"),CONTINUE("Continue"),JUMP("jump");
74
75         ResponseAction(String action) {
76             this.action=action;
77         }
78
79         private String action;
80
81         public String getAction() {
82             return action;
83         }
84
85     }
86
87     public enum Action{
88         START("Start"),START_APPLICATION("StartApplication"),HEALTH_CHECK("HealthCheck"),STOP_APPLICATION("StopApplication"),STOP("Stop");
89
90         Action(String actionType) {
91             this.actionType=actionType;
92         }
93
94         public String getActionType() {
95             return actionType;
96         }
97
98         private String actionType;
99
100     }
101     public enum ActionLevel{
102         VM("vm"),VNFC("vnfc"),VNF("vnf"),VF_MODULE("vf-module");
103         private String action;
104         ActionLevel(String action){
105             this.action=action;
106         }
107
108         public String getAction() {
109             return action;
110         }
111
112         public static ActionLevel findByString(String actoinLevel) {
113             for (ActionLevel acnlevel : ActionLevel.values()) {
114                 if (acnlevel.name().equals(actoinLevel))
115                     return acnlevel;
116             }
117             return  null;
118         }
119     }
120
121     public enum PreCheckOperator{
122         ANY("any"),ALL("all");
123
124         PreCheckOperator(String operator){
125             this.operator=operator;
126         }
127
128         public String getOperator() {
129             return operator;
130         }
131
132         private String operator;
133
134     }
135 }