Null check for ClientResponse in PolicyUril.java
[portal.git] / ecomp-portal-BE-common / src / main / java / org / openecomp / portalapp / portal / scheduler / policy / rest / RequestDetails.java
1 /*-
2  * ============LICENSE_START==========================================
3  * ONAP Portal
4  * ===================================================================
5  * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
6  * ===================================================================
7  *
8  * Unless otherwise specified, all software contained herein is licensed
9  * under the Apache License, Version 2.0 (the “License”);
10  * you may not use this software except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  *             http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  *
21  * Unless otherwise specified, all documentation contained herein is licensed
22  * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
23  * you may not use this documentation except in compliance with the License.
24  * You may obtain a copy of the License at
25  *
26  *             https://creativecommons.org/licenses/by/4.0/
27  *
28  * Unless required by applicable law or agreed to in writing, documentation
29  * distributed under the License is distributed on an "AS IS" BASIS,
30  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31  * See the License for the specific language governing permissions and
32  * limitations under the License.
33  *
34  * ============LICENSE_END============================================
35  *
36  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
37  */
38
39 package org.openecomp.portalapp.portal.scheduler.policy.rest;
40
41 import com.fasterxml.jackson.annotation.JsonInclude;
42 import com.fasterxml.jackson.annotation.JsonProperty;
43 import com.fasterxml.jackson.annotation.JsonPropertyOrder;
44
45 /*
46         [
47           {
48             "policyConfigMessage": "Config Retrieved! ",
49             "policyConfigStatus": "CONFIG_RETRIEVED",
50             "type": "JSON",
51             "config": "{\"service\":\"TimeLimitAndVerticalTopology\",\"policyName\":\"SNIRO_CM_1707.Demo_TimeLimitAndVerticalTopology_zone_localTime\",\"description\":\"dev instance\",\"templateVersion\":\"1702.03\",\"version\":\"1707\",\"priority\":\"4\",\"riskType\":\"test\",\"riskLevel\":\"3\",\"guard\":\"False\",\"content\":{\"serviceType\":\"networkOnDemand\",\"identity\":\"vnf_upgrade_policy\",\"policyScope\":{\"serviceType\":[\"networkOnDemand\"],\"aicZone\":[\" \"],\"entityType\":[\"vnf\"]},\"timeSchedule\":{\"allowedPeriodicTime\":[{\"day\":\"weekday\",\"timeRange\":[{\"start_time\":\"04:00:00\",\"end_time\":\"13:00:00\"}]}]},\"nodeType\":[\"vnf\"],\"type\":\"timeLimitAndVerticalTopology\",\"conflictScope\":\"vnf_zone\"}}",
52             "policyName": "SNIRO_CM_1707.Config_MS_Demo_TimeLimitAndVerticalTopology_zone_localTime.1.xml",
53             "policyVersion": "1",
54             "matchingConditions": {
55               "ECOMPName": "SNIRO-Placement",
56               "ConfigName": "",
57               "service": "TimeLimitAndVerticalTopology",
58               "uuid": "",
59               "Location": ""
60             },
61             "responseAttributes": {},
62             "property": null
63           },
64           {
65             "policyConfigMessage": "Config Retrieved! ",
66             "policyConfigStatus": "CONFIG_RETRIEVED",
67             "type": "JSON",
68             "config": "{\"service\":\"TimeLimitAndVerticalTopology\",\"policyName\":\"SNIRO_CM_1707.Demo_TimeLimitAndVerticalTopology_pserver_localTime\",\"description\":\"dev instance\",\"templateVersion\":\"1702.03\",\"version\":\"1707\",\"priority\":\"4\",\"riskType\":\"test\",\"riskLevel\":\"3\",\"guard\":\"False\",\"content\":{\"serviceType\":\"networkOnDemand\",\"identity\":\"vnf_upgrade_policy\",\"policyScope\":{\"serviceType\":[\"networkOnDemand\"],\"aicZone\":[\" \"],\"entityType\":[\"vnf\"]},\"timeSchedule\":{\"allowedPeriodicTime\":[{\"day\":\"weekday\",\"timeRange\":[{\"start_time\":\"04:00:00\",\"end_time\":\"13:00:00\"}]}]},\"nodeType\":[\"vnf\"],\"type\":\"timeLimitAndVerticalTopology\",\"conflictScope\":\"vnf_pserver\"}}",
69             "policyName": "SNIRO_CM_1707.Config_MS_Demo_TimeLimitAndVerticalTopology_pserver_localTime.1.xml",
70             "policyVersion": "1",
71             "matchingConditions": {
72               "ECOMPName": "SNIRO-Placement",
73               "ConfigName": "",
74               "service": "TimeLimitAndVerticalTopology",
75               "uuid": "",
76               "Location": ""
77             },
78             "responseAttributes": {},
79             "property": null
80           },
81           {
82             "policyConfigMessage": "Config Retrieved! ",
83             "policyConfigStatus": "CONFIG_RETRIEVED",
84             "type": "JSON",
85             "config": "{\"service\":\"TimeLimitAndVerticalTopology\",\"policyName\":\"SNIRO_CM_1707.Demo_TimeLimitAndVerticalTopology_vnf_localTime\",\"description\":\"dev instance\",\"templateVersion\":\"1702.03\",\"version\":\"1707\",\"priority\":\"4\",\"riskType\":\"test\",\"riskLevel\":\"3\",\"guard\":\"False\",\"content\":{\"serviceType\":\"networkOnDemand\",\"identity\":\"vnf_upgrade_policy\",\"policyScope\":{\"serviceType\":[\"networkOnDemand\"],\"aicZone\":[\" \"],\"entityType\":[\"vnf\"]},\"timeSchedule\":{\"allowedPeriodicTime\":[{\"day\":\"weekday\",\"timeRange\":[{\"start_time\":\"04:00:00\",\"end_time\":\"13:00:00\"}]}]},\"nodeType\":[\"vnf\"],\"type\":\"timeLimitAndVerticalTopology\",\"conflictScope\":\"vnf\"}}",
86             "policyName": "SNIRO_CM_1707.Config_MS_Demo_TimeLimitAndVerticalTopology_vnf_localTime.1.xml",
87             "policyVersion": "1",
88             "matchingConditions": {
89               "ECOMPName": "SNIRO-Placement",
90               "ConfigName": "",
91               "service": "TimeLimitAndVerticalTopology",
92               "uuid": "",
93               "Location": ""
94             },
95             "responseAttributes": {},
96             "property": null
97           }
98         ]
99 */
100 @JsonInclude(JsonInclude.Include.NON_NULL)
101 @JsonPropertyOrder({
102     "policyConfigMessage",
103     "policyConfigStatus",
104     "type",
105     "config",
106     "policyName",
107     "policyVersion",
108     "matchingConditions"
109 })
110 public class RequestDetails {
111         
112         @JsonProperty("policyName")
113     private String policyName;   
114     
115         @JsonProperty("policyName")
116     public String getPolicyName() {
117         return policyName;
118     }
119
120     @JsonProperty("policyName")
121     public void setPolicyName(String policyName) {
122         this.policyName = policyName;
123     }
124     
125 }