diff options
Diffstat (limited to 'controlloop/common/guard/src/main')
3 files changed, 11 insertions, 13 deletions
diff --git a/controlloop/common/guard/src/main/java/org/onap/policy/guard/CallGuardTask.java b/controlloop/common/guard/src/main/java/org/onap/policy/guard/CallGuardTask.java index 22fce1999..611dd2d8b 100644 --- a/controlloop/common/guard/src/main/java/org/onap/policy/guard/CallGuardTask.java +++ b/controlloop/common/guard/src/main/java/org/onap/policy/guard/CallGuardTask.java @@ -66,7 +66,7 @@ public class CallGuardTask implements Runnable { private PolicyGuardResponse guardResponse; /** - * Guard url is grabbed from PolicyEngine.manager properties + * Guard url is grabbed from PolicyEngine manager properties. */ public CallGuardTask(WorkingMemory wm, String cl, String act, String rec, String tar, String reqId, Supplier<Integer> vfcnt) { diff --git a/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardXacmlHelper.java b/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardXacmlHelper.java index 53f1cea4b..ed6cd6c5f 100644 --- a/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardXacmlHelper.java +++ b/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardXacmlHelper.java @@ -24,13 +24,12 @@ package org.onap.policy.guard; import java.util.HashMap; import java.util.Map; import java.util.UUID; - import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure; import org.onap.policy.common.endpoints.utils.NetLoggerUtil; import org.onap.policy.common.endpoints.utils.NetLoggerUtil.EventType; import org.onap.policy.common.utils.coder.CoderException; import org.onap.policy.common.utils.coder.StandardCoder; -import org.onap.policy.drools.system.PolicyEngine; +import org.onap.policy.drools.system.PolicyEngineConstants; import org.onap.policy.models.decisions.concepts.DecisionRequest; import org.onap.policy.models.decisions.concepts.DecisionResponse; import org.onap.policy.rest.RestManager; @@ -50,9 +49,9 @@ public class PolicyGuardXacmlHelper { * Constructor. */ public PolicyGuardXacmlHelper() { - this.url = PolicyEngine.manager.getEnvironmentProperty("guard.url"); - this.user = PolicyEngine.manager.getEnvironmentProperty("pdpx.username"); - this.pwd = PolicyEngine.manager.getEnvironmentProperty("pdpx.password"); + this.url = PolicyEngineConstants.getManager().getEnvironmentProperty("guard.url"); + this.user = PolicyEngineConstants.getManager().getEnvironmentProperty("pdpx.username"); + this.pwd = PolicyEngineConstants.getManager().getEnvironmentProperty("pdpx.password"); } /** diff --git a/controlloop/common/guard/src/main/java/org/onap/policy/guard/Util.java b/controlloop/common/guard/src/main/java/org/onap/policy/guard/Util.java index d859fbe09..717ca3f45 100644 --- a/controlloop/common/guard/src/main/java/org/onap/policy/guard/Util.java +++ b/controlloop/common/guard/src/main/java/org/onap/policy/guard/Util.java @@ -25,11 +25,10 @@ import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.nio.charset.StandardCharsets; - import org.apache.commons.io.IOUtils; import org.onap.policy.controlloop.policy.ControlLoopPolicy; import org.onap.policy.controlloop.policy.guard.ControlLoopGuard; -import org.onap.policy.drools.system.PolicyEngine; +import org.onap.policy.drools.system.PolicyEngineConstants; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.yaml.snakeyaml.Yaml; @@ -135,16 +134,16 @@ public final class Util { * <p>see /guard/src/test/java/org/onap/policy/guard/UtilTest.java for setting test properties */ public static void setGuardEnvProps(String url, String username, String password) { - PolicyEngine.manager.setEnvironmentProperty(org.onap.policy.guard.Util.PROP_GUARD_URL, url); - PolicyEngine.manager.setEnvironmentProperty(org.onap.policy.guard.Util.PROP_GUARD_USER, username); - PolicyEngine.manager.setEnvironmentProperty(org.onap.policy.guard.Util.PROP_GUARD_PASS, password); + PolicyEngineConstants.getManager().setEnvironmentProperty(org.onap.policy.guard.Util.PROP_GUARD_URL, url); + PolicyEngineConstants.getManager().setEnvironmentProperty(org.onap.policy.guard.Util.PROP_GUARD_USER, username); + PolicyEngineConstants.getManager().setEnvironmentProperty(org.onap.policy.guard.Util.PROP_GUARD_PASS, password); } public static void setGuardEnvProp(String key, String value) { - PolicyEngine.manager.setEnvironmentProperty(key, value); + PolicyEngineConstants.getManager().setEnvironmentProperty(key, value); } public static String getGuardProp(String propName) { - return PolicyEngine.manager.getEnvironmentProperty(propName); + return PolicyEngineConstants.getManager().getEnvironmentProperty(propName); } } |