Add a new entity for message publishing 49/7549/2
authorGuangrong Fu <fu.guangrong@zte.com.cn>
Tue, 15 Aug 2017 05:52:30 +0000 (13:52 +0800)
committerGuangrong Fu <fu.guangrong@zte.com.cn>
Tue, 15 Aug 2017 06:07:59 +0000 (14:07 +0800)
Add a new message entity.

Change-Id: Idb2723b9a8de860fd00b04e9501a9b42483e312f
Issue-ID: HOLMES-30
Signed-off-by: Guangrong Fu <fu.guangrong@zte.com.cn>
holmes-actions/src/main/java/org/onap/holmes/common/dmaap/entity/PolicyMsg.java [new file with mode: 0644]

diff --git a/holmes-actions/src/main/java/org/onap/holmes/common/dmaap/entity/PolicyMsg.java b/holmes-actions/src/main/java/org/onap/holmes/common/dmaap/entity/PolicyMsg.java
new file mode 100644 (file)
index 0000000..0c3078b
--- /dev/null
@@ -0,0 +1,53 @@
+/*\r
+ * Copyright 2017 ZTE Corporation.\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+package org.onap.holmes.common.dmaap.entity;\r
+\r
+import com.fasterxml.jackson.annotation.JsonProperty;\r
+import java.util.HashMap;\r
+import java.util.Map;\r
+import lombok.Getter;\r
+import lombok.Setter;\r
+\r
+@Getter\r
+@Setter\r
+public class PolicyMsg {\r
+\r
+    private String version = "1.0.2";\r
+    private String closedLoopControlName;\r
+    private String requestID;\r
+    private EVENT_STATUS closedLoopEventStatus = EVENT_STATUS.ONSET;\r
+    private long closedLoopAlarmStart;\r
+    private long closedLoopAlarmEnd;\r
+    private String closedLoopEventClient;\r
+    private String policyVersion;\r
+    private String policyName;\r
+    private String policyScope;\r
+    private String from = "HOLMES";\r
+    @JsonProperty(value = "target_type")\r
+    private String targetType = "VM";\r
+    private String target;\r
+    private Map<String, String> aai = new HashMap<>();\r
+\r
+    public static enum EVENT_STATUS {\r
+        ONSET, ABATED;\r
+\r
+        @Override\r
+        public String toString(){\r
+            return this.name();\r
+        }\r
+    }\r
+}\r