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;
25 import java.io.Serializable;
26 import java.util.UUID;
28 public abstract class ControlLoopEvent implements Serializable {
30 private static final long serialVersionUID = 2391252138583119195L;
32 @SerializedName("closedLoopControlName")
33 private String closedLoopControlName;
35 @SerializedName("version")
36 private String version = "1.0.2";
38 @SerializedName("requestID")
39 private UUID requestId;
41 @SerializedName("closedLoopEventClient")
42 private String closedLoopEventClient;
44 @SerializedName("target_type")
45 private ControlLoopTargetType targetType;
47 @SerializedName("target")
48 private String target;
50 @SerializedName("from")
53 @SerializedName("policyScope")
54 private String policyScope;
56 @SerializedName("policyName")
57 private String policyName;
59 @SerializedName("policyVersion")
60 private String policyVersion;
62 @SerializedName("closedLoopEventStatus")
63 private ControlLoopEventStatus closedLoopEventStatus;
65 public ControlLoopEvent() {
70 * Construct an instace from an existing instance.
72 * @param event the existing instance
74 public ControlLoopEvent(ControlLoopEvent event) {
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;
90 public boolean isEventStatusValid() {
91 return this.closedLoopEventStatus != null;
94 public String getClosedLoopControlName() {
95 return closedLoopControlName;
98 public void setClosedLoopControlName(String closedLoopControlName) {
99 this.closedLoopControlName = closedLoopControlName;
102 public String getVersion() {
106 public void setVersion(String version) {
107 this.version = version;
110 public UUID getRequestId() {
114 public void setRequestId(UUID requestId) {
115 this.requestId = requestId;
118 public String getClosedLoopEventClient() {
119 return closedLoopEventClient;
122 public void setClosedLoopEventClient(String closedLoopEventClient) {
123 this.closedLoopEventClient = closedLoopEventClient;
126 public ControlLoopTargetType getTargetType() {
130 public void setTargetType(ControlLoopTargetType targetType) {
131 this.targetType = targetType;
134 public String getTarget() {
138 public void setTarget(String target) {
139 this.target = target;
142 public String getFrom() {
146 public void setFrom(String from) {
150 public String getPolicyScope() {
154 public void setPolicyScope(String policyScope) {
155 this.policyScope = policyScope;
158 public String getPolicyName() {
162 public void setPolicyName(String policyName) {
163 this.policyName = policyName;
166 public String getPolicyVersion() {
167 return policyVersion;
170 public void setPolicyVersion(String policyVersion) {
171 this.policyVersion = policyVersion;
174 public ControlLoopEventStatus getClosedLoopEventStatus() {
175 return closedLoopEventStatus;
178 public void setClosedLoopEventStatus(ControlLoopEventStatus closedLoopEventStatus) {
179 this.closedLoopEventStatus = closedLoopEventStatus;