f03c6f362b8e5a0eac72b1fe07fb60fd1faed4fe
[optf/cmso.git] /
1 /*
2  * Copyright © 2017-2019 AT&T Intellectual Property.
3  * Modifications Copyright © 2018 IBM.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *         http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *
18  * Unless otherwise specified, all documentation contained herein is licensed
19  * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
20  * you may not use this documentation except in compliance with the License.
21  * You may obtain a copy of the License at
22  *
23  *         https://creativecommons.org/licenses/by/4.0/
24  *
25  * Unless required by applicable law or agreed to in writing, documentation
26  * distributed under the License is distributed on an "AS IS" BASIS,
27  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28  * See the License for the specific language governing permissions and
29  * limitations under the License.
30 */
31
32 package org.onap.optf.cmso.optimizer.clients.ticketmgt.models;
33
34 import com.att.eelf.configuration.EELFLogger;
35 import com.att.eelf.configuration.EELFManager;
36 import com.fasterxml.jackson.core.JsonProcessingException;
37 import com.fasterxml.jackson.databind.ObjectMapper;
38 import io.swagger.annotations.ApiModelProperty;
39 import java.io.Serializable;
40 import java.util.ArrayList;
41 import java.util.List;
42 import org.onap.optf.cmso.optimizer.clients.common.models.ElementCriteria;
43 import org.onap.optf.cmso.optimizer.service.rs.models.ChangeWindow;
44 import org.onap.optf.cmso.optimizer.service.rs.models.NameValue;
45
46 public class ActiveTicketsRequest implements Serializable {
47     private static final long serialVersionUID = 1L;
48     private static EELFLogger log = EELFManager.getInstance().getLogger(ActiveTicketsRequest.class);
49
50     @ApiModelProperty(value = "Unique Id of the request")
51     private String requestId;
52
53     @ApiModelProperty(
54                     value = "Implementation specific name value pairs provided to be passed to Ticket Management query .")
55     private List<NameValue> commonData;
56
57     @ApiModelProperty(value = "Lists of desired change windows for which TicketData will be returned.")
58     private List<ChangeWindow> changeWindows = new ArrayList<>();
59
60     @ApiModelProperty(value = "List of the elements for which TicketData will be returned.")
61     private List<ElementCriteria> elements = new ArrayList<>();
62
63     public String getRequestId() {
64         return requestId;
65     }
66
67
68     public void setRequestId(String requestId) {
69         this.requestId = requestId;
70     }
71
72
73     public List<NameValue> getCommonData() {
74         return commonData;
75     }
76
77
78     public void setCommonData(List<NameValue> commonData) {
79         this.commonData = commonData;
80     }
81
82
83     public List<ChangeWindow> getChangeWindows() {
84         return changeWindows;
85     }
86
87
88     public void setChangeWindows(List<ChangeWindow> changeWindows) {
89         this.changeWindows = changeWindows;
90     }
91
92
93     public List<ElementCriteria> getElements() {
94         return elements;
95     }
96
97
98     public void setElements(List<ElementCriteria> elements) {
99         this.elements = elements;
100     }
101
102
103     @Override
104     public String toString() {
105         ObjectMapper mapper = new ObjectMapper();
106         try {
107             return mapper.writeValueAsString(this);
108         } catch (JsonProcessingException e) {
109             log.debug("Error in toString()", e);
110         }
111         return "";
112     }
113
114 }