d3f1786c73b2ce13a8ba13c82ad632b38bf8f4a1
[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 java.io.Serializable;
24 import java.util.UUID;
25
26 public abstract class ControlLoopEvent implements Serializable {
27
28     private static final long serialVersionUID = 2391252138583119195L;
29
30     private String closedLoopControlName;
31     private String version = "1.0.2";
32     private UUID requestId;
33     private String closedLoopEventClient;
34     private ControlLoopTargetType targetType;
35     private String target;
36     private String from;
37     private String policyScope;
38     private String policyName;
39     private String policyVersion;
40     private ControlLoopEventStatus closedLoopEventStatus;
41
42     public ControlLoopEvent() {
43
44     }
45
46     /**
47      * Construct an instace from an existing instance.
48      * 
49      * @param event the existing instance
50      */
51     public ControlLoopEvent(ControlLoopEvent event) {
52         if (event == null) {
53             return;
54         }
55         this.closedLoopControlName = event.closedLoopControlName;
56         this.requestId = event.requestId;
57         this.closedLoopEventClient = event.closedLoopEventClient;
58         this.targetType = event.targetType;
59         this.target = event.target;
60         this.from = event.from;
61         this.policyScope = event.policyScope;
62         this.policyName = event.policyName;
63         this.policyVersion = event.policyVersion;
64         this.closedLoopEventStatus = event.closedLoopEventStatus;
65     }
66
67     public boolean isEventStatusValid() {
68         return this.closedLoopEventStatus != null;
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 ControlLoopEventStatus getClosedLoopEventStatus() {
152         return closedLoopEventStatus;
153     }
154
155     public void setClosedLoopEventStatus(ControlLoopEventStatus closedLoopEventStatus) {
156         this.closedLoopEventStatus = closedLoopEventStatus;
157     }
158 }