X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fonap%2Fclamp%2Floop%2FLoopController.java;h=b862780de268f290ec2f479bede25c0b0a528cd1;hb=0cb57989949080d6cc3853c432a233605c321388;hp=a02fa9333a624d1033c8f98ad09d4ae2f8bc70e5;hpb=3772c8513f618f9b76fc7bfa55fa140eb60f2a4b;p=clamp.git diff --git a/src/main/java/org/onap/clamp/loop/LoopController.java b/src/main/java/org/onap/clamp/loop/LoopController.java index a02fa933..b862780d 100644 --- a/src/main/java/org/onap/clamp/loop/LoopController.java +++ b/src/main/java/org/onap/clamp/loop/LoopController.java @@ -24,7 +24,6 @@ package org.onap.clamp.loop; import com.google.gson.JsonArray; -import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.reflect.TypeToken; @@ -42,9 +41,9 @@ public class LoopController { private final LoopService loopService; private static final Type OPERATIONAL_POLICY_TYPE = new TypeToken>() { - }.getType(); + }.getType(); private static final Type MICROSERVICE_POLICY_TYPE = new TypeToken>() { - }.getType(); + }.getType(); @Autowired public LoopController(LoopService loopService) { @@ -61,32 +60,41 @@ public class LoopController { /** * Update the Operational Policy properties. - * @param loopName The loop name - * @param operationalPoliciesJson The new Operational Policy properties + * + * @param loopName + * The loop name + * @param operationalPoliciesJson + * The new Operational Policy properties * @return The updated loop */ public Loop updateOperationalPolicies(String loopName, JsonArray operationalPoliciesJson) { - List operationalPolicies = JsonUtils.GSON - .fromJson(operationalPoliciesJson, OPERATIONAL_POLICY_TYPE); + List operationalPolicies = JsonUtils.GSON.fromJson(operationalPoliciesJson, + OPERATIONAL_POLICY_TYPE); return loopService.updateAndSaveOperationalPolicies(loopName, operationalPolicies); } /** * Update the whole array of MicroService policies properties - * @param loopName The loop name - * @param microServicePoliciesJson The array of all MicroService policies properties + * + * @param loopName + * The loop name + * @param microServicePoliciesJson + * The array of all MicroService policies properties * @return The updated loop */ public Loop updateMicroservicePolicies(String loopName, JsonArray microServicePoliciesJson) { - List microservicePolicies = JsonUtils.GSON - .fromJson(microServicePoliciesJson, MICROSERVICE_POLICY_TYPE); + List microservicePolicies = JsonUtils.GSON.fromJson(microServicePoliciesJson, + MICROSERVICE_POLICY_TYPE); return loopService.updateAndSaveMicroservicePolicies(loopName, microservicePolicies); } /** * Update the global properties - * @param loopName The loop name - * @param globalProperties The updated global properties + * + * @param loopName + * The loop name + * @param globalProperties + * The updated global properties * @return The updated loop */ public Loop updateGlobalPropertiesJson(String loopName, JsonObject globalProperties) { @@ -95,8 +103,11 @@ public class LoopController { /** * Update one MicroService policy properties - * @param loopName The loop name - * @param newMicroservicePolicy The new MicroService policy properties + * + * @param loopName + * The loop name + * @param newMicroservicePolicy + * The new MicroService policy properties * @return The updated MicroService policy */ public MicroServicePolicy updateMicroservicePolicy(String loopName, MicroServicePolicy newMicroservicePolicy) { @@ -105,11 +116,12 @@ public class LoopController { /** * Get the SVG representation of the loop - * @param loopName The loop name + * + * @param loopName + * The loop name * @return The SVG representation */ public String getSVGRepresentation(String loopName) { - return loopService.getClosedLoopModelSVG(loopName); - + return loopService.getLoop(loopName).getSvgRepresentation(); } }