summaryrefslogtreecommitdiffstats
path: root/holmes-actions/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'holmes-actions/src/main')
-rw-r--r--holmes-actions/src/main/java/org/onap/holmes/common/config/MQConfig.java11
-rw-r--r--holmes-actions/src/main/java/org/onap/holmes/common/dmaap/entity/PolicyMsg.java6
-rw-r--r--holmes-actions/src/main/java/org/onap/holmes/common/utils/JacksonUtil.java40
3 files changed, 3 insertions, 54 deletions
diff --git a/holmes-actions/src/main/java/org/onap/holmes/common/config/MQConfig.java b/holmes-actions/src/main/java/org/onap/holmes/common/config/MQConfig.java
index e1b333b..2ade152 100644
--- a/holmes-actions/src/main/java/org/onap/holmes/common/config/MQConfig.java
+++ b/holmes-actions/src/main/java/org/onap/holmes/common/config/MQConfig.java
@@ -16,24 +16,13 @@
package org.onap.holmes.common.config;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import java.util.HashMap;
-import java.util.Map;
-import javax.validation.constraints.NotNull;
-
public class MQConfig {
- @JsonProperty
- @NotNull
public String brokerIp;
- @JsonProperty
- @NotNull
public int brokerPort;
- @JsonProperty
public String brokerUsername;
- @JsonProperty
public String brokerPassword;
}
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
index 6955d90..6c3189c 100644
--- 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
@@ -16,7 +16,7 @@
package org.onap.holmes.common.dmaap.entity;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.gson.annotations.SerializedName;
import java.util.HashMap;
import java.util.Map;
import lombok.Getter;
@@ -37,10 +37,10 @@ public class PolicyMsg {
private String policyName;
private String policyScope;
private String from = "DCAE";
- @JsonProperty(value = "target_type")
+ @SerializedName(value = "target_type")
private String targetType = "VM";
private String target;
- @JsonProperty(value = "AAI")
+ @SerializedName(value = "AAI")
private Map<String, Object> aai = new HashMap<>();
public static enum EVENT_STATUS {
diff --git a/holmes-actions/src/main/java/org/onap/holmes/common/utils/JacksonUtil.java b/holmes-actions/src/main/java/org/onap/holmes/common/utils/JacksonUtil.java
deleted file mode 100644
index c5c52c2..0000000
--- a/holmes-actions/src/main/java/org/onap/holmes/common/utils/JacksonUtil.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * Copyright 2017 ZTE Corporation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onap.holmes.common.utils;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import java.io.IOException;
-
-public class JacksonUtil {
-
- private JacksonUtil() {
-
- }
-
- public static String beanToJson(Object obj) throws JsonProcessingException {
- ObjectMapper objectMapper = new ObjectMapper();
- return objectMapper.writeValueAsString(obj);
- }
-
- public static <T> T jsonToBean(String json, Class<T> cls) throws IOException {
- ObjectMapper objectMapper = new ObjectMapper();
- if (json == null) {
- return objectMapper.readValue("{}", cls);
- }
- return objectMapper.readValue(json, cls);
- }
-}