Implant vid-app-common org.onap.vid.job (main and test)
[vid.git] / vid-app-common / src / main / java / org / onap / vid / model / aaiTree / NodeType.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * VID
4  * ================================================================================
5  * Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.vid.model.aaiTree;
22
23 public enum NodeType {
24     SERVICE_INSTANCE("service-instance", "service-instance-id", "service-instance-name", "service"),
25     GENERIC_VNF ("generic-vnf", "vnf-id", "vnf-name", "vnf"),
26     NETWORK ("l3-network", "network-id", "network-name", "network"),
27     FAILURE ("failure_node", NodeType.NONE, NodeType.NONE, NodeType.NONE),
28     COLLECTION_RESOURCE ("collection", "collection-id", "collection-name", "collection"),
29     CONFIGURATION ("configuration", "configuration-id", "configuration-name", "configuration"),
30     PNF ("pnf", "pnf-id", "pnf-name", "pnf"),
31     VF_MODULE ("vf-module", "vf-module-id", "vf-module-name", "vfModule"),
32     INSTANCE_GROUP ("instance-group", "id", "instance-group-name", "instanceGroup"),
33     PORT ("l-interface", "interface-id", "interface-name", "connectionPoint"),
34     VOLUME_GROUP ("volume-group", "volume-group-id", "volume-group-name", "volumeGroup"),
35     VLAN_TAG("vlan-tag", "vlan-tag-id", NodeType.NONE, NodeType.NONE),
36     VPN_BINDING("vpn-binding", "vpn-id", "vpn-name", "vpnBinding"),
37     ;
38
39     private String type;
40     private String id;
41     private String name;
42     private String modelType;
43
44     public static final String NONE = "";
45
46     NodeType(String type, String id, String name, String modelType) {
47         this.type = type;
48         this.id = id;
49         this.name = name;
50         this.modelType = modelType;
51     }
52
53     public String getType() {
54         return type;
55     }
56
57     public String getId() {
58         return id;
59     }
60
61     public String getName() {
62         return name;
63     }
64
65     public String getModelType() {
66         return modelType;
67     }
68
69     public static NodeType fromString(String type) {
70         for (NodeType nodeType : NodeType.values()) {
71             if (nodeType.type.equalsIgnoreCase(type)) {
72                 return nodeType;
73             }
74         }
75         return null;
76     }
77
78     @Override
79     public String toString() {
80         return this.type;
81     }
82 }