diff options
author | Pamela Dragosh <pdragosh@research.att.com> | 2021-06-23 11:05:05 -0400 |
---|---|---|
committer | Pamela Dragosh <pdragosh@research.att.com> | 2021-06-23 11:19:18 -0400 |
commit | 8e0aa0ffa5cef537de1c841acf38300832c52a56 (patch) | |
tree | d944e87a6c10068c390586f71e9ff66b6f685be3 /applications/optimization/src/main | |
parent | 616e366adfff4ca35fb194cead8ab1de800ef35b (diff) |
Use protected methods vs private
Application and common code in xacml-pdp is meant to be
available for developers to re-use and/or extend as desired.
Private methods are unnecessary at this time, but could be
re-visited in a later release.
For Honolulu, simply moving to protected to keep functionality
the same. Possibly for Istanbul we can make more changes to
support mixing of ONAP application with custom applications
during runtime.
Issue-ID: POLICY-3305
Change-Id: I6db23bda3c81fdbbf86e39cc2cd2e706d8bee63d
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Diffstat (limited to 'applications/optimization/src/main')
2 files changed, 10 insertions, 10 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 8b0442bb..fa41235a 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 @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP * ================================================================================ - * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved. * Modifications Copyright (C) 2021 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -188,14 +188,14 @@ public class OptimizationPdpApplication extends StdXacmlApplicationServiceProvid } @SuppressWarnings("unchecked") - private boolean hasSubscriberAttributes(DecisionRequest request) { + protected boolean hasSubscriberAttributes(DecisionRequest request) { return request.getContext() != null && request.getContext().containsKey(RESOURCE_SUBSCRIBERNAME) && request.getContext().get(RESOURCE_SUBSCRIBERNAME) instanceof List && ! ((List<String>) request.getContext().get(RESOURCE_SUBSCRIBERNAME)).isEmpty(); } - private boolean addSubscriberAttributes(Response xacmlResponse, DecisionRequest initialRequest) { + protected boolean addSubscriberAttributes(Response xacmlResponse, DecisionRequest initialRequest) { // // This has multiple results right now because of how the attributes were added to the // request. That will have to be fixed in the future, for now find the Permit result @@ -221,7 +221,7 @@ public class OptimizationPdpApplication extends StdXacmlApplicationServiceProvid return false; } - private void addSubscriberAdvice(Response xacmlResponse, DecisionResponse response) { + protected void addSubscriberAdvice(Response xacmlResponse, DecisionResponse response) { // // Again find the Permit result // @@ -237,7 +237,7 @@ public class OptimizationPdpApplication extends StdXacmlApplicationServiceProvid @SuppressWarnings("unchecked") - private void scanAdvice(Collection<Advice> adviceCollection, DecisionRequest initialRequest) { + protected void scanAdvice(Collection<Advice> adviceCollection, DecisionRequest initialRequest) { // // There really should only be one advice object // diff --git a/applications/optimization/src/main/java/org/onap/policy/xacml/pdp/application/optimization/OptimizationPdpApplicationTranslator.java b/applications/optimization/src/main/java/org/onap/policy/xacml/pdp/application/optimization/OptimizationPdpApplicationTranslator.java index 52f1ec0a..bc4eb85b 100644 --- a/applications/optimization/src/main/java/org/onap/policy/xacml/pdp/application/optimization/OptimizationPdpApplicationTranslator.java +++ b/applications/optimization/src/main/java/org/onap/policy/xacml/pdp/application/optimization/OptimizationPdpApplicationTranslator.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP * ================================================================================ - * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -137,7 +137,7 @@ public class OptimizationPdpApplicationTranslator extends StdMatchableTranslator } @SuppressWarnings("unchecked") - private static void addValuesToMap(Object values, String key, Map<String, Object> mapAdvice) { + protected static void addValuesToMap(Object values, String key, Map<String, Object> mapAdvice) { if (values instanceof Collection) { List<String> valueList = new ArrayList<>(); ((Collection<Object>) values).forEach(val -> valueList.add(val.toString())); @@ -149,7 +149,7 @@ public class OptimizationPdpApplicationTranslator extends StdMatchableTranslator } @SuppressWarnings("unchecked") - private static PolicyType addSubscriberNameIntoTarget(PolicyType policy, + protected static PolicyType addSubscriberNameIntoTarget(PolicyType policy, Map<String, Object> subscriberProperties) throws ToscaPolicyConversionException { // // Find the subscriber names @@ -185,7 +185,7 @@ public class OptimizationPdpApplicationTranslator extends StdMatchableTranslator } @SuppressWarnings("unchecked") - private static AdviceExpressionsType generateSubscriberAdvice(Map<String, Object> subscriberProperties) + protected static AdviceExpressionsType generateSubscriberAdvice(Map<String, Object> subscriberProperties) throws ToscaPolicyConversionException { // // Get the subscriber role @@ -229,7 +229,7 @@ public class OptimizationPdpApplicationTranslator extends StdMatchableTranslator return adviceExpressions; } - private static AdviceExpressionType generateSubscriberAdviceAttributes(AdviceExpressionType adviceExpression, + protected static AdviceExpressionType generateSubscriberAdviceAttributes(AdviceExpressionType adviceExpression, Identifier attributeId, Collection<Object> adviceAttribute) { for (Object attribute : adviceAttribute) { AttributeValueType value = new AttributeValueType(); |