Merge "Add debugging of REST call"
[policy/drools-applications.git] / controlloop / common / model-impl / events / src / main / java / org / onap / policy / controlloop / ControlLoopNotification.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * controlloop
4  * ================================================================================
5  * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.policy.controlloop;
22
23 import java.io.Serializable;
24 import java.time.ZoneOffset;
25 import java.time.ZonedDateTime;
26 import java.util.LinkedList;
27 import java.util.List;
28 import java.util.UUID;
29
30 public abstract class ControlLoopNotification implements Serializable {
31
32     private static final long serialVersionUID = 7538596984567127915L;
33
34     private String closedLoopControlName;
35     private String version = "1.0.2";
36     private UUID requestId;
37     private String closedLoopEventClient;
38     private ControlLoopTargetType targetType;
39     private String target;
40     private String from;
41     private String policyScope;
42     private String policyName;
43     private String policyVersion;
44     private ControlLoopNotificationType notification;
45     private String message;
46     private ZonedDateTime notificationTime = ZonedDateTime.now(ZoneOffset.UTC);
47     private Integer opsClTimer;
48     private List<ControlLoopOperation> history = new LinkedList<>();
49
50     public ControlLoopNotification() {
51
52     }
53
54     /**
55      * Construct an instance.
56      * 
57      * @param event the event
58      */
59     public ControlLoopNotification(ControlLoopEvent event) {
60         if (event == null) {
61             return;
62         }
63
64         this.setClosedLoopControlName(event.getClosedLoopControlName());
65         this.setRequestId(event.getRequestId());
66         this.setClosedLoopEventClient(event.getClosedLoopEventClient());
67         this.setTargetType(event.getTargetType());
68         this.setTarget(event.getTarget());
69     }
70
71     public String getClosedLoopControlName() {
72         return closedLoopControlName;
73     }
74
75     public void setClosedLoopControlName(String closedLoopControlName) {
76         this.closedLoopControlName = closedLoopControlName;
77     }
78
79     public String getVersion() {
80         return version;
81     }
82
83     public void setVersion(String version) {
84         this.version = version;
85     }
86
87     public UUID getRequestId() {
88         return requestId;
89     }
90
91     public void setRequestId(UUID requestId) {
92         this.requestId = requestId;
93     }
94
95     public String getClosedLoopEventClient() {
96         return closedLoopEventClient;
97     }
98
99     public void setClosedLoopEventClient(String closedLoopEventClient) {
100         this.closedLoopEventClient = closedLoopEventClient;
101     }
102
103     public ControlLoopTargetType getTargetType() {
104         return targetType;
105     }
106
107     public void setTargetType(ControlLoopTargetType targetType) {
108         this.targetType = targetType;
109     }
110
111     public String getTarget() {
112         return target;
113     }
114
115     public void setTarget(String target) {
116         this.target = target;
117     }
118
119     public String getFrom() {
120         return from;
121     }
122
123     public void setFrom(String from) {
124         this.from = from;
125     }
126
127     public String getPolicyScope() {
128         return policyScope;
129     }
130
131     public void setPolicyScope(String policyScope) {
132         this.policyScope = policyScope;
133     }
134
135     public String getPolicyName() {
136         return policyName;
137     }
138
139     public void setPolicyName(String policyName) {
140         this.policyName = policyName;
141     }
142
143     public String getPolicyVersion() {
144         return policyVersion;
145     }
146
147     public void setPolicyVersion(String policyVersion) {
148         this.policyVersion = policyVersion;
149     }
150
151     public ControlLoopNotificationType getNotification() {
152         return notification;
153     }
154
155     public void setNotification(ControlLoopNotificationType notification) {
156         this.notification = notification;
157     }
158
159     public String getMessage() {
160         return message;
161     }
162
163     public void setMessage(String message) {
164         this.message = message;
165     }
166
167     public ZonedDateTime getNotificationTime() {
168         return notificationTime;
169     }
170
171     public void setNotificationTime(ZonedDateTime notificationTime) {
172         this.notificationTime = notificationTime;
173     }
174
175     public Integer getOpsClTimer() {
176         return opsClTimer;
177     }
178
179     public void setOpsClTimer(Integer opsClTimer) {
180         this.opsClTimer = opsClTimer;
181     }
182
183     public List<ControlLoopOperation> getHistory() {
184         return history;
185     }
186
187     public void setHistory(List<ControlLoopOperation> history) {
188         this.history = history;
189     }
190 }