2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
6 * Modifications Copyright (C) 2019 Nordix Foundation.
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
12 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
22 package org.onap.policy.controlloop;
24 import java.io.Serializable;
25 import java.time.ZoneOffset;
26 import java.time.ZonedDateTime;
27 import java.util.LinkedList;
28 import java.util.List;
29 import java.util.UUID;
31 public abstract class ControlLoopNotification implements Serializable {
33 private static final long serialVersionUID = 7538596984567127915L;
35 private String closedLoopControlName;
36 private String version = "1.0.2";
37 private UUID requestId;
38 private String closedLoopEventClient;
39 private ControlLoopTargetType targetType;
40 private String target;
42 private String policyScope;
43 private String policyName;
44 private String policyVersion;
45 private ControlLoopNotificationType notification;
46 private String message;
47 private ZonedDateTime notificationTime = ZonedDateTime.now(ZoneOffset.UTC);
48 private Integer opsClTimer;
49 private List<ControlLoopOperation> history = new LinkedList<>();
51 public ControlLoopNotification() {
56 * Construct an instance.
58 * @param event the event
60 public ControlLoopNotification(ControlLoopEvent event) {
65 this.setClosedLoopControlName(event.getClosedLoopControlName());
66 this.setRequestId(event.getRequestId());
67 this.setClosedLoopEventClient(event.getClosedLoopEventClient());
68 this.setTargetType(event.getTargetType());
69 this.setTarget(event.getTarget());
72 public String getClosedLoopControlName() {
73 return closedLoopControlName;
76 public void setClosedLoopControlName(String closedLoopControlName) {
77 this.closedLoopControlName = closedLoopControlName;
80 public String getVersion() {
84 public void setVersion(String version) {
85 this.version = version;
88 public UUID getRequestId() {
92 public void setRequestId(UUID requestId) {
93 this.requestId = requestId;
96 public String getClosedLoopEventClient() {
97 return closedLoopEventClient;
100 public void setClosedLoopEventClient(String closedLoopEventClient) {
101 this.closedLoopEventClient = closedLoopEventClient;
104 public ControlLoopTargetType getTargetType() {
108 public void setTargetType(ControlLoopTargetType targetType) {
109 this.targetType = targetType;
112 public String getTarget() {
116 public void setTarget(String target) {
117 this.target = target;
120 public String getFrom() {
124 public void setFrom(String from) {
128 public String getPolicyScope() {
132 public void setPolicyScope(String policyScope) {
133 this.policyScope = policyScope;
136 public String getPolicyName() {
140 public void setPolicyName(String policyName) {
141 this.policyName = policyName;
144 public String getPolicyVersion() {
145 return policyVersion;
148 public void setPolicyVersion(String policyVersion) {
149 this.policyVersion = policyVersion;
152 public ControlLoopNotificationType getNotification() {
156 public void setNotification(ControlLoopNotificationType notification) {
157 this.notification = notification;
160 public String getMessage() {
164 public void setMessage(String message) {
165 this.message = message;
168 public ZonedDateTime getNotificationTime() {
169 return notificationTime;
172 public void setNotificationTime(ZonedDateTime notificationTime) {
173 this.notificationTime = notificationTime;
176 public Integer getOpsClTimer() {
180 public void setOpsClTimer(Integer opsClTimer) {
181 this.opsClTimer = opsClTimer;
184 public List<ControlLoopOperation> getHistory() {
188 public void setHistory(List<ControlLoopOperation> history) {
189 this.history = history;