aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorSébastien Determe <sebastien.determe@intl.att.com>2019-03-10 18:42:17 +0000
committerGerrit Code Review <gerrit@onap.org>2019-03-10 18:42:17 +0000
commit60e5cc9c7768ddda104069f7773fb636f77587e8 (patch)
tree11b1ac715d7573b358176eeacff88151b450ea75 /src/main/java
parent93cf55254a9ee5f3cbab6bcc6ff3c2ef0c2e379b (diff)
parent8a27271dd4555f18f53a43038ba760c0250b7e8b (diff)
Merge "New endpoint"
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/onap/clamp/loop/LoopController.java8
-rw-r--r--src/main/java/org/onap/clamp/loop/LoopService.java2
-rw-r--r--src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicy.java7
3 files changed, 12 insertions, 5 deletions
diff --git a/src/main/java/org/onap/clamp/loop/LoopController.java b/src/main/java/org/onap/clamp/loop/LoopController.java
index eeb6105b1..7e4517492 100644
--- a/src/main/java/org/onap/clamp/loop/LoopController.java
+++ b/src/main/java/org/onap/clamp/loop/LoopController.java
@@ -25,15 +25,16 @@ package org.onap.clamp.loop;
import com.google.gson.JsonArray;
import com.google.gson.reflect.TypeToken;
+
import java.lang.reflect.Type;
import java.util.List;
+
import org.onap.clamp.clds.util.JsonUtils;
import org.onap.clamp.policy.microservice.MicroServicePolicy;
import org.onap.clamp.policy.operational.OperationalPolicy;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
-
@Controller
public class LoopController {
@@ -67,4 +68,9 @@ public class LoopController {
.fromJson(microServicePoliciesJson, MICROSERVICE_POLICY_TYPE);
return loopService.updateMicroservicePolicies(loopName, microservicePolicies);
}
+
+ public String getSVGRepresentation(String loopName) {
+ return loopService.getClosedLoopModelSVG(loopName);
+
+ }
}
diff --git a/src/main/java/org/onap/clamp/loop/LoopService.java b/src/main/java/org/onap/clamp/loop/LoopService.java
index 7b79c112e..91b4bdf89 100644
--- a/src/main/java/org/onap/clamp/loop/LoopService.java
+++ b/src/main/java/org/onap/clamp/loop/LoopService.java
@@ -47,7 +47,7 @@ public class LoopService {
this.operationalPolicyService = operationalPolicyService;
}
- Loop addNewLoop(Loop loop) {
+ Loop saveOrUpdateLoop(Loop loop) {
return loopsRepository.save(loop);
}
diff --git a/src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicy.java b/src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicy.java
index e5b333dbb..7ebe0edb2 100644
--- a/src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicy.java
+++ b/src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicy.java
@@ -39,9 +39,9 @@ import javax.persistence.Table;
import org.hibernate.annotations.Type;
import org.hibernate.annotations.TypeDef;
import org.hibernate.annotations.TypeDefs;
+import org.onap.clamp.dao.model.jsontype.StringJsonUserType;
import org.onap.clamp.loop.Loop;
import org.onap.clamp.policy.Policy;
-import org.onap.clamp.dao.model.jsontype.StringJsonUserType;
@Entity
@Table(name = "micro_service_policies")
@@ -66,7 +66,6 @@ public class MicroServicePolicy implements Serializable, Policy {
@Column(name = "shared", nullable = false)
private Boolean shared;
- @Expose
@Column(name = "policy_tosca", nullable = false)
private String policyTosca;
@@ -79,7 +78,7 @@ public class MicroServicePolicy implements Serializable, Policy {
private Set<Loop> usedByLoops = new HashSet<>();
public MicroServicePolicy() {
- //serialization
+ // serialization
}
public MicroServicePolicy(String name, String policyTosca, Boolean shared, JsonObject jsonRepresentation,
@@ -91,6 +90,7 @@ public class MicroServicePolicy implements Serializable, Policy {
this.usedByLoops = usedByLoops;
}
+ @Override
public String getName() {
return name;
}
@@ -119,6 +119,7 @@ public class MicroServicePolicy implements Serializable, Policy {
this.policyTosca = policyTosca;
}
+ @Override
public JsonObject getJsonRepresentation() {
return jsonRepresentation;
}