2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.onap.vid.model.aaiTree;
23 import org.onap.vid.aai.util.AAITreeConverter;
26 public class VnfGroup extends Node {
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";
32 private String instanceGroupRole;
33 private String instanceGroupFunction;
36 public VnfGroup(AAITreeNode node) {
37 super(node, AAITreeConverter.ModelType.instanceGroup);
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());
45 if (node.getAdditionalProperties().get(INSTANCE_GROUP_FUNCTION) != null) {
46 vnfGroup.setInstanceGroupFunction(node.getAdditionalProperties().get(INSTANCE_GROUP_FUNCTION).toString());
48 if (node.getAdditionalProperties().get(INSTANCE_GROUP_ROLE) != null) {
49 vnfGroup.setInstanceGroupRole(node.getAdditionalProperties().get(INSTANCE_GROUP_ROLE).toString());
55 public String getInstanceGroupRole() {
56 return instanceGroupRole;
59 public void setInstanceGroupRole(String instanceGroupRole) {
60 this.instanceGroupRole = instanceGroupRole;
63 public String getInstanceGroupFunction() {
64 return instanceGroupFunction;
67 public void setInstanceGroupFunction(String instanceGroupFunction) {
68 this.instanceGroupFunction = instanceGroupFunction;