Remove ECOMP in headers
[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 import com.fasterxml.jackson.databind.JsonNode;
29
30 import java.util.List;
31
32 /**
33  * Parse global json properties.
34  * <p>
35  * Example json:
36  * "global":[{"name":"service","value":["vUSP"]},{"name":"vnf","value":["vCTS",
37  * "v3CDB"]},{"name":"location","value":["san_diego","san_antonio","kansas_city"
38  * ,"kings_mountain","Secaucus","lisle","concord","houston","akron"]}]
39  */
40 public class Global {
41
42     protected static final EELFLogger logger = EELFManager.getInstance().getLogger(Global.class);
43     protected static final EELFLogger auditLogger = EELFManager.getInstance().getAuditLogger();
44     private String service;
45     private String actionSet;
46     private List<String> resourceVf;
47     private List<String> resourceVfc;
48     private JsonNode deployParameters;
49     private List<String> location;
50
51     /**
52      * Parse global given json node.
53      *
54      * @param modelJson
55      */
56     public Global(JsonNode modelJson) {
57         JsonNode globalNode = modelJson.get("global");
58         service = AbstractModelElement.getValueByName(globalNode, "service");
59         actionSet = AbstractModelElement.getValueByName(globalNode, "actionSet");
60         resourceVf = AbstractModelElement.getValuesByName(globalNode, "vf");
61         resourceVfc = AbstractModelElement.getValuesByName(globalNode, "vfc");
62         deployParameters = AbstractModelElement.getJsonNodeByName(globalNode, "deployParameters");
63         location = AbstractModelElement.getValuesByName(globalNode, "location");
64     }
65
66     /**
67      * @return the service
68      */
69     public String getService() {
70         return service;
71     }
72
73     /**
74      * @param service
75      *            the service to set
76      */
77     public void setService(String service) {
78         this.service = service;
79     }
80
81     /**
82      * @return the actionSet
83      */
84     public String getActionSet() {
85         return actionSet;
86     }
87
88     public void setActionSet(String actionSet) {
89         this.actionSet = actionSet;
90     }
91
92     /**
93      * @return the resourceVf
94      */
95     public List<String> getResourceVf() {
96         return resourceVf;
97     }
98
99     /**
100      * @param resourceVf
101      *            the resourceVf to set
102      */
103     public void setResourceVf(List<String> resourceVf) {
104         this.resourceVf = resourceVf;
105     }
106
107     /**
108      * @return the resourceVfc
109      */
110     public List<String> getResourceVfc() {
111         return resourceVfc;
112     }
113
114     /**
115      * @param resourceVfc
116      *            the resourceVfc to set
117      */
118     public void setResourceVfc(List<String> resourceVfc) {
119         this.resourceVfc = resourceVfc;
120     }
121
122     /**
123      * @return the location
124      */
125     public List<String> getLocation() {
126         return location;
127     }
128
129     /**
130      * @param location
131      *            the location to set
132      */
133     public void setLocation(List<String> location) {
134         this.location = location;
135     }
136
137     public JsonNode getDeployParameters() {
138         return deployParameters;
139     }
140
141     public void setDeployParameters(JsonNode deployParameters) {
142         this.deployParameters = deployParameters;
143     }
144 }