summaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/src/main/java/org/onap/policy/pdpx/main/rest/XacmlPdpApplicationManager.java13
-rw-r--r--main/src/main/java/org/onap/policy/pdpx/main/startstop/XacmlPdpActivator.java3
-rw-r--r--main/src/test/resources/decisions/decision.optimization.affinity.input.json6
3 files changed, 13 insertions, 9 deletions
diff --git a/main/src/main/java/org/onap/policy/pdpx/main/rest/XacmlPdpApplicationManager.java b/main/src/main/java/org/onap/policy/pdpx/main/rest/XacmlPdpApplicationManager.java
index 52b4e00d..37132a8f 100644
--- a/main/src/main/java/org/onap/policy/pdpx/main/rest/XacmlPdpApplicationManager.java
+++ b/main/src/main/java/org/onap/policy/pdpx/main/rest/XacmlPdpApplicationManager.java
@@ -32,6 +32,7 @@ import java.util.ServiceLoader;
import java.util.stream.Collectors;
import lombok.Getter;
import lombok.Setter;
+import org.onap.policy.common.endpoints.parameters.RestServerParameters;
import org.onap.policy.models.decisions.concepts.DecisionRequest;
import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy;
import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyIdentifier;
@@ -57,9 +58,9 @@ public class XacmlPdpApplicationManager {
/**
* One time to initialize the applications upon startup.
*/
- public XacmlPdpApplicationManager(Path applicationPath) {
+ public XacmlPdpApplicationManager(Path applicationPath, RestServerParameters policyApiParameters) {
if (LOGGER.isInfoEnabled()) {
- LOGGER.info("Initialization applications {}", applicationPath.toAbsolutePath());
+ LOGGER.info("Initialization applications {} {}", applicationPath.toAbsolutePath(), policyApiParameters);
}
//
// Load service
@@ -82,7 +83,7 @@ public class XacmlPdpApplicationManager {
// Have it initialize at a path
//
try {
- initializeApplicationPath(applicationPath, application);
+ initializeApplicationPath(applicationPath, application, policyApiParameters);
//
// We are initialized
//
@@ -221,8 +222,8 @@ public class XacmlPdpApplicationManager {
return mapLoadedPolicies.size();
}
- private void initializeApplicationPath(Path basePath, XacmlApplicationServiceProvider application)
- throws XacmlApplicationException {
+ private void initializeApplicationPath(Path basePath, XacmlApplicationServiceProvider application,
+ RestServerParameters policyApiParameters) throws XacmlApplicationException {
//
// Making an assumption that all application names are unique, and
// they can result in a valid directory being created.
@@ -250,6 +251,6 @@ public class XacmlPdpApplicationManager {
//
// Have the application initialize
//
- application.initialize(path);
+ application.initialize(path, policyApiParameters);
}
}
diff --git a/main/src/main/java/org/onap/policy/pdpx/main/startstop/XacmlPdpActivator.java b/main/src/main/java/org/onap/policy/pdpx/main/startstop/XacmlPdpActivator.java
index 16998a22..8d213954 100644
--- a/main/src/main/java/org/onap/policy/pdpx/main/startstop/XacmlPdpActivator.java
+++ b/main/src/main/java/org/onap/policy/pdpx/main/startstop/XacmlPdpActivator.java
@@ -89,7 +89,8 @@ public class XacmlPdpActivator extends ServiceManagerContainer {
try {
XacmlPdpApplicationManager appmgr =
- new XacmlPdpApplicationManager(Paths.get(xacmlPdpParameterGroup.getApplicationPath()));
+ new XacmlPdpApplicationManager(Paths.get(xacmlPdpParameterGroup.getApplicationPath()),
+ xacmlPdpParameterGroup.getPolicyApiParameters());
XacmlPdpApplicationManager.setCurrent(appmgr);
XacmlPdpStatisticsManager stats = new XacmlPdpStatisticsManager();
diff --git a/main/src/test/resources/decisions/decision.optimization.affinity.input.json b/main/src/test/resources/decisions/decision.optimization.affinity.input.json
index 1794acea..1bf18fde 100644
--- a/main/src/test/resources/decisions/decision.optimization.affinity.input.json
+++ b/main/src/test/resources/decisions/decision.optimization.affinity.input.json
@@ -4,7 +4,9 @@
"ONAPInstance": "OOF-component-instance",
"action": "optimize",
"resource": {
- "policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vGMuxInfra", "vG"],
- "policyType": "zone"
+ "scope": [],
+ "services": ["vCPE"],
+ "resources": [],
+ "geography": ["US"]
}
} \ No newline at end of file