summaryrefslogtreecommitdiffstats
path: root/applications/guard
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-23 11:19:18 -0400
commit8e0aa0ffa5cef537de1c841acf38300832c52a56 (patch)
treed944e87a6c10068c390586f71e9ff66b6f685be3 /applications/guard
parent616e366adfff4ca35fb194cead8ab1de800ef35b (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/guard')
-rw-r--r--applications/guard/src/main/java/org/onap/policy/xacml/pdp/application/guard/GuardPolicyRequest.java4
-rw-r--r--applications/guard/src/main/java/org/onap/policy/xacml/pdp/application/guard/GuardTranslator.java14
2 files changed, 9 insertions, 9 deletions
diff --git a/applications/guard/src/main/java/org/onap/policy/xacml/pdp/application/guard/GuardPolicyRequest.java b/applications/guard/src/main/java/org/onap/policy/xacml/pdp/application/guard/GuardPolicyRequest.java
index 7394ab30..44b4d627 100644
--- a/applications/guard/src/main/java/org/onap/policy/xacml/pdp/application/guard/GuardPolicyRequest.java
+++ b/applications/guard/src/main/java/org/onap/policy/xacml/pdp/application/guard/GuardPolicyRequest.java
@@ -167,7 +167,7 @@ public class GuardPolicyRequest {
return request;
}
- private static GuardPolicyRequest findFields(GuardPolicyRequest request, Map<String, Object> guard)
+ protected static GuardPolicyRequest findFields(GuardPolicyRequest request, Map<String, Object> guard)
throws ToscaPolicyConversionException {
if (guard.containsKey("actor")) {
request.actorId = guard.get("actor").toString();
@@ -192,7 +192,7 @@ public class GuardPolicyRequest {
return request;
}
- private static GuardPolicyRequest findFilterFields(GuardPolicyRequest request, Map<String, Object> guard) {
+ protected static GuardPolicyRequest findFilterFields(GuardPolicyRequest request, Map<String, Object> guard) {
if (guard.containsKey("generic-vnf.vnf-name")) {
request.vnfName = guard.get("generic-vnf.vnf-name").toString();
}
diff --git a/applications/guard/src/main/java/org/onap/policy/xacml/pdp/application/guard/GuardTranslator.java b/applications/guard/src/main/java/org/onap/policy/xacml/pdp/application/guard/GuardTranslator.java
index fd9bb004..2083e69d 100644
--- a/applications/guard/src/main/java/org/onap/policy/xacml/pdp/application/guard/GuardTranslator.java
+++ b/applications/guard/src/main/java/org/onap/policy/xacml/pdp/application/guard/GuardTranslator.java
@@ -190,7 +190,7 @@ public class GuardTranslator implements ToscaPolicyTranslator {
* @param variable VariableDefinitionType to add
* @param newPolicyType PolicyType that will be updated
*/
- private void addVariableToConditionTypes(VariableReferenceType variable,
+ protected void addVariableToConditionTypes(VariableReferenceType variable,
PolicyType newPolicyType) {
//
// Iterate through the rules
@@ -440,7 +440,7 @@ public class GuardTranslator implements ToscaPolicyTranslator {
return reference;
}
- private Object parseTimestamp(String string) throws ToscaPolicyConversionException {
+ protected Object parseTimestamp(String string) throws ToscaPolicyConversionException {
//
// First see if it is a full datetime object
//
@@ -722,7 +722,7 @@ public class GuardTranslator implements ToscaPolicyTranslator {
}
}
- private String validateFilterPropertyField(Map<String, Object> filterAttributes)
+ protected String validateFilterPropertyField(Map<String, Object> filterAttributes)
throws ToscaPolicyConversionException {
Object field = filterAttributes.get(FIELD_FILTER_FIELD);
if (field != null) {
@@ -741,7 +741,7 @@ public class GuardTranslator implements ToscaPolicyTranslator {
throw new ToscaPolicyConversionException("Missing \'field\' from filter");
}
- private String validateFilterPropertyFilter(Map<String, Object> filterAttributes)
+ protected String validateFilterPropertyFilter(Map<String, Object> filterAttributes)
throws ToscaPolicyConversionException {
Object filter = filterAttributes.get(FIELD_FILTER_FILTER);
if (filter != null) {
@@ -750,7 +750,7 @@ public class GuardTranslator implements ToscaPolicyTranslator {
throw new ToscaPolicyConversionException("Missing \'filter\' from filter");
}
- private Identifier validateFilterPropertyFunction(Map<String, Object> filterAttributes)
+ protected Identifier validateFilterPropertyFunction(Map<String, Object> filterAttributes)
throws ToscaPolicyConversionException {
Object function = filterAttributes.get(FIELD_FILTER_FUNCTION);
if (function != null) {
@@ -782,7 +782,7 @@ public class GuardTranslator implements ToscaPolicyTranslator {
throw new ToscaPolicyConversionException("Missing \'function\' from filter");
}
- private boolean validateFilterPropertyBlacklist(Map<String, Object> filterAttributes)
+ protected boolean validateFilterPropertyBlacklist(Map<String, Object> filterAttributes)
throws ToscaPolicyConversionException {
Object filter = filterAttributes.get(FIELD_FILTER_BLACKLIST);
if (filter != null) {
@@ -797,7 +797,7 @@ public class GuardTranslator implements ToscaPolicyTranslator {
throw new ToscaPolicyConversionException("Missing \'blacklist\' from filter");
}
- private RuleType createFilterRule(String ruleId, String field, String filter, Identifier function,
+ protected RuleType createFilterRule(String ruleId, String field, String filter, Identifier function,
boolean isBlacklisted) {
RuleType rule = new RuleType();
rule.setRuleId(ruleId);