acb81f8ba506f867d347e10d02cd7b176b0ed713
[policy/drools-applications.git] /
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 com.google.gson.annotations.SerializedName;
24
25 import java.time.Instant;
26 import java.util.HashMap;
27 import java.util.Map;
28
29 public class VirtualControlLoopNotification extends ControlLoopNotification {
30
31     private static final long serialVersionUID = 5354756047932144017L;
32
33     @SerializedName("AAI")
34     private Map<String, String> aai = new HashMap<>();
35     private Instant closedLoopAlarmStart;
36     private Instant closedLoopAlarmEnd;
37
38     public VirtualControlLoopNotification() {}
39
40     /**
41      * Construct an instance.
42      * 
43      * @param event the event
44      */
45     public VirtualControlLoopNotification(VirtualControlLoopEvent event) {
46         super(event);
47         if (event == null) {
48             return;
49         }
50         if (event.getAai() != null) {
51             this.setAai(new HashMap<>(event.getAai()));
52         }
53         this.closedLoopAlarmStart = event.getClosedLoopAlarmStart();
54         this.closedLoopAlarmEnd = event.getClosedLoopAlarmEnd();
55     }
56
57     public Map<String, String> getAai() {
58         return aai;
59     }
60
61     public void setAai(Map<String, String> aai) {
62         this.aai = aai;
63     }
64
65     public Instant getClosedLoopAlarmStart() {
66         return closedLoopAlarmStart;
67     }
68
69     public void setClosedLoopAlarmStart(Instant closedLoopAlarmStart) {
70         this.closedLoopAlarmStart = closedLoopAlarmStart;
71     }
72
73     public Instant getClosedLoopAlarmEnd() {
74         return closedLoopAlarmEnd;
75     }
76
77     public void setClosedLoopAlarmEnd(Instant closedLoopAlarmEnd) {
78         this.closedLoopAlarmEnd = closedLoopAlarmEnd;
79     }
80 }