8e7a50facb902f1862635a969a08cc4a8517c457
[policy/drools-applications.git] /
1 /*-
2  * ============LICENSE_START=======================================================
3  * controlloop
4  * ================================================================================
5  * Copyright (C) 2017 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         public ControlLoopNotification(ControlLoopEvent event) {
55                 if (event == null) {
56                         return;
57                 }
58                 
59                 this.setClosedLoopControlName(event.getClosedLoopControlName());
60                 this.setRequestID(event.getRequestID());
61                 this.setClosedLoopEventClient(event.getClosedLoopEventClient());
62                 this.setTargetType(event.getTargetType());
63                 this.setTarget(event.getTarget());
64         }
65
66         public String getClosedLoopControlName() {
67                 return closedLoopControlName;
68         }
69
70         public void setClosedLoopControlName(String closedLoopControlName) {
71                 this.closedLoopControlName = closedLoopControlName;
72         }
73
74         public String getVersion() {
75                 return version;
76         }
77
78         public void setVersion(String version) {
79                 this.version = version;
80         }
81
82         public UUID getRequestID() {
83                 return requestID;
84         }
85
86         public void setRequestID(UUID requestID) {
87                 this.requestID = requestID;
88         }
89
90         public String getClosedLoopEventClient() {
91                 return closedLoopEventClient;
92         }
93
94         public void setClosedLoopEventClient(String closedLoopEventClient) {
95                 this.closedLoopEventClient = closedLoopEventClient;
96         }
97
98         public ControlLoopTargetType getTargetType() {
99                 return targetType;
100         }
101
102         public void setTargetType(ControlLoopTargetType targetType) {
103                 this.targetType = targetType;
104         }
105
106         public String getTarget() {
107                 return target;
108         }
109
110         public void setTarget(String target) {
111                 this.target = target;
112         }
113
114         public String getFrom() {
115                 return from;
116         }
117
118         public void setFrom(String from) {
119                 this.from = from;
120         }
121
122         public String getPolicyScope() {
123                 return policyScope;
124         }
125
126         public void setPolicyScope(String policyScope) {
127                 this.policyScope = policyScope;
128         }
129
130         public String getPolicyName() {
131                 return policyName;
132         }
133
134         public void setPolicyName(String policyName) {
135                 this.policyName = policyName;
136         }
137
138         public String getPolicyVersion() {
139                 return policyVersion;
140         }
141
142         public void setPolicyVersion(String policyVersion) {
143                 this.policyVersion = policyVersion;
144         }
145
146         public ControlLoopNotificationType getNotification() {
147                 return notification;
148         }
149
150         public void setNotification(ControlLoopNotificationType notification) {
151                 this.notification = notification;
152         }
153
154         public String getMessage() {
155                 return message;
156         }
157
158         public void setMessage(String message) {
159                 this.message = message;
160         }
161
162         public ZonedDateTime getNotificationTime() {
163                 return notificationTime;
164         }
165
166         public void setNotificationTime(ZonedDateTime notificationTime) {
167                 this.notificationTime = notificationTime;
168         }
169
170         public Integer getOpsCLTimer() {
171                 return opsCLTimer;
172         }
173
174         public void setOpsCLTimer(Integer opsCLTimer) {
175                 this.opsCLTimer = opsCLTimer;
176         }
177
178         public List<ControlLoopOperation> getHistory() {
179                 return history;
180         }
181
182         public void setHistory(List<ControlLoopOperation> history) {
183                 this.history = history;
184         }
185 }