diff options
8 files changed, 32 insertions, 31 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 4b50e724..03efca04 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 @@ -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. @@ -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 329a21ca..f2cfe37d 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 @@ -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"); @@ -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 @@ -604,7 +604,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"); } 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); diff --git a/applications/monitoring/src/main/java/org/onap/policy/xacml/pdp/application/monitoring/MonitoringPdpApplication.java b/applications/monitoring/src/main/java/org/onap/policy/xacml/pdp/application/monitoring/MonitoringPdpApplication.java index 17a9e743..5e09c22c 100644 --- a/applications/monitoring/src/main/java/org/onap/policy/xacml/pdp/application/monitoring/MonitoringPdpApplication.java +++ b/applications/monitoring/src/main/java/org/onap/policy/xacml/pdp/application/monitoring/MonitoringPdpApplication.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"); @@ -118,7 +118,7 @@ public class MonitoringPdpApplication extends StdXacmlApplicationServiceProvider * * @param queryParams - http request query parameters */ - private boolean checkAbbreviateResults(Map<String, String[]> queryParams) { + protected boolean checkAbbreviateResults(Map<String, String[]> queryParams) { if (queryParams != null && !queryParams.isEmpty()) { // Check if query params contains "abbrev" flag if (queryParams.containsKey("abbrev")) { diff --git a/applications/native/src/main/java/org/onap/policy/xacml/pdp/application/nativ/NativePdpApplicationTranslator.java b/applications/native/src/main/java/org/onap/policy/xacml/pdp/application/nativ/NativePdpApplicationTranslator.java index 34ef1462..de5030e4 100644 --- a/applications/native/src/main/java/org/onap/policy/xacml/pdp/application/nativ/NativePdpApplicationTranslator.java +++ b/applications/native/src/main/java/org/onap/policy/xacml/pdp/application/nativ/NativePdpApplicationTranslator.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP * ================================================================================ - * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved. * Modifications Copyright (C) 2020 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -85,7 +85,7 @@ public class NativePdpApplicationTranslator implements ToscaPolicyTranslator { } } - private String getNativeXacmlPolicy(ToscaPolicy toscaPolicy) throws ToscaPolicyConversionException { + protected String getNativeXacmlPolicy(ToscaPolicy toscaPolicy) throws ToscaPolicyConversionException { Map<String, Object> propertyMap = toscaPolicy.getProperties(); if (MapUtils.isEmpty(propertyMap) || !propertyMap.containsKey(POLICY)) { 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(); |