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.
37 * "global":[{"name":"service","value":["vUSP"]},{"name":"vnf","value":["vCTS",
38 * "v3CDB"]},{"name":"location","value":["san_diego","san_antonio","kansas_city"
39 * ,"kings_mountain","Secaucus","lisle","concord","houston","akron"]}]
43 protected static final EELFLogger logger = EELFManager.getInstance().getLogger(Global.class);
44 protected static final EELFLogger auditLogger = EELFManager.getInstance().getAuditLogger();
45 private String service;
46 private String actionSet;
47 private List<String> resourceVf;
48 private List<String> resourceVfc;
49 private JsonObject deployParameters;
50 private List<String> location;
51 private String vnfScope;
54 * Parse global given json node.
56 * @param modelJson The model in json format.
58 public Global(JsonObject modelJson) {
59 JsonElement globalNode = modelJson.get("global");
60 service = JsonUtils.getStringValueByName(globalNode, "service");
61 actionSet = JsonUtils.getStringValueByName(globalNode, "actionSet");
62 resourceVf = JsonUtils.getStringValuesByName(globalNode, "vf");
63 resourceVfc = JsonUtils.getStringValuesByName(globalNode, "vfc");
64 deployParameters = JsonUtils.getJsonObjectByName(globalNode, "deployParameters");
65 location = JsonUtils.getStringValuesByName(globalNode, "location");
66 vnfScope = JsonUtils.getStringValueByName(globalNode, "vnf");
73 public String getService() {
82 public void setService(String service) {
83 this.service = service;
88 * @return the actionSet
90 public String getActionSet() {
97 * The actionSet to set
99 public void setActionSet(String actionSet) {
100 this.actionSet = actionSet;
104 * Get the resource vf.
105 * @return the resourceVf
107 public List<String> getResourceVf() {
112 * Set the resourceVf.
114 * the resourceVf to set
116 public void setResourceVf(List<String> resourceVf) {
117 this.resourceVf = resourceVf;
121 * Get the resource Vfc.
122 * @return the resourceVfc
124 public List<String> getResourceVfc() {
129 * Set tje respirce Vfc.
131 * the resourceVfc to set
133 public void setResourceVfc(List<String> resourceVfc) {
134 this.resourceVfc = resourceVfc;
138 * Get the list of locations.
139 * @return the location
141 public List<String> getLocation() {
146 * Set the list of locations.
148 * the location to set
150 public void setLocation(List<String> location) {
151 this.location = location;
155 * Get the deploy parameters.
156 * @return The deploy parameters
158 public JsonObject getDeployParameters() {
159 return deployParameters;
163 * Set the deploy parameters.
164 * @param deployParameters
165 * the deploy parameters to set
167 public void setDeployParameters(JsonObject deployParameters) {
168 this.deployParameters = deployParameters;
173 * @return The vnf scope
175 public String getVnfScope() {