X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=models-interactions%2Fmodel-impl%2Fevents%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fcontrolloop%2FControlLoopEvent.java;h=3106e3909da94690b449e51674c20836fc908fcd;hb=08d766437dc19037f21b57578448748e013bc031;hp=43cd640c0d01ac670086dc90be4efad0af017544;hpb=8c57c0f7d3a17bdbdc9b21f5f0d778a299a31df7;p=policy%2Fmodels.git diff --git a/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopEvent.java b/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopEvent.java index 43cd640c0..3106e3909 100644 --- a/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopEvent.java +++ b/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopEvent.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * controlloop * ================================================================================ - * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved. * Modifications Copyright (C) 2019 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -23,54 +23,34 @@ package org.onap.policy.controlloop; import com.google.gson.annotations.SerializedName; import java.io.Serializable; +import java.util.Map; import java.util.UUID; +import lombok.Data; +import lombok.NoArgsConstructor; +@Data +@NoArgsConstructor public abstract class ControlLoopEvent implements Serializable { private static final long serialVersionUID = 2391252138583119195L; - - @SerializedName("closedLoopControlName") - private String closedLoopControlName; - - @SerializedName("version") - private String version = "1.0.2"; - + @SerializedName("requestID") - private UUID requestId; - - @SerializedName("closedLoopEventClient") - private String closedLoopEventClient; - + protected UUID requestId; @SerializedName("target_type") - private ControlLoopTargetType targetType; - - @SerializedName("target") - private String target; - - @SerializedName("from") - private String from; - - @SerializedName("policyScope") - private String policyScope; - - @SerializedName("policyName") - private String policyName; - - @SerializedName("policyVersion") - private String policyVersion; - - @SerializedName("closedLoopEventStatus") - private ControlLoopEventStatus closedLoopEventStatus; - - @SerializedName("payload") - private String payload; - - public ControlLoopEvent() { - - } + protected String targetType; + protected String closedLoopControlName; + protected String version = "1.0.2"; + protected String closedLoopEventClient; + protected String target; + protected String from; + protected String policyScope; + protected String policyName; + protected String policyVersion; + protected ControlLoopEventStatus closedLoopEventStatus; + protected Map additionalEventParams; /** - * Construct an instace from an existing instance. + * Construct an instance from an existing instance. * * @param event the existing instance */ @@ -78,6 +58,7 @@ public abstract class ControlLoopEvent implements Serializable { if (event == null) { return; } + this.version = event.version; this.closedLoopControlName = event.closedLoopControlName; this.requestId = event.requestId; this.closedLoopEventClient = event.closedLoopEventClient; @@ -88,106 +69,10 @@ public abstract class ControlLoopEvent implements Serializable { this.policyName = event.policyName; this.policyVersion = event.policyVersion; this.closedLoopEventStatus = event.closedLoopEventStatus; - this.payload = event.payload; + this.additionalEventParams = event.additionalEventParams; } public boolean isEventStatusValid() { return this.closedLoopEventStatus != null; } - - public String getClosedLoopControlName() { - return closedLoopControlName; - } - - public void setClosedLoopControlName(String closedLoopControlName) { - this.closedLoopControlName = closedLoopControlName; - } - - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } - - public UUID getRequestId() { - return requestId; - } - - public void setRequestId(UUID requestId) { - this.requestId = requestId; - } - - public String getClosedLoopEventClient() { - return closedLoopEventClient; - } - - public void setClosedLoopEventClient(String closedLoopEventClient) { - this.closedLoopEventClient = closedLoopEventClient; - } - - public ControlLoopTargetType getTargetType() { - return targetType; - } - - public void setTargetType(ControlLoopTargetType targetType) { - this.targetType = targetType; - } - - public String getTarget() { - return target; - } - - public void setTarget(String target) { - this.target = target; - } - - public String getFrom() { - return from; - } - - public void setFrom(String from) { - this.from = from; - } - - public String getPolicyScope() { - return policyScope; - } - - public void setPolicyScope(String policyScope) { - this.policyScope = policyScope; - } - - public String getPolicyName() { - return policyName; - } - - public void setPolicyName(String policyName) { - this.policyName = policyName; - } - - public String getPolicyVersion() { - return policyVersion; - } - - public void setPolicyVersion(String policyVersion) { - this.policyVersion = policyVersion; - } - - public ControlLoopEventStatus getClosedLoopEventStatus() { - return closedLoopEventStatus; - } - - public void setClosedLoopEventStatus(ControlLoopEventStatus closedLoopEventStatus) { - this.closedLoopEventStatus = closedLoopEventStatus; - } - - public String getPayload() { - return payload; - } - - public void setPayload(String payload) { - this.payload = payload; - } }