Populate deployment parameters
[clamp.git] / src / main / java / org / onap / clamp / loop / Loop.java
index dd6fbf0..19a17db 100644 (file)
 
 package org.onap.clamp.loop;
 
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
 import com.google.gson.JsonObject;
 import com.google.gson.annotations.Expose;
-import java.io.IOException;
 import java.io.Serializable;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -60,6 +57,7 @@ import org.onap.clamp.loop.common.AuditEntity;
 import org.onap.clamp.loop.components.external.DcaeComponent;
 import org.onap.clamp.loop.components.external.ExternalComponent;
 import org.onap.clamp.loop.components.external.PolicyComponent;
+import org.onap.clamp.loop.deploy.DcaeDeployParameters;
 import org.onap.clamp.loop.log.LoopLog;
 import org.onap.clamp.loop.service.Service;
 import org.onap.clamp.loop.template.LoopElementModel;
@@ -77,9 +75,6 @@ public class Loop extends AuditEntity implements Serializable {
      */
     private static final long serialVersionUID = -286522707701388642L;
 
-    @Transient
-    private static final EELFLogger logger = EELFManager.getInstance().getLogger(Loop.class);
-
     @Id
     @Expose
     @Column(nullable = false, name = "name", unique = true)
@@ -170,25 +165,16 @@ public class Loop extends AuditEntity implements Serializable {
         this.setModelService(loopTemplate.getModelService());
         loopTemplate.getLoopElementModelsUsed().forEach(element -> {
             if (LoopElementModel.MICRO_SERVICE_TYPE.equals(element.getLoopElementModel().getLoopElementType())) {
-                try {
-                    this.addMicroServicePolicy((MicroServicePolicy) element.getLoopElementModel()
-                            .createPolicyInstance(this, toscaConverter));
-                } catch (IOException e) {
-                    logger.error("Exception caught when creating the microservice policy instance of the loop "
-                            + "instance", e);
-                }
+                this.addMicroServicePolicy((MicroServicePolicy) element.getLoopElementModel()
+                        .createPolicyInstance(this, toscaConverter));
             }
             else if (LoopElementModel.OPERATIONAL_POLICY_TYPE
                     .equals(element.getLoopElementModel().getLoopElementType())) {
-                try {
-                    this.addOperationalPolicy((OperationalPolicy) element.getLoopElementModel()
-                            .createPolicyInstance(this, toscaConverter));
-                } catch (IOException e) {
-                    logger.error("Exception caught when creating the operational policy instance of the loop instance",
-                            e);
-                }
+                this.addOperationalPolicy((OperationalPolicy) element.getLoopElementModel()
+                        .createPolicyInstance(this, toscaConverter));
             }
         });
+        this.setGlobalPropertiesJson(DcaeDeployParameters.getDcaeDeploymentParametersInJson(this));
     }
 
     public String getName() {