Merge "Add debugging of REST call"
[policy/drools-applications.git] / controlloop / common / model-impl / events / src / main / java / org / onap / policy / controlloop / ControlLoopEvent.java
index 1d85ccb..944bef7 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * controlloop
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 
 package org.onap.policy.controlloop;
 
+import com.google.gson.annotations.SerializedName;
 import java.io.Serializable;
 import java.util.UUID;
 
 public abstract class ControlLoopEvent implements Serializable {
-       
-       private static final long serialVersionUID = 2391252138583119195L;
-       
-       private String closedLoopControlName;
-       private String version = "1.0.2";
-       private UUID requestID;
-       private String closedLoopEventClient;
-       private ControlLoopTargetType targetType;
-       private String target;
-       private String from;
-       private String policyScope;
-       private String policyName;
-       private String policyVersion;
-       private ControlLoopEventStatus closedLoopEventStatus;
-       
-       public ControlLoopEvent() {
-               
-       }
-       
-       public ControlLoopEvent(ControlLoopEvent event) {
-               if (event == null) {
-                       return;
-               }
-               this.closedLoopControlName = event.closedLoopControlName;
-               this.requestID = event.requestID;
-               this.closedLoopEventClient = event.closedLoopEventClient;
-               this.targetType = event.targetType;
-               this.target = event.target;
-               this.from = event.from;
-               this.policyScope = event.policyScope;
-               this.policyName = event.policyName;
-               this.policyVersion = event.policyVersion;
-               this.closedLoopEventStatus = event.closedLoopEventStatus;
-       }
-
-       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;
-       }
+
+    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;
+    
+    @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() {
+
+    }
+
+    /**
+     * Construct an instace from an existing instance.
+     * 
+     * @param event the existing instance
+     */
+    public ControlLoopEvent(ControlLoopEvent event) {
+        if (event == null) {
+            return;
+        }
+        this.closedLoopControlName = event.closedLoopControlName;
+        this.requestId = event.requestId;
+        this.closedLoopEventClient = event.closedLoopEventClient;
+        this.targetType = event.targetType;
+        this.target = event.target;
+        this.from = event.from;
+        this.policyScope = event.policyScope;
+        this.policyName = event.policyName;
+        this.policyVersion = event.policyVersion;
+        this.closedLoopEventStatus = event.closedLoopEventStatus;
+        this.payload = event.payload;
+    }
+
+    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;
+    }
 }