From c4f54bf8f8520cb270ad3d7f8c91e12a951f138a Mon Sep 17 00:00:00 2001 From: xuegao Date: Tue, 21 Apr 2020 18:05:44 +0200 Subject: Guard policy clean up Remove guard policy related code, so that it will not be shown or created in the legacy policy UI. Issue-ID: CLAMP-825 Change-Id: I6c654fef9fd9df810fd48600c91ffef96db371cd Signed-off-by: xuegao --- .../loop/components/external/PolicyComponent.java | 9 +-------- .../clamp/policy/operational/OperationalPolicy.java | 21 --------------------- 2 files changed, 1 insertion(+), 29 deletions(-) (limited to 'src/main/java/org') 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 227f40a7..4ea5b711 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 @@ -85,13 +85,6 @@ public class PolicyComponent extends ExternalComponent { updatePdpGroupMap(opPolicy.getPdpGroup(), opPolicy.getPdpSubgroup(), opPolicy.getName(), "1.0.0", pdpGroupMap); - if (opPolicy.isLegacy()) { - for (String guardName:opPolicy.createGuardPolicyPayloads().keySet()) { - updatePdpGroupMap(opPolicy.getPdpGroup(), opPolicy.getPdpSubgroup(), - guardName, - "1.0.0", pdpGroupMap); - } - } } for (MicroServicePolicy msPolicy : loop.getMicroServicePolicies()) { @@ -186,7 +179,7 @@ public class PolicyComponent extends ExternalComponent { /** * This is a method that expect the results of the queries getPolicy and - * getPolicyDeployed for a unique policy (op,guard, config, etc ...). It + * getPolicyDeployed for a unique policy (op, config, etc ...). It * re-computes the global policy state for each policy results given. Therefore * this method is called multiple times from the camel route and must be reset * for a new global policy state retrieval. The state to compute the global diff --git a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java b/src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java index 1e721ce2..b4020c18 100644 --- a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java +++ b/src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java @@ -293,25 +293,4 @@ public class OperationalPolicy extends Policy implements Serializable { return super.createPolicyPayload(); } } - - /** - * Return a map containing all Guard policies indexed by Guard policy Name. - * - * @return The Guards map - */ - public Map createGuardPolicyPayloads() { - Map result = new HashMap<>(); - - if (this.getConfigurationsJson() != null) { - JsonElement guardsList = this.getConfigurationsJson().get("guard_policies"); - if (guardsList != null) { - for (JsonElement guardElem : guardsList.getAsJsonArray()) { - result.put(guardElem.getAsJsonObject().get("policy-id").getAsString(), - new GsonBuilder().create().toJson(guardElem)); - } - } - } - logger.info("Guard policy payload: " + result); - return result; - } } -- cgit 1.2.3-korg