2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.onap.policy.controlloop;
23 import com.google.gson.annotations.SerializedName;
24 import java.io.Serializable;
25 import java.util.UUID;
27 public abstract class ControlLoopEvent implements Serializable {
29 private static final long serialVersionUID = 2391252138583119195L;
31 @SerializedName("closedLoopControlName")
32 private String closedLoopControlName;
34 @SerializedName("version")
35 private String version = "1.0.2";
37 @SerializedName("requestID")
38 private UUID requestId;
40 @SerializedName("closedLoopEventClient")
41 private String closedLoopEventClient;
43 @SerializedName("target_type")
44 private ControlLoopTargetType targetType;
46 @SerializedName("target")
47 private String target;
49 @SerializedName("from")
52 @SerializedName("policyScope")
53 private String policyScope;
55 @SerializedName("policyName")
56 private String policyName;
58 @SerializedName("policyVersion")
59 private String policyVersion;
61 @SerializedName("closedLoopEventStatus")
62 private ControlLoopEventStatus closedLoopEventStatus;
64 @SerializedName("payload")
65 private String payload;
67 public ControlLoopEvent() {
72 * Construct an instace from an existing instance.
74 * @param event the existing instance
76 public ControlLoopEvent(ControlLoopEvent event) {
80 this.closedLoopControlName = event.closedLoopControlName;
81 this.requestId = event.requestId;
82 this.closedLoopEventClient = event.closedLoopEventClient;
83 this.targetType = event.targetType;
84 this.target = event.target;
85 this.from = event.from;
86 this.policyScope = event.policyScope;
87 this.policyName = event.policyName;
88 this.policyVersion = event.policyVersion;
89 this.closedLoopEventStatus = event.closedLoopEventStatus;
90 this.payload = event.payload;
93 public boolean isEventStatusValid() {
94 return this.closedLoopEventStatus != null;
97 public String getClosedLoopControlName() {
98 return closedLoopControlName;
101 public void setClosedLoopControlName(String closedLoopControlName) {
102 this.closedLoopControlName = closedLoopControlName;
105 public String getVersion() {
109 public void setVersion(String version) {
110 this.version = version;
113 public UUID getRequestId() {
117 public void setRequestId(UUID requestId) {
118 this.requestId = requestId;
121 public String getClosedLoopEventClient() {
122 return closedLoopEventClient;
125 public void setClosedLoopEventClient(String closedLoopEventClient) {
126 this.closedLoopEventClient = closedLoopEventClient;
129 public ControlLoopTargetType getTargetType() {
133 public void setTargetType(ControlLoopTargetType targetType) {
134 this.targetType = targetType;
137 public String getTarget() {
141 public void setTarget(String target) {
142 this.target = target;
145 public String getFrom() {
149 public void setFrom(String from) {
153 public String getPolicyScope() {
157 public void setPolicyScope(String policyScope) {
158 this.policyScope = policyScope;
161 public String getPolicyName() {
165 public void setPolicyName(String policyName) {
166 this.policyName = policyName;
169 public String getPolicyVersion() {
170 return policyVersion;
173 public void setPolicyVersion(String policyVersion) {
174 this.policyVersion = policyVersion;
177 public ControlLoopEventStatus getClosedLoopEventStatus() {
178 return closedLoopEventStatus;
181 public void setClosedLoopEventStatus(ControlLoopEventStatus closedLoopEventStatus) {
182 this.closedLoopEventStatus = closedLoopEventStatus;
185 public String getPayload() {
189 public void setPayload(String payload) {
190 this.payload = payload;