Remove restricted notice from TOSCA file
[vid.git] / vid-app-common / src / main / java / org / onap / vid / model / aaiTree / VnfGroup.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 import org.onap.vid.aai.util.AAITreeConverter;
24
25
26 public class VnfGroup extends Node {
27
28     public static final String INSTANCE_GROUP_TYPE = "instance-group-type";
29     public static final String INSTANCE_GROUP_ROLE = "instance-group-role";
30     public static final String INSTANCE_GROUP_FUNCTION = "instance-group-function";
31
32     private String instanceGroupRole;
33     private String instanceGroupFunction;
34
35
36     public VnfGroup(AAITreeNode node) {
37         super(node, AAITreeConverter.ModelType.instanceGroup);
38     }
39
40     public static VnfGroup from(AAITreeNode node) {
41         VnfGroup vnfGroup = new VnfGroup(node);
42         if (node.getAdditionalProperties().get(INSTANCE_GROUP_TYPE) != null) {
43             vnfGroup.setInstanceType(node.getAdditionalProperties().get(INSTANCE_GROUP_TYPE).toString());
44         }
45         if (node.getAdditionalProperties().get(INSTANCE_GROUP_FUNCTION) != null) {
46             vnfGroup.setInstanceGroupFunction(node.getAdditionalProperties().get(INSTANCE_GROUP_FUNCTION).toString());
47         }
48         if (node.getAdditionalProperties().get(INSTANCE_GROUP_ROLE) != null) {
49             vnfGroup.setInstanceGroupRole(node.getAdditionalProperties().get(INSTANCE_GROUP_ROLE).toString());
50         }
51
52         return vnfGroup;
53     }
54
55     public String getInstanceGroupRole() {
56         return instanceGroupRole;
57     }
58
59     public void setInstanceGroupRole(String instanceGroupRole) {
60         this.instanceGroupRole = instanceGroupRole;
61     }
62
63     public String getInstanceGroupFunction() {
64         return instanceGroupFunction;
65     }
66
67     public void setInstanceGroupFunction(String instanceGroupFunction) {
68         this.instanceGroupFunction = instanceGroupFunction;
69     }
70
71
72 }