2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017-2020 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;
27 import java.util.UUID;
29 import lombok.NoArgsConstructor;
33 public abstract class ControlLoopEvent implements Serializable {
35 private static final long serialVersionUID = 2391252138583119195L;
37 @SerializedName("requestID")
38 protected UUID requestId;
39 @SerializedName("target_type")
40 protected String targetType;
41 protected String closedLoopControlName;
42 protected String version = "1.0.2";
43 protected String closedLoopEventClient;
44 protected String target;
45 protected String from;
46 protected String policyScope;
47 protected String policyName;
48 protected String policyVersion;
49 protected ControlLoopEventStatus closedLoopEventStatus;
50 protected Map<String, String> additionalEventParams;
53 * Construct an instance from an existing instance.
55 * @param event the existing instance
57 public ControlLoopEvent(ControlLoopEvent event) {
61 this.version = event.version;
62 this.closedLoopControlName = event.closedLoopControlName;
63 this.requestId = event.requestId;
64 this.closedLoopEventClient = event.closedLoopEventClient;
65 this.targetType = event.targetType;
66 this.target = event.target;
67 this.from = event.from;
68 this.policyScope = event.policyScope;
69 this.policyName = event.policyName;
70 this.policyVersion = event.policyVersion;
71 this.closedLoopEventStatus = event.closedLoopEventStatus;
72 this.additionalEventParams = event.additionalEventParams;
75 public boolean isEventStatusValid() {
76 return this.closedLoopEventStatus != null;