diff options
Diffstat (limited to 'src/main/java')
3 files changed, 20 insertions, 15 deletions
diff --git a/src/main/java/org/onap/clamp/clds/config/DefaultUserConfiguration.java b/src/main/java/org/onap/clamp/clds/config/DefaultUserConfiguration.java index 1261a5e95..d20a7370c 100644 --- a/src/main/java/org/onap/clamp/clds/config/DefaultUserConfiguration.java +++ b/src/main/java/org/onap/clamp/clds/config/DefaultUserConfiguration.java @@ -53,7 +53,7 @@ import org.springframework.security.crypto.password.PasswordEncoder; public class DefaultUserConfiguration extends WebSecurityConfigurerAdapter { protected static final EELFLogger logger = EELFManager.getInstance().getLogger(DefaultUserConfiguration.class); - protected static final EELFLogger metricsLogger = EELFManager.getInstance().getMetricsLogger(); + private static final String SETUP_WEB_USERS_EXCEPTION_MSG = "Exception occurred during the " + " setup of the Web users in memory"; @Autowired 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 3e8cfaf9b..8b8547195 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 @@ -23,6 +23,8 @@ package org.onap.clamp.loop.components.external; +import com.att.eelf.configuration.EELFLogger; +import com.att.eelf.configuration.EELFManager; import com.google.gson.JsonObject; import java.util.Iterator; @@ -30,6 +32,7 @@ import java.util.LinkedList; import java.util.List; import java.util.UUID; +import javax.persistence.Transient; import org.apache.camel.Exchange; import org.json.simple.JSONArray; import org.json.simple.JSONObject; @@ -43,6 +46,9 @@ import org.onap.clamp.policy.microservice.MicroServicePolicy; public class DcaeComponent extends ExternalComponent { + @Transient + private static final EELFLogger logger = EELFManager.getInstance().getLogger(DcaeComponent.class); + private static final String DCAE_DEPLOYMENT_PREFIX = "CLAMP_"; private static final String DEPLOYMENT_PARAMETER = "dcaeDeployParameters"; private static final String DCAE_SERVICETYPE_ID = "serviceTypeId"; @@ -142,6 +148,7 @@ public class DcaeComponent extends ExternalComponent { if (deploymentProp != null) { rootObject.add(DCAE_INPUTS, deploymentProp); } + logger.info("DCAE Deploy payload for unique blueprint: " + rootObject.toString()); return rootObject.toString(); } @@ -164,6 +171,7 @@ public class DcaeComponent extends ExternalComponent { if (deploymentProp != null) { rootObject.add(DCAE_INPUTS, deploymentProp); } + logger.info("DCAE Deploy payload for multiple blueprints: " + rootObject.toString()); return rootObject.toString(); } @@ -176,6 +184,7 @@ public class DcaeComponent extends ExternalComponent { public static String getUndeployPayload(Loop loop) { JsonObject rootObject = new JsonObject(); rootObject.addProperty(DCAE_SERVICETYPE_ID, loop.getLoopTemplate().getDcaeBlueprintId()); + logger.info("DCAE Undeploy payload for unique blueprint: " + rootObject.toString()); return rootObject.toString(); } @@ -188,6 +197,7 @@ public class DcaeComponent extends ExternalComponent { public static String getUndeployPayload(MicroServicePolicy policy) { JsonObject rootObject = new JsonObject(); rootObject.addProperty(DCAE_SERVICETYPE_ID, policy.getDcaeBlueprintId()); + logger.info("DCAE Undeploy payload for multiple blueprints: " + rootObject.toString()); return rootObject.toString(); } diff --git a/src/main/java/org/onap/clamp/loop/components/external/PolicyComponent.java b/src/main/java/org/onap/clamp/loop/components/external/PolicyComponent.java index 2d7b807c0..f963e3514 100644 --- a/src/main/java/org/onap/clamp/loop/components/external/PolicyComponent.java +++ b/src/main/java/org/onap/clamp/loop/components/external/PolicyComponent.java @@ -81,13 +81,13 @@ public class PolicyComponent extends ExternalComponent { public static String createPoliciesPayloadPdpGroup(Loop loop) { HashMap<String, HashMap<String, List<JsonObject>>> pdpGroupMap = new HashMap<>(); for (OperationalPolicy opPolicy : loop.getOperationalPolicies()) { - pdpGroupMap = updatePdpGroupMap(opPolicy.getPdpGroup(), opPolicy.getPdpSubgroup(), + updatePdpGroupMap(opPolicy.getPdpGroup(), opPolicy.getPdpSubgroup(), opPolicy.getName(), opPolicy.getPolicyModel().getVersion(), pdpGroupMap); } for (MicroServicePolicy msPolicy : loop.getMicroServicePolicies()) { - pdpGroupMap = updatePdpGroupMap(msPolicy.getPdpGroup(), msPolicy.getPdpSubgroup(), + updatePdpGroupMap(msPolicy.getPdpGroup(), msPolicy.getPdpSubgroup(), msPolicy.getName(), msPolicy.getPolicyModel().getVersion(), pdpGroupMap); } @@ -98,13 +98,12 @@ public class PolicyComponent extends ExternalComponent { return payload; } - private static HashMap<String, HashMap<String, List<JsonObject>>> updatePdpGroupMap(String pdpGroup, - String pdpSubGroup, - String policyName, - String policyModelVersion, - HashMap<String, HashMap<String, - List<JsonObject>>> pdpGroupMap) { - + private static void updatePdpGroupMap(String pdpGroup, + String pdpSubGroup, + String policyName, + String policyModelVersion, + HashMap<String, HashMap<String, + List<JsonObject>>> pdpGroupMap) { JsonObject policyJson = new JsonObject(); policyJson.addProperty("name", policyName); policyJson.addProperty("version", policyModelVersion); @@ -126,8 +125,6 @@ public class PolicyComponent extends ExternalComponent { policyList.add(policyJson); pdpSubGroupMap.put(pdpSubGroup, policyList); pdpGroupMap.put(pdpGroup, pdpSubGroupMap); - - return pdpGroupMap; } private static JsonObject generateActivatePdpGroupPayload( @@ -170,9 +167,7 @@ public class PolicyComponent extends ExternalComponent { List<String> policyNamesList = new ArrayList<>(); for (OperationalPolicy opPolicy : loop.getOperationalPolicies()) { policyNamesList.add(opPolicy.getName()); - for (String guardName : opPolicy.createGuardPolicyPayloads().keySet()) { - policyNamesList.add(guardName); - } + policyNamesList.addAll(opPolicy.createGuardPolicyPayloads().keySet()); } for (MicroServicePolicy microServicePolicy : loop.getMicroServicePolicies()) { policyNamesList.add(microServicePolicy.getName()); |