aboutsummaryrefslogtreecommitdiffstats
path: root/applications/common/src
diff options
context:
space:
mode:
authorPamela Dragosh <pdragosh@research.att.com>2021-06-23 11:05:05 -0400
committerPamela Dragosh <pdragosh@research.att.com>2021-06-24 10:33:45 -0400
commit9d3f4f0bef642836731213dc05e9127bca34200c (patch)
treeeb3ff8543af5b3eb07fd9856b5e82292b000ac5d /applications/common/src
parent402eae5ca3e064a9a3de70c2df9d85135d34ae7c (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> (cherry picked from commit 8e0aa0ffa5cef537de1c841acf38300832c52a56) Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Diffstat (limited to 'applications/common/src')
-rw-r--r--applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdCombinedPolicyRequest.java5
-rw-r--r--applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdMatchableTranslator.java8
2 files changed, 7 insertions, 6 deletions
diff --git a/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdCombinedPolicyRequest.java b/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdCombinedPolicyRequest.java
index 75b89d24..9618d5b7 100644
--- a/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdCombinedPolicyRequest.java
+++ b/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdCombinedPolicyRequest.java
@@ -112,14 +112,15 @@ public class StdCombinedPolicyRequest {
return request;
}
- private static StdCombinedPolicyRequest addPolicyIds(StdCombinedPolicyRequest request, Collection<Object> ids) {
+ protected static StdCombinedPolicyRequest addPolicyIds(StdCombinedPolicyRequest request, Collection<Object> ids) {
for (Object id : ids) {
request.resource.add(id.toString());
}
return request;
}
- private static StdCombinedPolicyRequest addPolicyTypes(StdCombinedPolicyRequest request, Collection<Object> types) {
+ protected static StdCombinedPolicyRequest addPolicyTypes(StdCombinedPolicyRequest request,
+ Collection<Object> types) {
for (Object type : types) {
request.resourcePolicyType.add(type.toString());
}
diff --git a/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdMatchableTranslator.java b/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdMatchableTranslator.java
index 9d0124bb..8d712768 100644
--- a/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdMatchableTranslator.java
+++ b/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdMatchableTranslator.java
@@ -477,7 +477,7 @@ public class StdMatchableTranslator extends StdBaseTranslator implements Matcha
* @param policyTypeId ToscaConceptIdentifier to find
* @return ToscaPolicyType object. Can be null if failure.
*/
- private ToscaServiceTemplate findPolicyType(ToscaConceptIdentifier policyTypeId) {
+ protected ToscaServiceTemplate findPolicyType(ToscaConceptIdentifier policyTypeId) {
//
// Is it loaded in memory?
//
@@ -508,7 +508,7 @@ public class StdMatchableTranslator extends StdBaseTranslator implements Matcha
* @param policyTypeId ToscaConceptIdentifier input
* @return ToscaPolicyType object. Null if failure.
*/
- private ToscaServiceTemplate loadPolicyType(ToscaConceptIdentifier policyTypeId) {
+ protected ToscaServiceTemplate loadPolicyType(ToscaConceptIdentifier policyTypeId) {
//
// Construct what the file name should be
//
@@ -567,7 +567,7 @@ public class StdMatchableTranslator extends StdBaseTranslator implements Matcha
* @param policyTypePath Path object to store locally
* @return ToscaPolicyType object. Null if failure.
*/
- private synchronized ToscaServiceTemplate pullPolicyType(ToscaConceptIdentifier policyTypeId,
+ protected synchronized ToscaServiceTemplate pullPolicyType(ToscaConceptIdentifier policyTypeId,
Path policyTypePath) {
//
// This is what we return
@@ -603,7 +603,7 @@ public class StdMatchableTranslator extends StdBaseTranslator implements Matcha
* @param policyTypeId ToscaConceptIdentifier
* @return Path object
*/
- private Path constructLocalFilePath(ToscaConceptIdentifier policyTypeId) {
+ protected Path constructLocalFilePath(ToscaConceptIdentifier policyTypeId) {
return Paths.get(this.pathForData.toAbsolutePath().toString(), policyTypeId.getName() + "-"
+ policyTypeId.getVersion() + ".yaml");
}