aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/org
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org')
-rw-r--r--src/main/java/org/onap/clamp/clds/config/CamelConfiguration.java6
-rw-r--r--src/main/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintParser.java2
-rw-r--r--src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java14
3 files changed, 16 insertions, 6 deletions
diff --git a/src/main/java/org/onap/clamp/clds/config/CamelConfiguration.java b/src/main/java/org/onap/clamp/clds/config/CamelConfiguration.java
index f10565049..c3b24bc81 100644
--- a/src/main/java/org/onap/clamp/clds/config/CamelConfiguration.java
+++ b/src/main/java/org/onap/clamp/clds/config/CamelConfiguration.java
@@ -21,14 +21,19 @@
*/
package org.onap.clamp.clds.config;
+import org.apache.camel.CamelContext;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.model.rest.RestBindingMode;
import org.onap.clamp.clds.util.ClampVersioning;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class CamelConfiguration extends RouteBuilder {
+ @Autowired
+ CamelContext camelContext;
+
@Override
public void configure() {
restConfiguration().component("servlet").bindingMode(RestBindingMode.json).jsonDataFormat("json-gson")
@@ -38,5 +43,6 @@ public class CamelConfiguration extends RouteBuilder {
.apiProperty("api.version", ClampVersioning.getCldsVersionFromProps())
.apiProperty("base.path", "/restservices/clds/");
// .apiProperty("cors", "true");
+ camelContext.setTracing(true);
}
}
diff --git a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintParser.java b/src/main/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintParser.java
index 93374fe11..5a8ccca91 100644
--- a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintParser.java
+++ b/src/main/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintParser.java
@@ -88,7 +88,7 @@ public class BlueprintParser {
}
String msName = theBiggestMicroServiceKey.toLowerCase().contains(HOLMES_PREFIX) ? HOLMES : TCA;
return Collections
- .singletonList(new MicroService(msName, "onap.policy.monitoring.cdap.tca.hi.lo.ap", "", "", ""));
+ .singletonList(new MicroService(msName, "onap.policy.monitoring.cdap.tca.hi.lo.app", "", "", ""));
}
String getName(Entry<String, JsonElement> entry) {
diff --git a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java b/src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java
index b6b591db2..1859a4d6e 100644
--- a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java
+++ b/src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java
@@ -31,8 +31,7 @@ import com.google.gson.JsonObject;
import com.google.gson.annotations.Expose;
import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
+import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
@@ -182,15 +181,20 @@ public class OperationalPolicy implements Serializable, Policy {
return (new Yaml()).dump(jsonMap);
}
- public List<String> createGuardPolicyPayloads() {
- List<String> result = new ArrayList<>();
+ /**
+ * Return a map containing all Guard policies indexed by Guard policy Name.
+ *
+ * @return The Guards map
+ */
+ public Map<String, String> createGuardPolicyPayloads() {
+ Map<String, String> result = new HashMap<>();
JsonObject guard = new JsonObject();
JsonElement guardsList = this.getConfigurationsJson().get("guard_policies");
for (Entry<String, JsonElement> guardElem : guardsList.getAsJsonObject().entrySet()) {
guard.addProperty("policy-id", guardElem.getKey());
guard.add("contents", guardElem.getValue());
- result.add(new GsonBuilder().create().toJson(guard));
+ result.put(guardElem.getKey(), new GsonBuilder().create().toJson(guard));
}
return result;
}