2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 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 * ===================================================================
21 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
24 package org.onap.clamp.clds.model.prop;
26 import com.fasterxml.jackson.databind.JsonNode;
28 import java.util.List;
29 import java.util.logging.Logger;
32 * Parse global json properties.
34 * Example json: "global":[{"name":"service","value":["vUSP"]},{"name":"vnf","value":["vCTS","v3CDB"]},{"name":"location","value":["san_diego","san_antonio","kansas_city","kings_mountain","Secaucus","lisle","concord","houston","akron"]}]
37 private static final Logger logger = Logger.getLogger(Global.class.getName());
39 private String service;
40 private List<String> resourceVf;
41 private List<String> resourceVfc;
42 private List<String> location;
45 * Parse global given json node.
49 public Global(JsonNode modelJson) {
50 JsonNode globalNode = modelJson.get("global");
51 service = ModelElement.getValueByName(globalNode, "service");
52 resourceVf = ModelElement.getValuesByName(globalNode, "vf");
53 resourceVfc = ModelElement.getValuesByName(globalNode, "vfc");
54 location = ModelElement.getValuesByName(globalNode, "location");
60 public String getService() {
65 * @param service the service to set
67 public void setService(String service) {
68 this.service = service;
72 * @return the resourceVf
74 public List<String> getResourceVf() {
79 * @param resourceVf the resourceVf to set
81 public void setResourceVf(List<String> resourceVf) {
82 this.resourceVf = resourceVf;
86 * @return the resourceVfc
88 public List<String> getResourceVfc() {
93 * @param resourceVfc the resourceVfc to set
95 public void setResourceVfc(List<String> resourceVfc) {
96 this.resourceVfc = resourceVfc;
100 * @return the location
102 public List<String> getLocation() {
107 * @param location the location to set
109 public void setLocation(List<String> location) {
110 this.location = location;