edf9a4541bcdccd0f05fece0953b93e2570da847
[appc.git] / appc-dispatcher / appc-dispatcher-common / domain-model-lib / src / main / java / org / onap / appc / domainmodel / lcm / VNFOperation.java
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  * Modifications Copyright (C) 2018 Orange
10  * =============================================================================
11  * Licensed under the Apache License, Version 2.0 (the "License");
12  * you may not use this file except in compliance with the License.
13  * You may obtain a copy of the License at
14  * 
15  *      http://www.apache.org/licenses/LICENSE-2.0
16  * 
17  * Unless required by applicable law or agreed to in writing, software
18  * distributed under the License is distributed on an "AS IS" BASIS,
19  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20  * See the License for the specific language governing permissions and
21  * limitations under the License.
22  * 
23  * ============LICENSE_END=========================================================
24  */
25
26 package org.onap.appc.domainmodel.lcm;
27
28 public enum VNFOperation {
29     ActionStatus,
30     AttachVolume,
31     Audit,
32     Backup,
33     CheckLock(true),
34     Configure,
35     ConfigBackup,
36     ConfigBackupDelete,
37     ConfigExport,
38     ConfigModify,
39     ConfigRestore,
40     ConfigScaleOut,
41     DetachVolume,
42     Evacuate,
43     HealthCheck,
44     LiveUpgrade,
45     Lock(true),
46     Migrate,
47     Query,
48     QuiesceTraffic,
49     ResumeTraffic,
50     DistributeTraffic,
51     Reboot,
52     Rebuild,
53     Restart,
54     Rollback,
55     Snapshot,
56     SoftwareUpload,
57     Start,
58     StartApplication,
59     Stop,
60     StopApplication,
61     Sync,
62     Terminate,
63     Test,
64     Test_lic,
65     Unlock(true),
66     UpgradePreCheck,
67     UpgradeSoftware,
68     UpgradePostCheck,
69     UpgradeBackup,
70     UpgradeBackout;
71
72     private boolean builtIn;
73
74     VNFOperation() {
75         this.builtIn=false;
76     }
77
78     /**
79      * Operations handled directly by the RequestHandler without further call to DG are built-in operations.
80      */
81     public boolean isBuiltIn() {
82         return builtIn;
83     }
84
85     VNFOperation(boolean builtIn) {
86         this.builtIn = builtIn;
87     }
88
89     public static VNFOperation findByString(String operationName) {
90         for (VNFOperation operation : VNFOperation.values()) {
91             if (operation.name().equals(operationName)) {
92                 return operation;
93             }
94         }
95         return null;
96     }
97 }