Fix check style issues
[clamp.git] / src / main / java / org / onap / clamp / clds / model / properties / Global.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP CLAMP
4  * ================================================================================
5  * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights
6  *                             reserved.
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
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
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  * 
22  */
23
24 package org.onap.clamp.clds.model.properties;
25
26 import com.att.eelf.configuration.EELFLogger;
27 import com.att.eelf.configuration.EELFManager;
28
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;
33
34 /**
35  * Parse global json properties.
36  * Example json:
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"]}]
40  */
41 public class Global {
42
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;
52
53     /**
54      * Parse global given json node.
55      *
56      * @param modelJson The model in json format.
57      */
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");
67     }
68
69     /**
70      * Get the service.
71      * @return the service
72      */
73     public String getService() {
74         return service;
75     }
76
77     /**
78      * Set the service.
79      * @param service
80      *            the service to set
81      */
82     public void setService(String service) {
83         this.service = service;
84     }
85
86     /**
87      * Get the action set.
88      * @return the actionSet
89      */
90     public String getActionSet() {
91         return actionSet;
92     }
93
94     /**
95      * Set tje actionSet.
96      * @param actionSet
97      *             The actionSet to set
98      */
99     public void setActionSet(String actionSet) {
100         this.actionSet = actionSet;
101     }
102
103     /**
104      * Get the resource vf.
105      * @return the resourceVf
106      */
107     public List<String> getResourceVf() {
108         return resourceVf;
109     }
110
111     /**
112      * Set the resourceVf.
113      * @param resourceVf
114      *            the resourceVf to set
115      */
116     public void setResourceVf(List<String> resourceVf) {
117         this.resourceVf = resourceVf;
118     }
119
120     /**
121      * Get the resource Vfc.
122      * @return the resourceVfc
123      */
124     public List<String> getResourceVfc() {
125         return resourceVfc;
126     }
127
128     /**
129      * Set tje respirce Vfc.
130      * @param resourceVfc
131      *            the resourceVfc to set
132      */
133     public void setResourceVfc(List<String> resourceVfc) {
134         this.resourceVfc = resourceVfc;
135     }
136
137     /**
138      * Get the list of locations.
139      * @return the location
140      */
141     public List<String> getLocation() {
142         return location;
143     }
144
145     /**
146      * Set the list of locations.
147      * @param location
148      *            the location to set
149      */
150     public void setLocation(List<String> location) {
151         this.location = location;
152     }
153
154     /**
155      * Get the deploy parameters.
156      * @return The deploy parameters
157      */
158     public JsonObject getDeployParameters() {
159         return deployParameters;
160     }
161
162     /**
163      * Set the deploy parameters.
164      * @param deployParameters
165      *         the deploy parameters to set
166      */
167     public void setDeployParameters(JsonObject deployParameters) {
168         this.deployParameters = deployParameters;
169     }
170
171     /**
172      * Get the vnf scope.
173      * @return The vnf scope
174      */
175     public String getVnfScope() {
176         return vnfScope;
177     }
178
179 }