summaryrefslogtreecommitdiffstats
path: root/applications/optimization/src/main
diff options
context:
space:
mode:
authorPamela Dragosh <pdragosh@research.att.com>2019-08-30 15:21:05 -0400
committerPamela Dragosh <pdragosh@research.att.com>2019-09-09 15:27:30 -0400
commit85b5178017e89c815af7792826f52a90814f5dba (patch)
tree1cc49f6763f1af2cab372bb75ae6b9e5391c3ad7 /applications/optimization/src/main
parentdc68da3c00c0a814110e0f7529365d695bff571b (diff)
Integrate using Policy Type to find Matchable
Utilize's Jim's helper class to pull from API policy types definitions so that Xacml PDP can determine which properties are "matchable". Override initialize to set translator parameters. Utilize the metadata section of ToscaProperties to store the matchable field. Updated Matchable Request to be dynamic with respect to the incoming resource attributes. Stored the policy types as JSON. Issue-ID: POLICY-1899 Change-Id: Icff3605495b0a34ebfcdfa54346095ce2d8468a4 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Diffstat (limited to 'applications/optimization/src/main')
-rw-r--r--applications/optimization/src/main/java/org/onap/policy/xacml/pdp/application/optimization/OptimizationPdpApplication.java22
1 files changed, 21 insertions, 1 deletions
diff --git a/applications/optimization/src/main/java/org/onap/policy/xacml/pdp/application/optimization/OptimizationPdpApplication.java b/applications/optimization/src/main/java/org/onap/policy/xacml/pdp/application/optimization/OptimizationPdpApplication.java
index 91c46746..e2ab00c6 100644
--- a/applications/optimization/src/main/java/org/onap/policy/xacml/pdp/application/optimization/OptimizationPdpApplication.java
+++ b/applications/optimization/src/main/java/org/onap/policy/xacml/pdp/application/optimization/OptimizationPdpApplication.java
@@ -22,13 +22,15 @@
package org.onap.policy.xacml.pdp.application.optimization;
+import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
-
+import org.onap.policy.common.endpoints.parameters.RestServerParameters;
import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyTypeIdentifier;
import org.onap.policy.pdp.xacml.application.common.ToscaPolicyTranslator;
+import org.onap.policy.pdp.xacml.application.common.XacmlApplicationException;
import org.onap.policy.pdp.xacml.application.common.std.StdMatchableTranslator;
import org.onap.policy.pdp.xacml.application.common.std.StdXacmlApplicationServiceProvider;
import org.slf4j.Logger;
@@ -77,6 +79,21 @@ public class OptimizationPdpApplication extends StdXacmlApplicationServiceProvid
}
@Override
+ public void initialize(Path pathForData, RestServerParameters policyApiParameters)
+ throws XacmlApplicationException {
+ //
+ // Store our API parameters and path for translator so it
+ // can go get Policy Types
+ //
+ this.translator.setPathForData(pathForData);
+ this.translator.setApiRestParameters(policyApiParameters);
+ //
+ // Let our super class do its thing
+ //
+ super.initialize(pathForData, policyApiParameters);
+ }
+
+ @Override
public synchronized List<ToscaPolicyTypeIdentifier> supportedPolicyTypes() {
return Collections.unmodifiableList(supportedPolicyTypes);
}
@@ -102,6 +119,9 @@ public class OptimizationPdpApplication extends StdXacmlApplicationServiceProvid
@Override
protected ToscaPolicyTranslator getTranslator(String type) {
+ //
+ // Return translator
+ //
return translator;
}