eab04e22ece67f336f477a9a596039e90adc94be
[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.io.Serializable;
26 import java.util.UUID;
27
28 public abstract class ControlLoopEvent implements Serializable {
29
30     private static final long serialVersionUID = 2391252138583119195L;
31     
32     @SerializedName("closedLoopControlName")
33     private String closedLoopControlName;
34     
35     @SerializedName("version")
36     private String version = "1.0.2";
37     
38     @SerializedName("requestID")
39     private UUID requestId;
40     
41     @SerializedName("closedLoopEventClient")
42     private String closedLoopEventClient;
43     
44     @SerializedName("target_type")
45     private ControlLoopTargetType targetType;
46     
47     @SerializedName("target")
48     private String target;
49     
50     @SerializedName("from")
51     private String from;
52     
53     @SerializedName("policyScope")
54     private String policyScope;
55     
56     @SerializedName("policyName")
57     private String policyName;
58     
59     @SerializedName("policyVersion")
60     private String policyVersion;
61     
62     @SerializedName("closedLoopEventStatus")
63     private ControlLoopEventStatus closedLoopEventStatus;
64
65     public ControlLoopEvent() {
66
67     }
68
69     /**
70      * Construct an instace from an existing instance.
71      * 
72      * @param event the existing instance
73      */
74     public ControlLoopEvent(ControlLoopEvent event) {
75         if (event == null) {
76             return;
77         }
78         this.closedLoopControlName = event.closedLoopControlName;
79         this.requestId = event.requestId;
80         this.closedLoopEventClient = event.closedLoopEventClient;
81         this.targetType = event.targetType;
82         this.target = event.target;
83         this.from = event.from;
84         this.policyScope = event.policyScope;
85         this.policyName = event.policyName;
86         this.policyVersion = event.policyVersion;
87         this.closedLoopEventStatus = event.closedLoopEventStatus;
88     }
89
90     public boolean isEventStatusValid() {
91         return this.closedLoopEventStatus != null;
92     }
93
94     public String getClosedLoopControlName() {
95         return closedLoopControlName;
96     }
97
98     public void setClosedLoopControlName(String closedLoopControlName) {
99         this.closedLoopControlName = closedLoopControlName;
100     }
101
102     public String getVersion() {
103         return version;
104     }
105
106     public void setVersion(String version) {
107         this.version = version;
108     }
109
110     public UUID getRequestId() {
111         return requestId;
112     }
113
114     public void setRequestId(UUID requestId) {
115         this.requestId = requestId;
116     }
117
118     public String getClosedLoopEventClient() {
119         return closedLoopEventClient;
120     }
121
122     public void setClosedLoopEventClient(String closedLoopEventClient) {
123         this.closedLoopEventClient = closedLoopEventClient;
124     }
125
126     public ControlLoopTargetType getTargetType() {
127         return targetType;
128     }
129
130     public void setTargetType(ControlLoopTargetType targetType) {
131         this.targetType = targetType;
132     }
133
134     public String getTarget() {
135         return target;
136     }
137
138     public void setTarget(String target) {
139         this.target = target;
140     }
141
142     public String getFrom() {
143         return from;
144     }
145
146     public void setFrom(String from) {
147         this.from = from;
148     }
149
150     public String getPolicyScope() {
151         return policyScope;
152     }
153
154     public void setPolicyScope(String policyScope) {
155         this.policyScope = policyScope;
156     }
157
158     public String getPolicyName() {
159         return policyName;
160     }
161
162     public void setPolicyName(String policyName) {
163         this.policyName = policyName;
164     }
165
166     public String getPolicyVersion() {
167         return policyVersion;
168     }
169
170     public void setPolicyVersion(String policyVersion) {
171         this.policyVersion = policyVersion;
172     }
173
174     public ControlLoopEventStatus getClosedLoopEventStatus() {
175         return closedLoopEventStatus;
176     }
177
178     public void setClosedLoopEventStatus(ControlLoopEventStatus closedLoopEventStatus) {
179         this.closedLoopEventStatus = closedLoopEventStatus;
180     }
181 }