summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/onap
diff options
context:
space:
mode:
authorxuegao <xg353y@intl.att.com>2020-04-21 18:05:44 +0200
committerxuegao <xg353y@intl.att.com>2020-04-22 10:12:34 +0200
commitc4f54bf8f8520cb270ad3d7f8c91e12a951f138a (patch)
treebb16683a68e5b1cdcd2bcfb59cc7518ef8cfbbf8 /src/main/java/org/onap
parent334ad564f969cb9d3ba1e47f5722ea43c71ee63f (diff)
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 <xg353y@intl.att.com>
Diffstat (limited to 'src/main/java/org/onap')
-rw-r--r--src/main/java/org/onap/clamp/loop/components/external/PolicyComponent.java9
-rw-r--r--src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java21
2 files changed, 1 insertions, 29 deletions
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 227f40a72..4ea5b7118 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 1e721ce24..b4020c18e 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<String, String> createGuardPolicyPayloads() {
- Map<String, String> 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;
- }
}