summaryrefslogtreecommitdiffstats
path: root/applications/common
diff options
context:
space:
mode:
authorPamela Dragosh <pdragosh@research.att.com>2019-12-11 10:00:21 -0500
committerPamela Dragosh <pdragosh@research.att.com>2019-12-23 13:33:19 +0000
commit85744c81b27a833db4a8089c90a4faeb98d8f349 (patch)
tree290b6c6f6dfcc7c108182c6af44116e7bcfae581 /applications/common
parent4ff3b261231274ec9f3cd957ba50108fef3e0eb5 (diff)
Add optimization subscriber request
Adding support for a preliminary request to pull subscriber details. The returned decision adds scope attributes for the original request. Fixed some checkstyle issues due to new checkstyle requirements. Issue-ID: POLICY-2066 Change-Id: Ief02d896ce33e4864bb20e9185b0d0f5eb254bfd Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Diffstat (limited to 'applications/common')
-rw-r--r--applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/ToscaDictionary.java16
-rw-r--r--applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdMatchablePolicyRequest.java2
-rw-r--r--applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdXacmlApplicationServiceProvider.java3
3 files changed, 18 insertions, 3 deletions
diff --git a/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/ToscaDictionary.java b/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/ToscaDictionary.java
index 1a899971..c8dab3a8 100644
--- a/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/ToscaDictionary.java
+++ b/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/ToscaDictionary.java
@@ -106,6 +106,22 @@ public final class ToscaDictionary {
new IdentifierImpl(ID_URN_ONAP, "guard:advice:request-id");
/*
+ * These id's are specifically for optimization subscriber policies
+ */
+ public static final Identifier ID_SUBJECT_OPTIMIZATION_SUBSCRIBER_NAME =
+ new IdentifierImpl(ID_URN_ONAP, "optimization:subscriber:name");
+
+ /*
+ * These ids are specifically for optimization advice
+ */
+ public static final Identifier ID_ADVICE_OPTIMIZATION_SUBSCRIBER =
+ new IdentifierImpl(ID_URN_ONAP, "optimization:advice:subscriber");
+ public static final Identifier ID_ADVICE_OPTIMIZATION_SUBSCRIBER_ROLE =
+ new IdentifierImpl(ID_URN_ONAP, "optimization:advice:subscriber:role");
+ public static final Identifier ID_ADVICE_OPTIMIZATION_SUBSCRIBER_STATUS =
+ new IdentifierImpl(ID_URN_ONAP, "optimization:advice:subscriber:status");
+
+ /*
* Obligation specific ID's
*/
diff --git a/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdMatchablePolicyRequest.java b/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdMatchablePolicyRequest.java
index b478e8c1..2d83b897 100644
--- a/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdMatchablePolicyRequest.java
+++ b/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdMatchablePolicyRequest.java
@@ -163,7 +163,7 @@ public class StdMatchablePolicyRequest {
return mutableRequest;
}
- private static StdMutableRequestAttributes addResources(StdMutableRequestAttributes attributes,
+ protected static StdMutableRequestAttributes addResources(StdMutableRequestAttributes attributes,
Collection<Object> values, String id) throws DataTypeException {
DataTypeFactory factory = getDataTypeFactory();
diff --git a/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdXacmlApplicationServiceProvider.java b/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdXacmlApplicationServiceProvider.java
index 5aea3457..e43e6519 100644
--- a/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdXacmlApplicationServiceProvider.java
+++ b/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdXacmlApplicationServiceProvider.java
@@ -121,8 +121,7 @@ public abstract class StdXacmlApplicationServiceProvider implements XacmlApplica
//
// Convert the policies first
//
- PolicyType xacmlPolicy = this.getTranslator(toscaPolicy.getType())
- .convertPolicy(toscaPolicy);
+ PolicyType xacmlPolicy = this.getTranslator(toscaPolicy.getType()).convertPolicy(toscaPolicy);
if (xacmlPolicy == null) {
throw new ToscaPolicyConversionException("Failed to convert policy");
}