From f2d71ebde9dcd13d3181ba343ad82e728b30bf73 Mon Sep 17 00:00:00 2001 From: sebdet Date: Thu, 30 Jan 2020 16:37:27 +0100 Subject: Remove blueprintId in loop Remove the blueprint Id for DCAE in loop object as now the one in loop template will be used. Issue-ID: CLAMP-592 Change-Id: Ie86f362451d58de07f7a715ae0bfc92566893e13 Signed-off-by: sebdet --- src/main/java/org/onap/clamp/loop/Loop.java | 12 ------------ .../onap/clamp/loop/components/external/DcaeComponent.java | 12 +++++++----- 2 files changed, 7 insertions(+), 17 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/org/onap/clamp/loop/Loop.java b/src/main/java/org/onap/clamp/loop/Loop.java index 66fd56579..339812672 100644 --- a/src/main/java/org/onap/clamp/loop/Loop.java +++ b/src/main/java/org/onap/clamp/loop/Loop.java @@ -92,10 +92,6 @@ public class Loop extends AuditEntity implements Serializable { @Column(name = "dcae_deployment_status_url") private String dcaeDeploymentStatusUrl; - @Expose - @Column(name = "dcae_blueprint_id") - private String dcaeBlueprintId; - @Column(columnDefinition = "MEDIUMTEXT", name = "svg_representation") private String svgRepresentation; @@ -248,14 +244,6 @@ public class Loop extends AuditEntity implements Serializable { this.loopLogs.add(log); } - public String getDcaeBlueprintId() { - return dcaeBlueprintId; - } - - void setDcaeBlueprintId(String dcaeBlueprintId) { - this.dcaeBlueprintId = dcaeBlueprintId; - } - public Service getModelService() { return modelService; } diff --git a/src/main/java/org/onap/clamp/loop/components/external/DcaeComponent.java b/src/main/java/org/onap/clamp/loop/components/external/DcaeComponent.java index acb7190f7..21960e387 100644 --- a/src/main/java/org/onap/clamp/loop/components/external/DcaeComponent.java +++ b/src/main/java/org/onap/clamp/loop/components/external/DcaeComponent.java @@ -24,16 +24,17 @@ package org.onap.clamp.loop.components.external; import com.google.gson.JsonObject; + import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.UUID; + import org.apache.camel.Exchange; import org.json.simple.JSONArray; import org.json.simple.JSONObject; import org.json.simple.parser.JSONParser; import org.json.simple.parser.ParseException; - import org.onap.clamp.clds.model.dcae.DcaeInventoryResponse; import org.onap.clamp.clds.model.dcae.DcaeOperationStatusResponse; import org.onap.clamp.clds.util.JsonUtils; @@ -92,6 +93,7 @@ public class DcaeComponent extends ExternalComponent { return null; } } + /** * Generate the deployment id, it's random. * @@ -122,7 +124,7 @@ public class DcaeComponent extends ExternalComponent { JsonObject globalProp = loop.getGlobalPropertiesJson(); JsonObject deploymentProp = globalProp.getAsJsonObject(DEPLOYMENT_PARAMETER); - String serviceTypeId = loop.getDcaeBlueprintId(); + String serviceTypeId = loop.getLoopTemplate().getDcaeBlueprintId(); JsonObject rootObject = new JsonObject(); rootObject.addProperty(DCAE_SERVICETYPE_ID, serviceTypeId); @@ -135,7 +137,7 @@ public class DcaeComponent extends ExternalComponent { /** * Return the deploy payload for DCAE. * - * @param loop The loop object + * @param loop The loop object * @param microServiceName The micro service name * @return The payload used to send deploy closed loop request */ @@ -143,7 +145,7 @@ public class DcaeComponent extends ExternalComponent { JsonObject globalProp = loop.getGlobalPropertiesJson(); JsonObject deploymentProp = globalProp.getAsJsonObject(DEPLOYMENT_PARAMETER).getAsJsonObject(microServiceName); - String serviceTypeId = loop.getDcaeBlueprintId(); + String serviceTypeId = loop.getLoopTemplate().getDcaeBlueprintId(); JsonObject rootObject = new JsonObject(); rootObject.addProperty(DCAE_SERVICETYPE_ID, serviceTypeId); @@ -161,7 +163,7 @@ public class DcaeComponent extends ExternalComponent { */ public static String getUndeployPayload(Loop loop) { JsonObject rootObject = new JsonObject(); - rootObject.addProperty(DCAE_SERVICETYPE_ID, loop.getDcaeBlueprintId()); + rootObject.addProperty(DCAE_SERVICETYPE_ID, loop.getLoopTemplate().getDcaeBlueprintId()); return rootObject.toString(); } -- cgit 1.2.3-korg