2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
6 * Modifications Copyright (C) 2019 Nordix Foundation.
7 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END=========================================================
22 package org.onap.policy.controlloop;
24 import com.google.gson.annotations.SerializedName;
25 import java.io.Serializable;
26 import java.util.UUID;
32 public abstract class ControlLoopEvent implements Serializable {
34 private static final long serialVersionUID = 2391252138583119195L;
36 @SerializedName("closedLoopControlName")
37 private String closedLoopControlName;
39 @SerializedName("version")
40 private String version = "1.0.2";
42 @SerializedName("requestID")
43 private UUID requestId;
45 @SerializedName("closedLoopEventClient")
46 private String closedLoopEventClient;
48 @SerializedName("target_type")
49 private String targetType;
51 @SerializedName("target")
52 private String target;
54 @SerializedName("from")
57 @SerializedName("policyScope")
58 private String policyScope;
60 @SerializedName("policyName")
61 private String policyName;
63 @SerializedName("policyVersion")
64 private String policyVersion;
66 @SerializedName("closedLoopEventStatus")
67 private ControlLoopEventStatus closedLoopEventStatus;
69 public ControlLoopEvent() {
74 * Construct an instace from an existing instance.
76 * @param event the existing instance
78 public ControlLoopEvent(ControlLoopEvent event) {
82 this.closedLoopControlName = event.closedLoopControlName;
83 this.requestId = event.requestId;
84 this.closedLoopEventClient = event.closedLoopEventClient;
85 this.targetType = event.targetType;
86 this.target = event.target;
87 this.from = event.from;
88 this.policyScope = event.policyScope;
89 this.policyName = event.policyName;
90 this.policyVersion = event.policyVersion;
91 this.closedLoopEventStatus = event.closedLoopEventStatus;
94 public boolean isEventStatusValid() {
95 return this.closedLoopEventStatus != null;