Moving all files to root directory
[appc.git] / appc-dispatcher / appc-dispatcher-common / domain-model-lib / src / main / java / org / openecomp / appc / domainmodel / lcm / VNFOperation.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * openECOMP : APP-C
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights
6  *                                              reserved.
7  * ================================================================================
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  * 
12  *      http://www.apache.org/licenses/LICENSE-2.0
13  * 
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  * ============LICENSE_END=========================================================
20  */
21
22 package org.openecomp.appc.domainmodel.lcm;
23
24 public enum VNFOperation {
25
26         Configure, Test, HealthCheck, Start, Terminate, Restart, Rebuild, Stop, ModifyConfig, Backup, Snapshot,
27         SoftwareUpload, LiveUpgrade, Rollback, Sync, Audit, Test_lic, Migrate, Evacuate,
28         Lock(true), Unlock(true), CheckLock(true);
29
30         private boolean builtIn;
31
32         VNFOperation(boolean builtIn) {
33                 this.builtIn = builtIn;
34         }
35
36         VNFOperation() {
37                 this(false);
38         }
39
40         /**
41          * Operations handled directly by the RequestHandler without further call to DG are built-in operations.
42          */
43         public boolean isBuiltIn() {
44                 return builtIn;
45         }
46
47         public static VNFOperation findByString(String operationName) {
48                 for(VNFOperation operation: VNFOperation.values()) {
49                         if(operation.name().equals(operationName)) {
50                                 return operation;
51                         }
52                 }
53                 return null;
54         }
55 }