2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights
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
12 * http://www.apache.org/licenses/LICENSE-2.0
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 * ===================================================================
24 package org.onap.clamp.clds.model.properties;
26 import com.att.eelf.configuration.EELFLogger;
27 import com.att.eelf.configuration.EELFManager;
29 import com.google.gson.JsonElement;
30 import com.google.gson.JsonObject;
31 import java.util.List;
32 import org.onap.clamp.clds.util.JsonUtils;
35 * Parse global json properties.
38 * "global":[{"name":"service","value":["vUSP"]},{"name":"vnf","value":["vCTS",
39 * "v3CDB"]},{"name":"location","value":["san_diego","san_antonio","kansas_city"
40 * ,"kings_mountain","Secaucus","lisle","concord","houston","akron"]}]
44 protected static final EELFLogger logger = EELFManager.getInstance().getLogger(Global.class);
45 protected static final EELFLogger auditLogger = EELFManager.getInstance().getAuditLogger();
46 private String service;
47 private String actionSet;
48 private List<String> resourceVf;
49 private List<String> resourceVfc;
50 private JsonObject deployParameters;
51 private List<String> location;
52 private String vnfScope;
55 * Parse global given json node.
59 public Global(JsonObject modelJson) {
60 JsonElement globalNode = modelJson.get("global");
61 service = JsonUtils.getStringValueByName(globalNode, "service");
62 actionSet = JsonUtils.getStringValueByName(globalNode, "actionSet");
63 resourceVf = JsonUtils.getStringValuesByName(globalNode, "vf");
64 resourceVfc = JsonUtils.getStringValuesByName(globalNode, "vfc");
65 deployParameters = JsonUtils.getJsonObjectByName(globalNode, "deployParameters");
66 location = JsonUtils.getStringValuesByName(globalNode, "location");
67 vnfScope = JsonUtils.getStringValueByName(globalNode, "vnf");
73 public String getService() {
81 public void setService(String service) {
82 this.service = service;
86 * @return the actionSet
88 public String getActionSet() {
92 public void setActionSet(String actionSet) {
93 this.actionSet = actionSet;
97 * @return the resourceVf
99 public List<String> getResourceVf() {
105 * the resourceVf to set
107 public void setResourceVf(List<String> resourceVf) {
108 this.resourceVf = resourceVf;
112 * @return the resourceVfc
114 public List<String> getResourceVfc() {
120 * the resourceVfc to set
122 public void setResourceVfc(List<String> resourceVfc) {
123 this.resourceVfc = resourceVfc;
127 * @return the location
129 public List<String> getLocation() {
135 * the location to set
137 public void setLocation(List<String> location) {
138 this.location = location;
141 public JsonObject getDeployParameters() {
142 return deployParameters;
145 public void setDeployParameters(JsonObject deployParameters) {
146 this.deployParameters = deployParameters;
149 public String getVnfScope() {